From e2adb5271e6e811ca6171500d7a41239b77e5b6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20=C3=81lvarez?= Date: Tue, 24 May 2022 10:17:29 +0200 Subject: [PATCH] prop names --- migrations/Version20220524080445.php | 65 ++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 migrations/Version20220524080445.php diff --git a/migrations/Version20220524080445.php b/migrations/Version20220524080445.php new file mode 100644 index 0000000..d975ed2 --- /dev/null +++ b/migrations/Version20220524080445.php @@ -0,0 +1,65 @@ +addSql('DROP INDEX IDX_CA4C3EB8ED5CA9E6'); + $this->addSql('CREATE TEMPORARY TABLE __temp__mer_be_sub AS SELECT id, service_id, code, status, sub_date, unsub_date FROM mer_be_sub'); + $this->addSql('DROP TABLE mer_be_sub'); + $this->addSql('CREATE TABLE mer_be_sub (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, service_id INTEGER NOT NULL, code VARCHAR(255) DEFAULT NULL, status INTEGER NOT NULL, sub_date DATETIME NOT NULL --(DC2Type:datetime_immutable) + , unsub_date DATETIME DEFAULT NULL --(DC2Type:datetime_immutable) + , CONSTRAINT FK_CA4C3EB8ED5CA9E6 FOREIGN KEY (service_id) REFERENCES mer_service (id) NOT DEFERRABLE INITIALLY IMMEDIATE)'); + $this->addSql('INSERT INTO mer_be_sub (id, service_id, code, status, sub_date, unsub_date) SELECT id, service_id, code, status, sub_date, unsub_date FROM __temp__mer_be_sub'); + $this->addSql('DROP TABLE __temp__mer_be_sub'); + $this->addSql('CREATE INDEX IDX_CA4C3EB8ED5CA9E6 ON mer_be_sub (service_id)'); + $this->addSql('DROP INDEX IDX_E4F82A3DED5CA9E6'); + $this->addSql('CREATE TEMPORARY TABLE __temp__mer_para_sub AS SELECT id, service_id, sub_date, unsub_date, pin, status FROM mer_para_sub'); + $this->addSql('DROP TABLE mer_para_sub'); + $this->addSql('CREATE TABLE mer_para_sub (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, service_id INTEGER NOT NULL, sub_date DATETIME NOT NULL --(DC2Type:datetime_immutable) + , unsub_date DATETIME DEFAULT NULL --(DC2Type:datetime_immutable) + , pin INTEGER DEFAULT NULL, status INTEGER NOT NULL, CONSTRAINT FK_E4F82A3DED5CA9E6 FOREIGN KEY (service_id) REFERENCES mer_service (id) NOT DEFERRABLE INITIALLY IMMEDIATE)'); + $this->addSql('INSERT INTO mer_para_sub (id, service_id, sub_date, unsub_date, pin, status) SELECT id, service_id, sub_date, unsub_date, pin, status FROM __temp__mer_para_sub'); + $this->addSql('DROP TABLE __temp__mer_para_sub'); + $this->addSql('CREATE INDEX IDX_E4F82A3DED5CA9E6 ON mer_para_sub (service_id)'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('DROP INDEX IDX_CA4C3EB8ED5CA9E6'); + $this->addSql('CREATE TEMPORARY TABLE __temp__mer_be_sub AS SELECT id, service_id, code, status, sub_date, unsub_date FROM mer_be_sub'); + $this->addSql('DROP TABLE mer_be_sub'); + $this->addSql('CREATE TABLE mer_be_sub (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, service_id INTEGER NOT NULL, code VARCHAR(255) DEFAULT NULL, status INTEGER NOT NULL, sub_date DATETIME NOT NULL --(DC2Type:datetime_immutable) + , unsub_date DATETIME DEFAULT NULL --(DC2Type:datetime_immutable) + )'); + $this->addSql('INSERT INTO mer_be_sub (id, service_id, code, status, sub_date, unsub_date) SELECT id, service_id, code, status, sub_date, unsub_date FROM __temp__mer_be_sub'); + $this->addSql('DROP TABLE __temp__mer_be_sub'); + $this->addSql('CREATE INDEX IDX_CA4C3EB8ED5CA9E6 ON mer_be_sub (service_id)'); + $this->addSql('DROP INDEX IDX_E4F82A3DED5CA9E6'); + $this->addSql('CREATE TEMPORARY TABLE __temp__mer_para_sub AS SELECT id, service_id, pin, status, sub_date, unsub_date FROM mer_para_sub'); + $this->addSql('DROP TABLE mer_para_sub'); + $this->addSql('CREATE TABLE mer_para_sub (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, service_id INTEGER NOT NULL, pin INTEGER DEFAULT NULL, status INTEGER NOT NULL, sub_date DATETIME NOT NULL --(DC2Type:datetime_immutable) + , unsub_date DATETIME DEFAULT NULL --(DC2Type:datetime_immutable) + )'); + $this->addSql('INSERT INTO mer_para_sub (id, service_id, pin, status, sub_date, unsub_date) SELECT id, service_id, pin, status, sub_date, unsub_date FROM __temp__mer_para_sub'); + $this->addSql('DROP TABLE __temp__mer_para_sub'); + $this->addSql('CREATE INDEX IDX_E4F82A3DED5CA9E6 ON mer_para_sub (service_id)'); + } +}