Using JSONB for storage in db for attendees in Notifications

This commit is contained in:
Marc Ducobu 2021-06-15 14:48:33 +02:00
parent cf8b9ec172
commit 86d764c097

View File

@ -20,7 +20,7 @@ final class Version20210610140248 extends AbstractMigration
public function up(Schema $schema): void
{
$this->addSql('CREATE SEQUENCE chill_main_notification_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE TABLE chill_main_notification (id INT NOT NULL, sender_id INT NOT NULL, message TEXT NOT NULL, date TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, relatedEntityClass VARCHAR(255) NOT NULL, relatedEntityId INT NOT NULL, read JSON NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE TABLE chill_main_notification (id INT NOT NULL, sender_id INT NOT NULL, message TEXT NOT NULL, date TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, relatedEntityClass VARCHAR(255) NOT NULL, relatedEntityId INT NOT NULL, read JSONB NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_5BDC8067F624B39D ON chill_main_notification (sender_id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_5BDC8067567988B4440F6072 ON chill_main_notification (relatedEntityClass, relatedEntityId)');
$this->addSql('COMMENT ON COLUMN chill_main_notification.date IS \'(DC2Type:datetime_immutable)\'');