init commit
This commit is contained in:
35
migration/src/m20241029_235230_skills.rs
Normal file
35
migration/src/m20241029_235230_skills.rs
Normal file
@@ -0,0 +1,35 @@
|
||||
use loco_rs::schema::table_auto_tz;
|
||||
use sea_orm_migration::{prelude::*, schema::*};
|
||||
|
||||
#[derive(DeriveMigrationName)]
|
||||
pub struct Migration;
|
||||
|
||||
#[async_trait::async_trait]
|
||||
impl MigrationTrait for Migration {
|
||||
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> {
|
||||
manager
|
||||
.create_table(
|
||||
table_auto_tz(Skills::Table)
|
||||
.col(pk_auto(Skills::Id))
|
||||
.col(string(Skills::Name))
|
||||
.to_owned(),
|
||||
)
|
||||
.await
|
||||
}
|
||||
|
||||
async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> {
|
||||
manager
|
||||
.drop_table(Table::drop().table(Skills::Table).to_owned())
|
||||
.await
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(DeriveIden)]
|
||||
enum Skills {
|
||||
Table,
|
||||
Id,
|
||||
Name,
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user