diff --git a/server/src/domain/sql_migrations.rs b/server/src/domain/sql_migrations.rs index 62d9e59..ff5bb21 100644 --- a/server/src/domain/sql_migrations.rs +++ b/server/src/domain/sql_migrations.rs @@ -116,6 +116,7 @@ pub async fn upgrade_to_v1(pool: &DbConnection) -> std::result::Result<(), sea_o .col( ColumnDef::new(Groups::GroupId) .integer() + .auto_increment() .not_null() .primary_key(), ) @@ -309,7 +310,7 @@ pub async fn upgrade_to_v1(pool: &DbConnection) -> std::result::Result<(), sea_o Table::create() .table(Metadata::Table) .if_not_exists() - .col(ColumnDef::new(Metadata::Version).tiny_integer()), + .col(ColumnDef::new(Metadata::Version).small_integer()), ), ) .await?; diff --git a/server/src/domain/sql_tables.rs b/server/src/domain/sql_tables.rs index af5615a..1bc4f77 100644 --- a/server/src/domain/sql_tables.rs +++ b/server/src/domain/sql_tables.rs @@ -4,7 +4,7 @@ use sea_orm::Value; pub type DbConnection = sea_orm::DatabaseConnection; #[derive(Copy, PartialEq, Eq, Debug, Clone)] -pub struct SchemaVersion(pub u8); +pub struct SchemaVersion(pub i16); impl sea_orm::TryGetable for SchemaVersion { fn try_get( @@ -12,7 +12,7 @@ impl sea_orm::TryGetable for SchemaVersion { pre: &str, col: &str, ) -> Result { - Ok(SchemaVersion(u8::try_get(res, pre, col)?)) + Ok(SchemaVersion(i16::try_get(res, pre, col)?)) } }