mirror of
https://example.com
synced 2024-11-23 12:06:39 +09:00
use iden enum
This commit is contained in:
parent
d28f74b513
commit
3010ac9e74
1 changed files with 16 additions and 2 deletions
|
@ -16,13 +16,19 @@ pub struct Migration;
|
|||
impl MigrationTrait for Migration {
|
||||
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> {
|
||||
manager
|
||||
.drop_table(Table::drop().table(Alias::new("reversi_game")).to_owned())
|
||||
.drop_table(
|
||||
Table::drop()
|
||||
.if_exists()
|
||||
.table(ReversiGame::Table)
|
||||
.to_owned(),
|
||||
)
|
||||
.await?;
|
||||
|
||||
manager
|
||||
.drop_table(
|
||||
Table::drop()
|
||||
.table(Alias::new("reversi_matching"))
|
||||
.if_exists()
|
||||
.table(ReversiMatching::Table)
|
||||
.to_owned(),
|
||||
)
|
||||
.await?;
|
||||
|
@ -379,6 +385,14 @@ enum Webhook {
|
|||
Id,
|
||||
On,
|
||||
}
|
||||
#[derive(Iden)]
|
||||
enum ReversiGame {
|
||||
Table,
|
||||
}
|
||||
#[derive(Iden)]
|
||||
enum ReversiMatching {
|
||||
Table,
|
||||
}
|
||||
|
||||
fn select_query<T: Iden + 'static>(table: T, id: T, col: T) -> String {
|
||||
Query::select()
|
||||
|
|
Loading…
Reference in a new issue