mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-30 16:10:01 +01:00
sqldb: ensure schema definitions are fully SQLite compatible
Previously, we applied replacements to our schema definitions to make them compatible with both SQLite and Postgres backends, as the files were not fully compatible with either. With this change, the only replacement required for SQLite has been moved to the generator script. This adjustment ensures compatibility by enabling auto-incrementing primary keys that are treated as 64-bit integers by sqlc.
This commit is contained in:
@@ -28,13 +28,10 @@ const (
|
||||
)
|
||||
|
||||
var (
|
||||
// sqliteSchemaReplacements is a map of schema strings that need to be
|
||||
// replaced for sqlite. This is needed because sqlite doesn't directly
|
||||
// support the BIGINT type for primary keys, so we need to replace it
|
||||
// with INTEGER.
|
||||
sqliteSchemaReplacements = map[string]string{
|
||||
"BIGINT PRIMARY KEY": "INTEGER PRIMARY KEY",
|
||||
}
|
||||
// sqliteSchemaReplacements maps schema strings to their SQLite
|
||||
// compatible replacements. Currently, no replacements are needed as our
|
||||
// SQL schema definition files are designed for SQLite compatibility.
|
||||
sqliteSchemaReplacements = map[string]string{}
|
||||
|
||||
// Make sure SqliteStore implements the MigrationExecutor interface.
|
||||
_ MigrationExecutor = (*SqliteStore)(nil)
|
||||
|
||||
Reference in New Issue
Block a user