From 3b86a4662537b8af687daa7e7926dc67b30d8b82 Mon Sep 17 00:00:00 2001 From: Hugo Sales Date: Sat, 5 Sep 2020 02:34:35 +0000 Subject: [PATCH] [DB] Rename notice to activity in notification table --- src/Entity/Notification.php | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/Entity/Notification.php b/src/Entity/Notification.php index 00c260d64e..1c49a9ab85 100644 --- a/src/Entity/Notification.php +++ b/src/Entity/Notification.php @@ -40,21 +40,21 @@ class Notification extends Entity { // {{{ Autocode - private int $notice_id; + private int $activity_id; private int $gsactor_id; private ?string $reason; private DateTimeInterface $created; private DateTimeInterface $modified; - public function setNoticeId(int $notice_id): self + public function setActivityId(int $activity_id): self { - $this->notice_id = $notice_id; + $this->activity_id = $activity_id; return $this; } - public function getNoticeId(): int + public function getActivityId(): int { - return $this->notice_id; + return $this->activity_id; } public function setGsactorId(int $gsactor_id): self @@ -107,22 +107,22 @@ class Notification extends Entity { return [ 'name' => 'notification', - 'description' => 'Note notification for gsactors (that are not a mention and not result of a subscription)', + 'description' => 'Activity notification for gsactors (that are not a mention and not result of a subscription)', 'fields' => [ - 'notice_id' => ['type' => 'int', 'not null' => true, 'description' => 'notice_id to give attention'], - 'gsactor_id' => ['type' => 'int', 'not null' => true, 'description' => 'gsactor_id for feed receiver'], - 'reason' => ['type' => 'varchar', 'length' => 191, 'description' => 'Optional reason why this was brought to the attention of gsactor_id'], - 'created' => ['type' => 'datetime', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was created'], - 'modified' => ['type' => 'timestamp', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was modified'], + 'activity_id' => ['type' => 'int', 'not null' => true, 'description' => 'activity_id to give attention'], + 'gsactor_id' => ['type' => 'int', 'not null' => true, 'description' => 'gsactor_id for feed receiver'], + 'reason' => ['type' => 'varchar', 'length' => 191, 'description' => 'Optional reason why this was brought to the attention of gsactor_id'], + 'created' => ['type' => 'datetime', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was created'], + 'modified' => ['type' => 'timestamp', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was modified'], ], - 'primary key' => ['notice_id', 'gsactor_id'], + 'primary key' => ['activity_id', 'gsactor_id'], 'foreign keys' => [ - 'attention_notice_id_fkey' => ['notice', ['notice_id' => 'id']], - 'attention_gsactor_id_fkey' => ['gsactor', ['gsactor_id' => 'id']], + 'attention_activity_id_fkey' => ['activity', ['activity_id' => 'id']], + 'attention_gsactor_id_fkey' => ['gsactor', ['gsactor_id' => 'id']], ], 'indexes' => [ - 'attention_notice_id_idx' => ['notice_id'], - 'attention_gsactor_id_idx' => ['gsactor_id'], + 'attention_activity_id_idx' => ['activity_id'], + 'attention_gsactor_id_idx' => ['gsactor_id'], ], ]; }