24 lines
713 B
Rust
24 lines
713 B
Rust
use sea_orm_migration::prelude::*;
|
|
|
|
#[derive(DeriveMigrationName)]
|
|
pub struct Migration;
|
|
|
|
#[async_trait::async_trait]
|
|
impl MigrationTrait for Migration {
|
|
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> {
|
|
let sql = include_str!("sql/m20260508_000003_create_ai_message_fork.sql");
|
|
super::execute_sql(manager, sql).await
|
|
}
|
|
|
|
async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> {
|
|
manager
|
|
.get_connection()
|
|
.execute_raw(sea_orm::Statement::from_string(
|
|
sea_orm::DbBackend::Postgres,
|
|
"DROP TABLE IF EXISTS ai_message_fork;".to_string(),
|
|
))
|
|
.await?;
|
|
Ok(())
|
|
}
|
|
}
|