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