Commit 6843f91
authored
fix: Add ON DELETE CASCADE to WebFeatures foreign keys (#1691)
* fix: Add ON DELETE CASCADE to WebFeatures foreign keys
Fixes #513
Previously, deleting a record from the WebFeatures table would fail if it was referenced by other tables.
This change updates all foreign key constraints that reference WebFeatures(ID) to include ON DELETE CASCADE. This ensures that when a feature is deleted, all its associated data in other tables is automatically removed.
The constraints have also been given explicit names to improve schema manageability. An integration test has been added to verify the cascade behavior across all related tables and prevent regressions.
* add missing name1 parent ede9c06 commit 6843f91
File tree
6 files changed
+455
-5
lines changed- infra/storage/spanner/migrations
- lib/gcpspanner
6 files changed
+455
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | | - | |
| 104 | + | |
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
| 118 | + | |
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
0 commit comments