Skip to content

Commit 80e6352

Browse files
committed
fix: heal bad sqlite migration
1 parent 05fc5fe commit 80e6352

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

crates/cdk-sql-common/src/mint/migrations/sqlite/20250307213652_keyset_id_as_foreign_key.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ CREATE TABLE proof_new (
1717
);
1818

1919
-- Copy data from old proof table to new one
20-
INSERT INTO proof_new SELECT * FROM proof;
20+
INSERT INTO proof_new (y, amount, keyset_id, secret, c, witness, state, quote_id) SELECT y, amount, keyset_id, secret, c, witness, state, quote_id FROM proof;
2121

2222
-- Create new blind_signature table with foreign key constraint
2323
CREATE TABLE blind_signature_new (
@@ -31,7 +31,7 @@ CREATE TABLE blind_signature_new (
3131
);
3232

3333
-- Copy data from old blind_signature table to new one
34-
INSERT INTO blind_signature_new SELECT * FROM blind_signature;
34+
INSERT INTO blind_signature_new (y, amount, keyset_id, c, quote_id, dleq_e, dleq_s) SELECT y, amount, keyset_id, c, quote_id, dleq_e, dleq_s FROM blind_signature;
3535

3636
-- Drop old tables
3737
DROP TABLE IF EXISTS proof;

crates/cdk-sql-common/src/mint/migrations/sqlite/20250415093121_drop_keystore_foreign.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ CREATE TABLE proof_new (
1010
created_time INTEGER NOT NULL DEFAULT 0
1111
);
1212

13-
INSERT INTO proof_new SELECT * FROM proof;
13+
INSERT INTO proof_new (y, amount, keyset_id, secret, c, witness, state, quote_id, created_time) SELECT y, amount, keyset_id, secret, c, witness, state, quote_id, created_time FROM proof;
1414
DROP TABLE proof;
1515
ALTER TABLE proof_new RENAME TO proof;
1616

@@ -26,6 +26,6 @@ CREATE TABLE blind_signature_new (
2626
created_time INTEGER NOT NULL DEFAULT 0
2727
);
2828

29-
INSERT INTO blind_signature_new SELECT * FROM blind_signature;
29+
INSERT INTO blind_signature_new (y, amount, keyset_id, c, dleq_e, dleq_s, quote_id, created_time) SELECT y, amount, keyset_id, c, dleq_e, dleq_s, quote_id, created_time FROM blind_signature;
3030
DROP TABLE blind_signature;
3131
ALTER TABLE blind_signature_new RENAME TO blind_signature;

0 commit comments

Comments
 (0)