From 0b4c1b747fe3e8365458cd8b5dda6303399bacb0 Mon Sep 17 00:00:00 2001 From: Olaf Wintermann Date: Fri, 22 May 2026 17:08:21 +0200 Subject: [PATCH] add note table to migration --- entity/src/note.rs | 2 +- .../src/m20260502_184134_create_settings.rs | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) 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 -- 2.47.3