From: Olaf Wintermann Date: Fri, 22 May 2026 15:08:21 +0000 (+0200) Subject: add note table to migration X-Git-Url: https://uap-core.de/gitweb/?a=commitdiff_plain;h=0b4c1b747fe3e8365458cd8b5dda6303399bacb0;p=note.git add note table to migration --- diff --git a/entity/src/note.rs b/entity/src/note.rs index 8d5bfe1..53f4c5e 100644 --- a/entity/src/note.rs +++ b/entity/src/note.rs @@ -13,7 +13,7 @@ pub struct Model { pub content: String, pub lastmodified: DateTimeWithTimeZone, - pub created_at: DateTimeWithTimeZone, + pub created: DateTimeWithTimeZone, } #[derive(EnumIter, DeriveActiveEnum, Clone, Debug, PartialEq)] diff --git a/migration/src/m20260502_184134_create_settings.rs b/migration/src/m20260502_184134_create_settings.rs index 33e01c4..1d997c1 100644 --- a/migration/src/m20260502_184134_create_settings.rs +++ b/migration/src/m20260502_184134_create_settings.rs @@ -39,10 +39,27 @@ impl MigrationTrait for Migration { .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