We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d01a97a commit 5169f25Copy full SHA for 5169f25
optd-persistent/src/migrator/memo/m20241029_000001_cascades_group.rs
@@ -75,6 +75,7 @@ pub enum CascadesGroup {
75
LatestWinner,
76
InProgress,
77
IsOptimized,
78
+ ParentId,
79
}
80
81
#[derive(DeriveMigrationName)]
@@ -99,6 +100,14 @@ impl MigrationTrait for Migration {
99
100
)
101
.col(boolean(CascadesGroup::InProgress))
102
.col(boolean(CascadesGroup::IsOptimized))
103
+ .col(integer_null(CascadesGroup::ParentId))
104
+ .foreign_key(
105
+ ForeignKey::create()
106
+ .from(CascadesGroup::Table, CascadesGroup::ParentId)
107
+ .to(CascadesGroup::Table, CascadesGroup::Id)
108
+ .on_delete(ForeignKeyAction::SetNull)
109
+ .on_update(ForeignKeyAction::Cascade),
110
+ )
111
.to_owned(),
112
113
.await
0 commit comments