Skip to content

Commit

Permalink
🐛 Fix sqlite migration id auto-increment
Browse files Browse the repository at this point in the history
This fixes the sqlite migration id as it was not auto-incrementing
when adding a new migration.

Signed-off-by: Edward Fitz Abucay <ffimnsr@gmail.com>
  • Loading branch information
ffimnsr committed Sep 18, 2024
1 parent 31826c0 commit 6159223
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ pub(crate) fn midas_entry(
.expect("msg: No database connection url was provided");

debug!("Using DSN: {}", raw_db_url);

let default_source_path = Some("migrations".to_string());
let env_source_path = env::var("MIGRATIONS_ROOT").ok();
let source = matches
Expand Down
2 changes: 1 addition & 1 deletion src/sequel/sqlite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ impl SequelDriver for Sqlite {
}

fn ensure_migration_table_exists(&mut self) -> Result<(), Error> {
let payload = "CREATE TABLE IF NOT EXISTS __schema_migrations (id SERIAL PRIMARY KEY, migration BIGINT)";
let payload = "CREATE TABLE IF NOT EXISTS __schema_migrations (id INTEGER PRIMARY KEY AUTOINCREMENT, migration BIGINT)";
self.conn.execute(payload, ())?;
Ok(())
}
Expand Down

0 comments on commit 6159223

Please sign in to comment.