-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Yuchen Liang <[email protected]>
- Loading branch information
Showing
12 changed files
with
146 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
optd/migrations/2025-01-19-054757_create_rel_group_winners/down.sql
This file was deleted.
Oops, something went wrong.
18 changes: 0 additions & 18 deletions
18
optd/migrations/2025-01-19-054757_create_rel_group_winners/up.sql
This file was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
optd/migrations/2025-01-19-054757_create_rel_subgroup_winners/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
DROP TABLE rel_subgroup_winners; |
9 changes: 9 additions & 0 deletions
9
optd/migrations/2025-01-19-054757_create_rel_subgroup_winners/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
-- The winners table records the winner of a group with some required physical property. | ||
CREATE TABLE rel_subgroup_winners ( | ||
-- The subgroup id of the winner, i.e. the winner of the group with `group_id` and some required physical property. | ||
subgroup_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, | ||
-- The physical expression id of the winner. | ||
physical_expr_id BIGINT NOT NULL, | ||
FOREIGN KEY (subgroup_id) REFERENCES rel_subgroup(id) ON DELETE CASCADE ON UPDATE CASCADE, | ||
FOREIGN KEY (physical_expr_id) REFERENCES physical_exprs(id) ON DELETE CASCADE ON UPDATE CASCADE | ||
); |
1 change: 1 addition & 0 deletions
1
optd/migrations/2025-01-20-150957_create_rel_subgroups/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
DROP TABLE rel_subgroups; |
10 changes: 10 additions & 0 deletions
10
optd/migrations/2025-01-20-150957_create_rel_subgroups/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
-- The relational subgroups table specifies the subgroups of a group with some required physical property. | ||
CREATE TABLE rel_subgroups ( | ||
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, | ||
-- The group the subgroup belongs to. | ||
group_id BIGINT NOT NULL, | ||
-- The required physical property of the subgroup. | ||
required_phys_prop_id BIGINT NOT NULL, | ||
FOREIGN KEY (group_id) REFERENCES rel_groups(id) ON DELETE CASCADE ON UPDATE CASCADE, | ||
FOREIGN KEY (required_phys_prop_id) REFERENCES physical_props(id) ON DELETE CASCADE ON UPDATE CASCADE | ||
); |
1 change: 1 addition & 0 deletions
1
optd/migrations/2025-01-20-153830_create_rel_subgroup_physical_exprs/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
DROP TABLE rel_subgroup_physical_exprs; |
12 changes: 12 additions & 0 deletions
12
optd/migrations/2025-01-20-153830_create_rel_subgroup_physical_exprs/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
-- The relational subgroup expressions table specifies the physical expressions of a subgroup. | ||
-- It is a m:n junction table since a subgroup can have multiple physical expressions, | ||
-- and a physical expression can belong to multiple subgroups. | ||
CREATE TABLE rel_subgroup_physical_exprs ( | ||
-- The subgroup the physical expression belongs to. | ||
subgroup_id BIGINT NOT NULL, | ||
-- The physical expression id. | ||
physical_expr_id BIGINT NOT NULL, | ||
PRIMARY KEY (subgroup_id, physical_expr_id), | ||
FOREIGN KEY (subgroup_id) REFERENCES rel_subgroups(id) ON DELETE CASCADE ON UPDATE CASCADE, | ||
FOREIGN KEY (physical_expr_id) REFERENCES physical_exprs(id) ON DELETE CASCADE ON UPDATE CASCADE | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters