Fix graphql example
This commit is contained in:
parent
8c7395441b
commit
145bfa02a9
@ -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,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user