risingwave_meta_model_migration/
m20250319_062702_mysql_utf8mb4.rs1use sea_orm::DbBackend;
2use sea_orm_migration::prelude::*;
3
4#[derive(DeriveMigrationName)]
5pub struct Migration;
6
7#[async_trait::async_trait]
8impl MigrationTrait for Migration {
9 async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> {
10 if manager.get_database_backend() == DbBackend::MySql {
12 manager
13 .get_connection()
14 .execute_unprepared("ALTER DATABASE CHARACTER SET utf8mb4 COLLATE utf8mb4_bin")
15 .await
16 .expect("failed to set database collate");
17 }
18 Ok(())
19 }
20
21 async fn down(&self, _manager: &SchemaManager) -> Result<(), DbErr> {
22 Ok(())
24 }
25}