mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-06 01:18:17 +02: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:
@@ -100,7 +100,7 @@ func createInvoiceHashIndex(ctx context.Context, db kvdb.Backend,
|
||||
|
||||
return tx.InsertKVInvoiceKeyAndAddIndex(ctx,
|
||||
sqlc.InsertKVInvoiceKeyAndAddIndexParams{
|
||||
ID: int32(invoiceKey),
|
||||
ID: int64(invoiceKey),
|
||||
AddIndex: int64(addIndexNo),
|
||||
},
|
||||
)
|
||||
@@ -132,7 +132,7 @@ func createInvoiceHashIndex(ctx context.Context, db kvdb.Backend,
|
||||
|
||||
return tx.SetKVInvoicePaymentHash(ctx,
|
||||
sqlc.SetKVInvoicePaymentHashParams{
|
||||
ID: int32(invoiceKey),
|
||||
ID: int64(invoiceKey),
|
||||
Hash: k,
|
||||
},
|
||||
)
|
||||
|
Reference in New Issue
Block a user