From d1ac0578f3390cd3c5e82247b71e7e7143ff4ee4 Mon Sep 17 00:00:00 2001 From: Ryan Prather Date: Sun, 26 May 2024 22:30:39 -0400 Subject: [PATCH] Add recording link field to note --- migrations/Version20240527010736.php | 43 ++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 migrations/Version20240527010736.php diff --git a/migrations/Version20240527010736.php b/migrations/Version20240527010736.php new file mode 100644 index 0000000..e75befe --- /dev/null +++ b/migrations/Version20240527010736.php @@ -0,0 +1,43 @@ +addSql('ALTER TABLE note ADD COLUMN recording VARCHAR(255) DEFAULT NULL'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('CREATE TEMPORARY TABLE __temp__note AS SELECT id, speaker_id, series_id, user_id, title, date, passage, refs, text FROM note'); + $this->addSql('DROP TABLE note'); + $this->addSql('CREATE TABLE note (id BLOB NOT NULL --(DC2Type:uuid) + , speaker_id BLOB DEFAULT NULL --(DC2Type:uuid) + , series_id BLOB DEFAULT NULL --(DC2Type:uuid) + , user_id BLOB DEFAULT NULL --(DC2Type:uuid) + , title VARCHAR(255) NOT NULL, date DATE NOT NULL, passage VARCHAR(255) NOT NULL, refs CLOB DEFAULT NULL --(DC2Type:json) + , text CLOB DEFAULT NULL, PRIMARY KEY(id), CONSTRAINT FK_CFBDFA14D04A0F27 FOREIGN KEY (speaker_id) REFERENCES speaker (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_CFBDFA145278319C FOREIGN KEY (series_id) REFERENCES series (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_CFBDFA14A76ED395 FOREIGN KEY (user_id) REFERENCES user (id) NOT DEFERRABLE INITIALLY IMMEDIATE)'); + $this->addSql('INSERT INTO note (id, speaker_id, series_id, user_id, title, date, passage, refs, text) SELECT id, speaker_id, series_id, user_id, title, date, passage, refs, text FROM __temp__note'); + $this->addSql('DROP TABLE __temp__note'); + $this->addSql('CREATE INDEX IDX_CFBDFA14D04A0F27 ON note (speaker_id)'); + $this->addSql('CREATE INDEX IDX_CFBDFA145278319C ON note (series_id)'); + $this->addSql('CREATE INDEX IDX_CFBDFA14A76ED395 ON note (user_id)'); + } +}