Add missing migrations for wallet and auth db

This commit is contained in:
Cesar Rodas
2025-07-29 20:28:09 -03:00
parent f0af2121b2
commit ed7b64b71a
4 changed files with 42 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
/// @generated
/// Auto-generated by build.rs
pub static MIGRATIONS: &[(&str, &str, &str)] = &[
("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"#)),
];

View File

@@ -0,0 +1,20 @@
-- Migrate `_sqlx_migrations` to our new migration system
CREATE TABLE IF NOT EXISTS _sqlx_migrations AS
SELECT
'' AS version,
'' AS description,
0 AS execution_time
WHERE 0;
INSERT INTO migrations
SELECT
version || '_' || REPLACE(description, ' ', '_') || '.sql',
execution_time
FROM _sqlx_migrations
WHERE EXISTS (
SELECT 1
FROM sqlite_master
WHERE type = 'table' AND name = '_sqlx_migrations'
);
DROP TABLE _sqlx_migrations;

View File

@@ -1,6 +1,7 @@
/// @generated
/// Auto-generated by build.rs
pub static MIGRATIONS: &[(&str, &str, &str)] = &[
("sqlite", "1_fix_sqlx_migration.sql", include_str!(r#"./migrations/sqlite/1_fix_sqlx_migration.sql"#)),
("sqlite", "20240612132920_init.sql", include_str!(r#"./migrations/sqlite/20240612132920_init.sql"#)),
("sqlite", "20240618200350_quote_state.sql", include_str!(r#"./migrations/sqlite/20240618200350_quote_state.sql"#)),
("sqlite", "20240626091921_nut04_state.sql", include_str!(r#"./migrations/sqlite/20240626091921_nut04_state.sql"#)),

View File

@@ -0,0 +1,20 @@
-- Migrate `_sqlx_migrations` to our new migration system
CREATE TABLE IF NOT EXISTS _sqlx_migrations AS
SELECT
'' AS version,
'' AS description,
0 AS execution_time
WHERE 0;
INSERT INTO migrations
SELECT
version || '_' || REPLACE(description, ' ', '_') || '.sql',
execution_time
FROM _sqlx_migrations
WHERE EXISTS (
SELECT 1
FROM sqlite_master
WHERE type = 'table' AND name = '_sqlx_migrations'
);
DROP TABLE _sqlx_migrations;