30 lines
728 B
Rust
30 lines
728 B
Rust
use loco_rs::schema::*;
|
|
use sea_orm_migration::prelude::*;
|
|
|
|
#[derive(DeriveMigrationName)]
|
|
pub struct Migration;
|
|
|
|
#[async_trait::async_trait]
|
|
impl MigrationTrait for Migration {
|
|
async fn up(&self, m: &SchemaManager) -> Result<(), DbErr> {
|
|
create_table(m, "abouts",
|
|
&[
|
|
|
|
("id", ColType::PkAuto),
|
|
|
|
("title", ColType::StringNull),
|
|
("body", ColType::TextNull),
|
|
("address", ColType::TextNull),
|
|
("phone", ColType::StringNull),
|
|
("email", ColType::StringNull),
|
|
],
|
|
&[
|
|
]
|
|
).await
|
|
}
|
|
|
|
async fn down(&self, m: &SchemaManager) -> Result<(), DbErr> {
|
|
drop_table(m, "abouts").await
|
|
}
|
|
}
|