risingwave_meta_model_migration/
lib.rs

1#![allow(clippy::enum_variant_names)]
2
3pub use sea_orm_migration::MigrationStatus;
4pub use sea_orm_migration::prelude::*;
5mod m20230908_072257_init;
6mod m20231008_020431_hummock;
7mod m20240304_074901_subscription;
8mod m20240410_082733_with_version_column_migration;
9mod m20240410_154406_session_params;
10mod m20240417_062305_subscription_internal_table_name;
11mod m20240418_142249_function_runtime;
12mod m20240506_112555_subscription_partial_ckpt;
13mod m20240525_090457_secret;
14mod m20240617_070131_index_column_properties;
15mod m20240617_071625_sink_into_table_column;
16mod m20240618_072634_function_compressed_binary;
17mod m20240630_131430_remove_parallel_unit;
18mod m20240701_060504_hummock_time_travel;
19mod m20240702_080451_system_param_value;
20mod m20240702_084927_unnecessary_fk;
21mod m20240726_063833_auto_schema_change;
22mod m20240806_143329_add_rate_limit_to_source_catalog;
23mod m20240820_081248_add_time_travel_per_table_epoch;
24mod m20240911_083152_variable_vnode_count;
25mod m20241001_013810_webhook_source;
26mod m20241016_065621_hummock_gc_history;
27mod m20241022_072553_node_label;
28mod m20241025_062548_singleton_vnode_count;
29mod m20241115_085007_remove_function_type;
30mod m20241120_182555_hummock_add_time_travel_sst_index;
31mod m20241121_101830_table_engine;
32mod m20241125_043732_connection_params;
33mod m20241202_071413_resource_group;
34mod m20241226_074013_clean_watermark_index_in_pk;
35mod m20250106_072104_fragment_relation;
36mod m20250121_085800_change_wasm_udf_identifier;
37mod m20250210_170743_function_options;
38mod m20250319_062702_mysql_utf8mb4;
39mod m20250325_061743_exactly_once_iceberg_sink_metadata;
40mod utils;
41
42pub struct Migrator;
43
44#[macro_export]
45macro_rules! assert_not_has_tables {
46    ($manager:expr, $( $table:ident ),+) => {
47        $(
48            assert!(
49                !$manager
50                    .has_table($table::Table.to_string())
51                    .await?,
52                "Table `{}` already exists",
53                $table::Table.to_string()
54            );
55        )+
56    };
57}
58
59#[macro_export]
60macro_rules! drop_tables {
61    ($manager:expr, $( $table:ident ),+) => {
62        $(
63            $manager
64                .drop_table(
65                    sea_orm_migration::prelude::Table::drop()
66                        .table($table::Table)
67                        .if_exists()
68                        .cascade()
69                        .to_owned(),
70                )
71                .await?;
72        )+
73    };
74}
75
76#[async_trait::async_trait]
77impl MigratorTrait for Migrator {
78    fn migrations() -> Vec<Box<dyn MigrationTrait>> {
79        vec![
80            Box::new(m20230908_072257_init::Migration),
81            Box::new(m20231008_020431_hummock::Migration),
82            Box::new(m20240304_074901_subscription::Migration),
83            Box::new(m20240410_082733_with_version_column_migration::Migration),
84            Box::new(m20240410_154406_session_params::Migration),
85            Box::new(m20240417_062305_subscription_internal_table_name::Migration),
86            Box::new(m20240418_142249_function_runtime::Migration),
87            Box::new(m20240506_112555_subscription_partial_ckpt::Migration),
88            Box::new(m20240525_090457_secret::Migration),
89            Box::new(m20240617_070131_index_column_properties::Migration),
90            Box::new(m20240617_071625_sink_into_table_column::Migration),
91            Box::new(m20240618_072634_function_compressed_binary::Migration),
92            Box::new(m20240630_131430_remove_parallel_unit::Migration),
93            Box::new(m20240701_060504_hummock_time_travel::Migration),
94            Box::new(m20240702_080451_system_param_value::Migration),
95            Box::new(m20240702_084927_unnecessary_fk::Migration),
96            Box::new(m20240726_063833_auto_schema_change::Migration),
97            Box::new(m20240806_143329_add_rate_limit_to_source_catalog::Migration),
98            Box::new(m20240820_081248_add_time_travel_per_table_epoch::Migration),
99            Box::new(m20240911_083152_variable_vnode_count::Migration),
100            Box::new(m20241001_013810_webhook_source::Migration),
101            Box::new(m20241016_065621_hummock_gc_history::Migration),
102            Box::new(m20241022_072553_node_label::Migration),
103            Box::new(m20241025_062548_singleton_vnode_count::Migration),
104            Box::new(m20241115_085007_remove_function_type::Migration),
105            Box::new(m20241120_182555_hummock_add_time_travel_sst_index::Migration),
106            Box::new(m20241121_101830_table_engine::Migration),
107            Box::new(m20241125_043732_connection_params::Migration),
108            Box::new(m20241202_071413_resource_group::Migration),
109            Box::new(m20241226_074013_clean_watermark_index_in_pk::Migration),
110            Box::new(m20250106_072104_fragment_relation::Migration),
111            Box::new(m20250121_085800_change_wasm_udf_identifier::Migration),
112            Box::new(m20250210_170743_function_options::Migration),
113            Box::new(m20250319_062702_mysql_utf8mb4::Migration),
114            Box::new(m20250325_061743_exactly_once_iceberg_sink_metadata::Migration),
115        ]
116    }
117}