From 4add557bd23b3e69f0fa88ef3b8625653fdd0603 Mon Sep 17 00:00:00 2001 From: fan-tastic-z Date: Mon, 11 Dec 2023 18:51:18 +0800 Subject: [PATCH] fix: update sea-orm migration User to Users --- .../migration/src/m20220101_000001_create_table.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/template/migration/src/m20220101_000001_create_table.rs b/src/template/migration/src/m20220101_000001_create_table.rs index 34501e3..bb2deb1 100644 --- a/src/template/migration/src/m20220101_000001_create_table.rs +++ b/src/template/migration/src/m20220101_000001_create_table.rs @@ -9,21 +9,21 @@ impl MigrationTrait for Migration { manager .create_table( Table::create() - .table(User::Table) + .table(Users::Table) .if_not_exists() .col( - ColumnDef::new(User::Id) + ColumnDef::new(Users::Id) .string() .not_null() .primary_key(), ) .col( - ColumnDef::new(User::Username) + ColumnDef::new(Users::Username) .string() .not_null() .unique_key(), ) - .col(ColumnDef::new(User::Password).string().not_null()) + .col(ColumnDef::new(Users::Password).string().not_null()) .to_owned(), ) .await @@ -31,13 +31,13 @@ impl MigrationTrait for Migration { async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> { manager - .drop_table(Table::drop().table(User::Table).to_owned()) + .drop_table(Table::drop().table(Users::Table).to_owned()) .await } } #[derive(Iden)] -enum User { +enum Users { Table, Id, Username,