Simplify entity relationship and enforce foreign key constraints

Removed the resetStoredObject() method call from StoredObject, adjusted the storedObjectId column in the stored_object_version table to be NOT NULL, and moved the association setup of the StoredObject entity directly into the constructor in StoredObjectVersion. This ensures that every StoredObjectVersion has a valid StoredObject and maintains database integrity.
This commit is contained in:
2024-09-04 14:28:13 +02:00
parent 667e144681
commit 615629d1b4
3 changed files with 7 additions and 19 deletions

View File

@@ -28,7 +28,7 @@ final class Version20240709102730 extends AbstractMigration
<<<'SQL'
CREATE TABLE chill_doc.stored_object_version (
id INT NOT NULL,
stored_object_id INT DEFAULT NULL,
stored_object_id INT NOT NULL,
version INT DEFAULT 0 NOT NULL,
filename TEXT NOT NULL,
iv JSON NOT NULL,