summaryrefslogtreecommitdiffstats
path: root/support/schema
diff options
context:
space:
mode:
Diffstat (limited to 'support/schema')
-rw-r--r--support/schema/aur-schema.sql5
1 files changed, 3 insertions, 2 deletions
diff --git a/support/schema/aur-schema.sql b/support/schema/aur-schema.sql
index 44501b6..8226b18 100644
--- a/support/schema/aur-schema.sql
+++ b/support/schema/aur-schema.sql
@@ -114,8 +114,9 @@ CREATE TABLE Packages (
INDEX (SubmitterUID),
INDEX (MaintainerUID),
FOREIGN KEY (CategoryID) REFERENCES PackageCategories(ID) ON DELETE NO ACTION,
- FOREIGN KEY (SubmitterUID) REFERENCES Users(ID) ON DELETE NO ACTION,
- FOREIGN KEY (MaintainerUID) REFERENCES Users(ID) ON DELETE NO ACTION
+ -- deleting a user will cause packages to be orphaned, not deleted
+ FOREIGN KEY (SubmitterUID) REFERENCES Users(ID) ON DELETE SET NULL,
+ FOREIGN KEY (MaintainerUID) REFERENCES Users(ID) ON DELETE SET NULL
) ENGINE = InnoDB;