sqldb: use the new schema

We put this new schema update into the main line and change the
versions of the schema updates which are currently only available
in dev builds. The schemas need to be chronological therefore we
also need to rename the file numbers.
This commit is contained in:
ziggie
2025-08-13 22:26:03 +02:00
parent 506d226eb3
commit ea9fb80eff
8 changed files with 16 additions and 6 deletions

View File

@@ -46,7 +46,7 @@ func (d *DefaultDatabaseBuilder) getGraphStore(baseDB *sqldb.BaseDB,
// graphSQLMigration is the version number for the graph migration
// that migrates the KV graph to the native SQL schema.
const graphSQLMigration = 9
const graphSQLMigration = 10
// getSQLMigration returns a migration function for the given version.
func (d *DefaultDatabaseBuilder) getSQLMigration(ctx context.Context,

View File

@@ -73,6 +73,11 @@ var (
// schema. This is optional and can be disabled by the
// user if necessary.
},
{
Name: "000007_invoice_add_settled_index",
Version: 8,
SchemaVersion: 7,
},
}, migrationAdditions...)
// ErrMigrationMismatch is returned when a migrated record does not

View File

@@ -4,14 +4,14 @@ package sqldb
var migrationAdditions = []MigrationConfig{
{
Name: "000007_graph",
Version: 8,
SchemaVersion: 7,
Name: "000008_graph",
Version: 9,
SchemaVersion: 8,
},
{
Name: "kv_graph_migration",
Version: 9,
SchemaVersion: 7,
Version: 10,
SchemaVersion: 8,
// A migration function may be attached to this
// migration to migrate KV graph to the native SQL
// schema. This is optional and can be disabled by the

View File

@@ -2,4 +2,9 @@
package sqldb
// migrationAdditions is a list of migrations that are added to the
// migrationConfig slice.
//
// NOTE: This should always be empty and instead migrations for production
// should be added into the main line (see migrations.go).
var migrationAdditions []MigrationConfig