The PL/pgSQL trigger function caused SQL parsing issues with split_sql_statements. Keep only the table, column, and index.
27 lines
855 B
Rust
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
|
|
}
|
|
}
|