32 lines
1.1 KiB
Rust
32 lines
1.1 KiB
Rust
//! SeaORM migration: add access_visibility, can_ask, project_uid, model_uid, model_name to ai_conversation
|
|
|
|
use sea_orm_migration::prelude::*;
|
|
|
|
pub struct Migration;
|
|
|
|
impl MigrationName for Migration {
|
|
fn name(&self) -> &str {
|
|
"m20260508_000006_extend_ai_conversation"
|
|
}
|
|
}
|
|
|
|
#[async_trait::async_trait]
|
|
impl MigrationTrait for Migration {
|
|
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> {
|
|
let sql = include_str!("sql/m20260508_000006_extend_ai_conversation.sql");
|
|
super::execute_sql(manager, sql).await
|
|
}
|
|
|
|
async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> {
|
|
super::execute_sql(
|
|
manager,
|
|
"ALTER TABLE ai_conversation DROP COLUMN IF EXISTS access_visibility;
|
|
ALTER TABLE ai_conversation DROP COLUMN IF EXISTS can_ask;
|
|
ALTER TABLE ai_conversation DROP COLUMN IF EXISTS project_uid;
|
|
ALTER TABLE ai_conversation DROP COLUMN IF EXISTS model_uid;
|
|
ALTER TABLE ai_conversation DROP COLUMN IF EXISTS model_name;",
|
|
)
|
|
.await
|
|
}
|
|
}
|