pub content: String,
pub lastmodified: DateTimeWithTimeZone,
- pub created_at: DateTimeWithTimeZone,
+ pub created: DateTimeWithTimeZone,
}
#[derive(EnumIter, DeriveActiveEnum, Clone, Debug, PartialEq)]
.on_update(ForeignKeyAction::Cascade))
.to_owned(),
)
- .await
+ .await?;
+
+ manager
+ .create_table(
+ Table::create()
+ .table("note")
+ .if_not_exists()
+ .col(pk_auto("note_id"))
+ .col(integer("collection_id"))
+ .col(integer("kind"))
+ .col(string("title"))
+ .col(string_null("content"))
+ .col(timestamp_with_time_zone("lastmodified"))
+ .col(timestamp_with_time_zone("created"))
+ .to_owned()
+ ).await
}
async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> {
+ manager
+ .drop_table(Table::drop().table("note").to_owned()).await?;
manager
.drop_table(Table::drop().table("collection").to_owned()).await?;
manager