use iden enum

This commit is contained in:
Namekuji 2023-06-01 04:24:45 -04:00
parent d28f74b513
commit 3010ac9e74
No known key found for this signature in database
GPG key ID: B541BD6E646CABC7

View file

@ -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()