gitdataai/libs/migrate/m20250628_000080_add_message_reactions_and_search.rs
ZhenYi b3b74a2396 fix: remove trigger function from message search migration
The PL/pgSQL trigger function caused SQL parsing issues with
split_sql_statements. Keep only the table, column, and index.
2026-04-15 11:39:39 +08:00

27 lines
855 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/m20250628_000080_add_message_reactions_and_search.sql");
super::execute_sql(manager, sql).await
}
async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> {
manager
.drop_table(
Table::drop()
.table(Alias::new("room_message_reaction"))
.to_owned(),
)
.await?;
let sql = "DROP INDEX IF EXISTS idx_room_message_content_tsv;
ALTER TABLE room_message DROP COLUMN IF EXISTS content_tsv;";
super::execute_sql(manager, sql).await
}
}