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:
@@ -10,7 +10,6 @@ import (
|
||||
|
||||
_ "modernc.org/sqlite" // SQLite driver
|
||||
|
||||
"git.warky.dev/wdevs/relspecgo/pkg/buildinfo"
|
||||
"git.warky.dev/wdevs/relspecgo/pkg/models"
|
||||
"git.warky.dev/wdevs/relspecgo/pkg/writers"
|
||||
)
|
||||
@@ -73,7 +72,7 @@ func (w *Writer) writeContent(db *models.Database) error {
|
||||
// Write header comment
|
||||
fmt.Fprintf(w.writer, "-- SQLite Database Schema\n")
|
||||
fmt.Fprintf(w.writer, "-- Database: %s\n", db.Name)
|
||||
fmt.Fprintf(w.writer, "-- Generated by %s\n", buildinfo.GeneratedComment())
|
||||
fmt.Fprintf(w.writer, "-- Generated by RelSpec\n")
|
||||
fmt.Fprintf(w.writer, "-- Note: SQLite has no schema concept; non-default schema names are flattened into table name prefixes (e.g., auth.sessions -> auth_sessions)\n\n")
|
||||
|
||||
// Enable foreign keys
|
||||
|
||||
Reference in New Issue
Block a user