diff --git a/migrations/202208051010_api_kgon_synchronization_history/up.sql b/migrations/202208051010_api_kgon_synchronization_history/up.sql index f1c7d99..a91e050 100644 --- a/migrations/202208051010_api_kgon_synchronization_history/up.sql +++ b/migrations/202208051010_api_kgon_synchronization_history/up.sql @@ -1,5 +1,5 @@ CREATE TABLE IF NOT EXISTS api_kgon_synchronization_history ( - id SERIAL PRIMARY KEY, + id BIGSERIAL PRIMARY KEY, item TEXT NOT NULL, start_at BIGINT NOT NULL, complete_at BIGINT NOT NULL, diff --git a/src/repositories/synchronization/models.rs b/src/repositories/synchronization/models.rs index 5399930..3e2c60a 100644 --- a/src/repositories/synchronization/models.rs +++ b/src/repositories/synchronization/models.rs @@ -11,7 +11,7 @@ pub static ITEM_GAMES: &str = "games"; #[table_name = "api_kgon_synchronizations"] pub struct Synchronization { /// - pub id: i64, + pub id: i32, /// pub item: String, /// diff --git a/src/repositories/synchronization/repository.rs b/src/repositories/synchronization/repository.rs index 9e6e552..717f96e 100644 --- a/src/repositories/synchronization/repository.rs +++ b/src/repositories/synchronization/repository.rs @@ -43,7 +43,7 @@ impl Repository { pub fn select( &self, conn: &diesel::PgConnection, - id: i64, + id: i32, ) -> Result, Error> { match api_kgon_synchronizations::table .find(id) @@ -81,7 +81,7 @@ impl Repository { pub fn update( &self, conn: &diesel::PgConnection, - id: i64, + id: i32, modify: &models::ModifySynchronization, ) -> Result { use api_kgon_synchronizations::dsl; @@ -93,7 +93,7 @@ impl Repository { } /// - pub fn delete(&self, conn: &diesel::PgConnection, id: i64) -> Result { + pub fn delete(&self, conn: &diesel::PgConnection, id: i32) -> Result { use api_kgon_synchronizations::dsl; diesel::delete(api_kgon_synchronizations::table.filter(dsl::id.eq(id))) diff --git a/src/repositories/synchronization/schema.rs b/src/repositories/synchronization/schema.rs index e881f55..21d9a56 100644 --- a/src/repositories/synchronization/schema.rs +++ b/src/repositories/synchronization/schema.rs @@ -5,7 +5,7 @@ table! { /// api_kgon_synchronizations(id) { /// - id -> BigInt, + id -> Integer, /// item -> Text, ///