mirror of
https://github.com/warp-tech/warpgate.git
synced 2025-09-11 09:04:51 +08:00
fixed #1039 - first DB migration failing on Postgres
This commit is contained in:
parent
379b1bc5e9
commit
41d3158cbf
1 changed files with 10 additions and 8 deletions
|
@ -1,4 +1,4 @@
|
||||||
use sea_orm::Schema;
|
use sea_orm::{DbBackend, Schema};
|
||||||
use sea_orm_migration::prelude::*;
|
use sea_orm_migration::prelude::*;
|
||||||
|
|
||||||
pub mod ticket {
|
pub mod ticket {
|
||||||
|
@ -42,13 +42,15 @@ impl MigrationTrait for Migration {
|
||||||
.create_table(schema.create_table_from_entity(ticket::Entity))
|
.create_table(schema.create_table_from_entity(ticket::Entity))
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
// https://github.com/warp-tech/warpgate/issues/857
|
let connection = manager.get_connection();
|
||||||
let _ = manager
|
if connection.get_database_backend() == DbBackend::MySql {
|
||||||
.get_connection()
|
// https://github.com/warp-tech/warpgate/issues/857
|
||||||
.execute_unprepared(
|
connection
|
||||||
"ALTER TABLE `tickets` MODIFY COLUMN `expiry` TIMESTAMP NULL DEFAULT NULL",
|
.execute_unprepared(
|
||||||
)
|
"ALTER TABLE `tickets` MODIFY COLUMN `expiry` TIMESTAMP NULL DEFAULT NULL",
|
||||||
.await;
|
)
|
||||||
|
.await?;
|
||||||
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue