From a292d7d200b38e3f12fb0fe1a7f8bf7a9169e875 Mon Sep 17 00:00:00 2001 From: Fabrice Gangler <fabrice.gangler@adullact.org> Date: Mon, 15 Jul 2024 10:49:41 +0200 Subject: [PATCH] chore: clean up migrations --- webapp/migrations/Version20240605095758.php | 6 +--- webapp/migrations/Version20240605100229.php | 34 --------------------- 2 files changed, 1 insertion(+), 39 deletions(-) delete mode 100644 webapp/migrations/Version20240605100229.php diff --git a/webapp/migrations/Version20240605095758.php b/webapp/migrations/Version20240605095758.php index 006f67d..c3588e4 100644 --- a/webapp/migrations/Version20240605095758.php +++ b/webapp/migrations/Version20240605095758.php @@ -14,14 +14,12 @@ final class Version20240605095758 extends AbstractMigration { public function getDescription(): string { - return ''; + return 'add [ messenger_messages ] table and add [ notify_trigger ] trigger on [ messenger_messages ] table'; } public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs - $this->addSql('CREATE SEQUENCE todo_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); - $this->addSql('CREATE TABLE todo (id INT NOT NULL, title VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); $this->addSql('CREATE TABLE messenger_messages (id BIGSERIAL NOT NULL, body TEXT NOT NULL, headers TEXT NOT NULL, queue_name VARCHAR(190) NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, available_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, delivered_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))'); $this->addSql('CREATE INDEX IDX_75EA56E0FB7336F0 ON messenger_messages (queue_name)'); $this->addSql('CREATE INDEX IDX_75EA56E0E3BD61CE ON messenger_messages (available_at)'); @@ -43,8 +41,6 @@ public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs $this->addSql('CREATE SCHEMA public'); - $this->addSql('DROP SEQUENCE todo_id_seq CASCADE'); - $this->addSql('DROP TABLE todo'); $this->addSql('DROP TABLE messenger_messages'); } } diff --git a/webapp/migrations/Version20240605100229.php b/webapp/migrations/Version20240605100229.php deleted file mode 100644 index 9b0d747..0000000 --- a/webapp/migrations/Version20240605100229.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace DoctrineMigrations; - -use Doctrine\DBAL\Schema\Schema; -use Doctrine\Migrations\AbstractMigration; - -/** - * Auto-generated Migration: Please modify to your needs! - */ -final class Version20240605100229 extends AbstractMigration -{ - public function getDescription(): string - { - return ''; - } - - public function up(Schema $schema): void - { - // this up() migration is auto-generated, please modify it to your needs - $this->addSql('DROP SEQUENCE todo_id_seq CASCADE'); - $this->addSql('DROP TABLE todo'); - } - - public function down(Schema $schema): void - { - // this down() migration is auto-generated, please modify it to your needs - $this->addSql('CREATE SCHEMA public'); - $this->addSql('CREATE SEQUENCE todo_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); - $this->addSql('CREATE TABLE todo (id INT NOT NULL, title VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); - } -} -- GitLab