File tree Expand file tree Collapse file tree 2 files changed +79
-0
lines changed
Expand file tree Collapse file tree 2 files changed +79
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ mod m20180905_090102_populate_activities;
99mod m20180921_110336_add_admins;
1010mod m20180922_104727_add_superadmins;
1111mod m20250828_224244_add_destiny_rising_uids;
12+ mod m20250910_152923_rename_tables;
1213mod tables;
1314
1415pub use tables:: * ;
@@ -31,6 +32,7 @@ impl MigratorTrait for Migrator {
3132 Box :: new( m20180921_110336_add_admins:: Migration ) ,
3233 Box :: new( m20180922_104727_add_superadmins:: Migration ) ,
3334 Box :: new( m20250828_224244_add_destiny_rising_uids:: Migration ) ,
35+ Box :: new( m20250910_152923_rename_tables:: Migration ) ,
3436 ]
3537 }
3638}
Original file line number Diff line number Diff line change 1+ use sea_orm_migration:: prelude:: * ;
2+
3+ #[ derive( DeriveMigrationName ) ]
4+ pub struct Migration ;
5+
6+ #[ async_trait:: async_trait]
7+ impl MigrationTrait for Migration {
8+ async fn up ( & self , manager : & SchemaManager ) -> Result < ( ) , DbErr > {
9+ manager
10+ . rename_table (
11+ Table :: rename ( )
12+ . table (
13+ Alias :: new ( "activityshortcuts" ) ,
14+ Alias :: new ( "activity_shortcuts" ) ,
15+ )
16+ . to_owned ( ) ,
17+ )
18+ . await ?;
19+
20+ manager
21+ . rename_table (
22+ Table :: rename ( )
23+ . table (
24+ Alias :: new ( "plannedactivities" ) ,
25+ Alias :: new ( "planned_activities" ) ,
26+ )
27+ . to_owned ( ) ,
28+ )
29+ . await ?;
30+
31+ manager
32+ . rename_table (
33+ Table :: rename ( )
34+ . table (
35+ Alias :: new ( "plannedactivitymembers" ) ,
36+ Alias :: new ( "planned_activity_members" ) ,
37+ )
38+ . to_owned ( ) ,
39+ )
40+ . await
41+ }
42+
43+ async fn down ( & self , manager : & SchemaManager ) -> Result < ( ) , DbErr > {
44+ manager
45+ . rename_table (
46+ Table :: rename ( )
47+ . table (
48+ Alias :: new ( "activity_shortcuts" ) ,
49+ Alias :: new ( "activityshortcuts" ) ,
50+ )
51+ . to_owned ( ) ,
52+ )
53+ . await ?;
54+
55+ manager
56+ . rename_table (
57+ Table :: rename ( )
58+ . table (
59+ Alias :: new ( "planned_activities" ) ,
60+ Alias :: new ( "plannedactivities" ) ,
61+ )
62+ . to_owned ( ) ,
63+ )
64+ . await ?;
65+
66+ manager
67+ . rename_table (
68+ Table :: rename ( )
69+ . table (
70+ Alias :: new ( "planned_activity_members" ) ,
71+ Alias :: new ( "plannedactivitymembers" ) ,
72+ )
73+ . to_owned ( ) ,
74+ )
75+ . await
76+ }
77+ }
You can’t perform that action at this time.
0 commit comments