summaryrefslogtreecommitdiff
path: root/src/application/mystic/forum/attributes/References.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/application/mystic/forum/attributes/References.php')
-rw-r--r--src/application/mystic/forum/attributes/References.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/application/mystic/forum/attributes/References.php b/src/application/mystic/forum/attributes/References.php
index ac431ff..9e33927 100644
--- a/src/application/mystic/forum/attributes/References.php
+++ b/src/application/mystic/forum/attributes/References.php
@@ -7,9 +7,12 @@ class References {
public function __construct(
public readonly string $foreignTableName,
public readonly ?string $foreignColumnName = null,
+ public readonly bool $cascadeOnDelete = false,
) {}
public function __toString(): string {
- return $this->foreignTableName . ($this->foreignColumnName !== null ? " ({$this->foreignColumnName})" : "");
+ return $this->foreignTableName
+ . ($this->foreignColumnName !== null ? " ({$this->foreignColumnName})" : "")
+ . ($this->cascadeOnDelete ? " ON DELETE CASCADE" : "");
}
}