fix(writers): drop version stamps from generated output
Generated files carried the RelSpec version and build date, so every rebuild produced a diff even when the schema was unchanged. - bun, gorm, drizzle: remove the GeneratedBy template field and line - pgsql, mssql, sqlite: emit a constant "-- Generated by RelSpec" - bun: replace the version header test with a version-free assertion pkg/buildinfo is unchanged and still backs the CLI version.
This commit is contained in:
@@ -7,7 +7,6 @@ import (
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"git.warky.dev/wdevs/relspecgo/pkg/buildinfo"
|
||||
"git.warky.dev/wdevs/relspecgo/pkg/models"
|
||||
"git.warky.dev/wdevs/relspecgo/pkg/pgsql"
|
||||
"git.warky.dev/wdevs/relspecgo/pkg/writers"
|
||||
@@ -144,7 +143,7 @@ func (w *MigrationWriter) WriteMigration(model, current *models.Database) error
|
||||
|
||||
// Write header
|
||||
fmt.Fprintf(w.writer, "-- PostgreSQL Migration Script\n")
|
||||
fmt.Fprintf(w.writer, "-- Generated by %s\n", buildinfo.GeneratedComment())
|
||||
fmt.Fprintf(w.writer, "-- Generated by RelSpec\n")
|
||||
fmt.Fprintf(w.writer, "-- Source: %s -> %s\n", current.Name, model.Name)
|
||||
if w.options.ContinueOnError {
|
||||
fmt.Fprintf(w.writer, "\\set ON_ERROR_STOP off\n")
|
||||
|
||||
Reference in New Issue
Block a user