diff --git a/crates/cdk-sql-common/src/mint/auth/migrations.rs b/crates/cdk-sql-common/src/mint/auth/migrations.rs index a285e48a..ee53d6bd 100644 --- a/crates/cdk-sql-common/src/mint/auth/migrations.rs +++ b/crates/cdk-sql-common/src/mint/auth/migrations.rs @@ -2,6 +2,8 @@ /// Auto-generated by build.rs pub static MIGRATIONS: &[(&str, &str, &str)] = &[ ("postgres", "1_init.sql", include_str!(r#"./migrations/postgres/1_init.sql"#)), + ("postgres", "20250822104351_rename_blind_message_y_to_b.sql", include_str!(r#"./migrations/postgres/20250822104351_rename_blind_message_y_to_b.sql"#)), ("sqlite", "1_fix_sqlx_migration.sql", include_str!(r#"./migrations/sqlite/1_fix_sqlx_migration.sql"#)), ("sqlite", "20250109143347_init.sql", include_str!(r#"./migrations/sqlite/20250109143347_init.sql"#)), + ("sqlite", "20250822104351_rename_blind_message_y_to_b.sql", include_str!(r#"./migrations/sqlite/20250822104351_rename_blind_message_y_to_b.sql"#)), ]; diff --git a/crates/cdk-sql-common/src/mint/auth/migrations/postgres/20250822104351_rename_blind_message_y_to_b.sql b/crates/cdk-sql-common/src/mint/auth/migrations/postgres/20250822104351_rename_blind_message_y_to_b.sql new file mode 100644 index 00000000..b3a45f05 --- /dev/null +++ b/crates/cdk-sql-common/src/mint/auth/migrations/postgres/20250822104351_rename_blind_message_y_to_b.sql @@ -0,0 +1,2 @@ +-- Rename column y to b +ALTER TABLE blind_signature RENAME COLUMN y TO blinded_message; \ No newline at end of file diff --git a/crates/cdk-sql-common/src/mint/auth/migrations/sqlite/20250822104351_rename_blind_message_y_to_b.sql b/crates/cdk-sql-common/src/mint/auth/migrations/sqlite/20250822104351_rename_blind_message_y_to_b.sql new file mode 100644 index 00000000..b3a45f05 --- /dev/null +++ b/crates/cdk-sql-common/src/mint/auth/migrations/sqlite/20250822104351_rename_blind_message_y_to_b.sql @@ -0,0 +1,2 @@ +-- Rename column y to b +ALTER TABLE blind_signature RENAME COLUMN y TO blinded_message; \ No newline at end of file diff --git a/crates/cdk-sql-common/src/mint/auth/mod.rs b/crates/cdk-sql-common/src/mint/auth/mod.rs index 60f4f4ba..8effd9fc 100644 --- a/crates/cdk-sql-common/src/mint/auth/mod.rs +++ b/crates/cdk-sql-common/src/mint/auth/mod.rs @@ -174,12 +174,12 @@ where r#" INSERT INTO blind_signature - (y, amount, keyset_id, c) + (blinded_message, amount, keyset_id, c) VALUES - (:y, :amount, :keyset_id, :c) + (:blinded_message, :amount, :keyset_id, :c) "#, )? - .bind("y", message.to_bytes().to_vec()) + .bind("blinded_message", message.to_bytes().to_vec()) .bind("amount", u64::from(signature.amount) as i64) .bind("keyset_id", signature.keyset_id.to_string()) .bind("c", signature.c.to_bytes().to_vec()) @@ -353,17 +353,17 @@ where c, dleq_e, dleq_s, - y + blinded_message, FROM blind_signature - WHERE y IN (:y) + WHERE blinded_message IN (:blinded_message) "#, )? .bind_vec( - "y", + "blinded_message", blinded_messages .iter() - .map(|y| y.to_bytes().to_vec()) + .map(|bm| bm.to_bytes().to_vec()) .collect(), ) .fetch_all(&*conn) @@ -382,7 +382,7 @@ where .collect::, Error>>()?; Ok(blinded_messages .iter() - .map(|y| blinded_signatures.remove(y)) + .map(|bm| blinded_signatures.remove(bm)) .collect()) }