Fix graphql example

This commit is contained in:
Billy Chan 2024-04-08 19:00:38 +08:00
parent 8c7395441b
commit 145bfa02a9
No known key found for this signature in database
GPG Key ID: 45461E52F22E0279

View File

@ -9,11 +9,11 @@ impl MigrationTrait for Migration {
manager
.create_table(
Table::create()
.table(Posts::Table)
.table(Notes::Table)
.if_not_exists()
.col(pk_auto(Posts::Id))
.col(string(Posts::Title))
.col(string(Posts::Text))
.col(pk_auto(Notes::Id))
.col(string(Notes::Title))
.col(string(Notes::Text))
.to_owned(),
)
.await
@ -21,13 +21,13 @@ impl MigrationTrait for Migration {
async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> {
manager
.drop_table(Table::drop().table(Posts::Table).to_owned())
.drop_table(Table::drop().table(Notes::Table).to_owned())
.await
}
}
#[derive(DeriveIden)]
enum Posts {
enum Notes {
Table,
Id,
Title,