From 07a448596d75114e96a7742f512013f8f3ff87b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nu=C5=A1a=20Puk=C5=A1i=C4=8D?= Date: Mon, 19 May 2025 17:56:19 +0200 Subject: [PATCH] Delete migrations --- migrations/Version20241201111823.php | 31 -------------------- migrations/Version20241202163851.php | 31 -------------------- migrations/Version20241203124000.php | 33 --------------------- migrations/Version20241203130131.php | 32 -------------------- migrations/Version20241204212205.php | 31 -------------------- migrations/Version20241205135004.php | 38 ------------------------ migrations/Version20241210175624.php | 35 ---------------------- migrations/Version20241211164528.php | 44 ---------------------------- migrations/Version20241211174012.php | 35 ---------------------- migrations/Version20241211175518.php | 31 -------------------- migrations/Version20241217153251.php | 31 -------------------- migrations/Version20241217154700.php | 31 -------------------- migrations/Version20241217154841.php | 31 -------------------- migrations/Version20241217170102.php | 31 -------------------- migrations/Version20241231150438.php | 31 -------------------- migrations/Version20241231153428.php | 31 -------------------- migrations/Version20250105181626.php | 33 --------------------- migrations/Version20250202160116.php | 31 -------------------- migrations/Version20250206181740.php | 31 -------------------- migrations/Version20250210173157.php | 31 -------------------- migrations/Version20250210174710.php | 31 -------------------- migrations/Version20250302163932.php | 39 ------------------------ migrations/Version20250509100039.php | 38 ------------------------ migrations/Version20250509100408.php | 35 ---------------------- 24 files changed, 796 deletions(-) delete mode 100644 migrations/Version20241201111823.php delete mode 100644 migrations/Version20241202163851.php delete mode 100644 migrations/Version20241203124000.php delete mode 100644 migrations/Version20241203130131.php delete mode 100644 migrations/Version20241204212205.php delete mode 100644 migrations/Version20241205135004.php delete mode 100644 migrations/Version20241210175624.php delete mode 100644 migrations/Version20241211164528.php delete mode 100644 migrations/Version20241211174012.php delete mode 100644 migrations/Version20241211175518.php delete mode 100644 migrations/Version20241217153251.php delete mode 100644 migrations/Version20241217154700.php delete mode 100644 migrations/Version20241217154841.php delete mode 100644 migrations/Version20241217170102.php delete mode 100644 migrations/Version20241231150438.php delete mode 100644 migrations/Version20241231153428.php delete mode 100644 migrations/Version20250105181626.php delete mode 100644 migrations/Version20250202160116.php delete mode 100644 migrations/Version20250206181740.php delete mode 100644 migrations/Version20250210173157.php delete mode 100644 migrations/Version20250210174710.php delete mode 100644 migrations/Version20250302163932.php delete mode 100644 migrations/Version20250509100039.php delete mode 100644 migrations/Version20250509100408.php diff --git a/migrations/Version20241201111823.php b/migrations/Version20241201111823.php deleted file mode 100644 index 1edeb40..0000000 --- a/migrations/Version20241201111823.php +++ /dev/null @@ -1,31 +0,0 @@ -addSql('CREATE TABLE article (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, raw JSON DEFAULT NULL, event_id VARCHAR(225) DEFAULT NULL, slug TEXT DEFAULT NULL, content TEXT DEFAULT NULL, kind INT DEFAULT NULL, title VARCHAR(225) DEFAULT NULL, summary TEXT DEFAULT NULL, pubkey VARCHAR(255) NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, sig VARCHAR(255) NOT NULL, image TEXT DEFAULT NULL, published_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, topics JSON DEFAULT NULL, event_status INT DEFAULT NULL, index_status INT DEFAULT NULL, img_url VARCHAR(255) DEFAULT NULL, current_places JSON DEFAULT NULL, rating_negative INT DEFAULT NULL, rating_positive INT DEFAULT NULL, PRIMARY KEY(id))'); - } - - public function down(Schema $schema): void - { - // this down() migration is auto-generated, please modify it to your needs - $this->addSql('DROP TABLE article'); - } -} diff --git a/migrations/Version20241202163851.php b/migrations/Version20241202163851.php deleted file mode 100644 index ac179c1..0000000 --- a/migrations/Version20241202163851.php +++ /dev/null @@ -1,31 +0,0 @@ -addSql('CREATE TABLE "user" (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, npub VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, display_name VARCHAR(255) NOT NULL, about TEXT DEFAULT NULL, website TEXT DEFAULT NULL, picture TEXT DEFAULT NULL, roles JSON DEFAULT NULL, PRIMARY KEY(id))'); - } - - public function down(Schema $schema): void - { - // this down() migration is auto-generated, please modify it to your needs - $this->addSql('DROP TABLE "user"'); - } -} diff --git a/migrations/Version20241203124000.php b/migrations/Version20241203124000.php deleted file mode 100644 index 616349b..0000000 --- a/migrations/Version20241203124000.php +++ /dev/null @@ -1,33 +0,0 @@ -addSql('CREATE TABLE app_user (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, npub VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, display_name VARCHAR(255) NOT NULL, about TEXT DEFAULT NULL, website TEXT DEFAULT NULL, picture TEXT DEFAULT NULL, roles JSON DEFAULT NULL, PRIMARY KEY(id))'); - $this->addSql('DROP TABLE "user"'); - } - - public function down(Schema $schema): void - { - // this down() migration is auto-generated, please modify it to your needs - $this->addSql('CREATE TABLE "user" (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, npub VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, display_name VARCHAR(255) NOT NULL, about TEXT DEFAULT NULL, website TEXT DEFAULT NULL, picture TEXT DEFAULT NULL, roles JSON DEFAULT NULL, PRIMARY KEY(id))'); - $this->addSql('DROP TABLE app_user'); - } -} diff --git a/migrations/Version20241203130131.php b/migrations/Version20241203130131.php deleted file mode 100644 index a03b7f3..0000000 --- a/migrations/Version20241203130131.php +++ /dev/null @@ -1,32 +0,0 @@ -addSql('CREATE TABLE sessions (sess_id VARCHAR(128) NOT NULL, sess_data BYTEA NOT NULL, sess_lifetime INT NOT NULL, sess_time INT NOT NULL, PRIMARY KEY(sess_id))'); - $this->addSql('CREATE INDEX sess_lifetime_idx ON sessions (sess_lifetime)'); - } - - public function down(Schema $schema): void - { - // this down() migration is auto-generated, please modify it to your needs - $this->addSql('DROP TABLE sessions'); - } -} diff --git a/migrations/Version20241204212205.php b/migrations/Version20241204212205.php deleted file mode 100644 index d99dc8d..0000000 --- a/migrations/Version20241204212205.php +++ /dev/null @@ -1,31 +0,0 @@ -addSql('ALTER TABLE article DROP img_url'); - } - - public function down(Schema $schema): void - { - // this down() migration is auto-generated, please modify it to your needs - $this->addSql('ALTER TABLE article ADD img_url VARCHAR(255) DEFAULT NULL'); - } -} diff --git a/migrations/Version20241205135004.php b/migrations/Version20241205135004.php deleted file mode 100644 index 629ed19..0000000 --- a/migrations/Version20241205135004.php +++ /dev/null @@ -1,38 +0,0 @@ -addSql('DELETE FROM app_user - WHERE id NOT IN ( - SELECT MIN(id) - FROM app_user - GROUP BY npub - );'); - // this up() migration is auto-generated, please modify it to your needs - $this->addSql('CREATE UNIQUE INDEX UNIQ_88BDF3E95FB8BABB ON app_user (npub)'); - } - - public function down(Schema $schema): void - { - // this down() migration is auto-generated, please modify it to your needs - $this->addSql('DROP INDEX UNIQ_88BDF3E95FB8BABB'); - } -} diff --git a/migrations/Version20241210175624.php b/migrations/Version20241210175624.php deleted file mode 100644 index ce7cab7..0000000 --- a/migrations/Version20241210175624.php +++ /dev/null @@ -1,35 +0,0 @@ -addSql('CREATE TABLE journal (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, npub VARCHAR(255) NOT NULL, main_categories JSON NOT NULL, lists JSON DEFAULT NULL, editor VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id))'); - $this->addSql('ALTER TABLE app_user ALTER name DROP NOT NULL'); - $this->addSql('ALTER TABLE app_user ALTER display_name DROP NOT NULL'); - } - - public function down(Schema $schema): void - { - // this down() migration is auto-generated, please modify it to your needs - $this->addSql('DROP TABLE journal'); - $this->addSql('ALTER TABLE app_user ALTER name SET NOT NULL'); - $this->addSql('ALTER TABLE app_user ALTER display_name SET NOT NULL'); - } -} diff --git a/migrations/Version20241211164528.php b/migrations/Version20241211164528.php deleted file mode 100644 index a6cc0b2..0000000 --- a/migrations/Version20241211164528.php +++ /dev/null @@ -1,44 +0,0 @@ -addSql('CREATE TABLE nzine (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, npub VARCHAR(255) NOT NULL, main_categories JSON NOT NULL, lists JSON DEFAULT NULL, editor VARCHAR(255) DEFAULT NULL, nzine_bot_id INT DEFAULT NULL, PRIMARY KEY(id))'); - $this->addSql('CREATE UNIQUE INDEX UNIQ_65025D9871FD5427 ON nzine (nzine_bot_id)'); - $this->addSql('CREATE TABLE nzine_bot (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, nsec VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); - $this->addSql('ALTER TABLE nzine ADD CONSTRAINT FK_65025D9871FD5427 FOREIGN KEY (nzine_bot_id) REFERENCES nzine_bot (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('DROP TABLE journal'); - $this->addSql('ALTER TABLE app_user ADD nzine_bot_id INT DEFAULT NULL'); - $this->addSql('ALTER TABLE app_user ADD CONSTRAINT FK_88BDF3E971FD5427 FOREIGN KEY (nzine_bot_id) REFERENCES nzine_bot (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('CREATE UNIQUE INDEX UNIQ_88BDF3E971FD5427 ON app_user (nzine_bot_id)'); - } - - public function down(Schema $schema): void - { - // this down() migration is auto-generated, please modify it to your needs - $this->addSql('CREATE TABLE journal (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, npub VARCHAR(255) NOT NULL, main_categories JSON NOT NULL, lists JSON DEFAULT NULL, editor VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id))'); - $this->addSql('ALTER TABLE nzine DROP CONSTRAINT FK_65025D9871FD5427'); - $this->addSql('DROP TABLE nzine'); - $this->addSql('DROP TABLE nzine_bot'); - $this->addSql('ALTER TABLE app_user DROP CONSTRAINT FK_88BDF3E971FD5427'); - $this->addSql('DROP INDEX UNIQ_88BDF3E971FD5427'); - $this->addSql('ALTER TABLE app_user DROP nzine_bot_id'); - } -} diff --git a/migrations/Version20241211174012.php b/migrations/Version20241211174012.php deleted file mode 100644 index 14837b7..0000000 --- a/migrations/Version20241211174012.php +++ /dev/null @@ -1,35 +0,0 @@ -addSql('ALTER TABLE app_user DROP CONSTRAINT fk_88bdf3e971fd5427'); - $this->addSql('DROP INDEX uniq_88bdf3e971fd5427'); - $this->addSql('ALTER TABLE app_user DROP nzine_bot_id'); - } - - public function down(Schema $schema): void - { - // this down() migration is auto-generated, please modify it to your needs - $this->addSql('ALTER TABLE app_user ADD nzine_bot_id INT DEFAULT NULL'); - $this->addSql('ALTER TABLE app_user ADD CONSTRAINT fk_88bdf3e971fd5427 FOREIGN KEY (nzine_bot_id) REFERENCES nzine_bot (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('CREATE UNIQUE INDEX uniq_88bdf3e971fd5427 ON app_user (nzine_bot_id)'); - } -} diff --git a/migrations/Version20241211175518.php b/migrations/Version20241211175518.php deleted file mode 100644 index 020b00a..0000000 --- a/migrations/Version20241211175518.php +++ /dev/null @@ -1,31 +0,0 @@ -addSql('ALTER TABLE nzine_bot RENAME COLUMN nsec TO encrypted_nsec'); - } - - public function down(Schema $schema): void - { - // this down() migration is auto-generated, please modify it to your needs - $this->addSql('ALTER TABLE nzine_bot RENAME COLUMN encrypted_nsec TO nsec'); - } -} diff --git a/migrations/Version20241217153251.php b/migrations/Version20241217153251.php deleted file mode 100644 index eb1cc9c..0000000 --- a/migrations/Version20241217153251.php +++ /dev/null @@ -1,31 +0,0 @@ -addSql('CREATE TABLE event (id VARCHAR(225) NOT NULL, kind INT NOT NULL, pubkey VARCHAR(255) NOT NULL, content TEXT NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, tags JSON NOT NULL, sig VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); - } - - public function down(Schema $schema): void - { - // this down() migration is auto-generated, please modify it to your needs - $this->addSql('DROP TABLE event'); - } -} diff --git a/migrations/Version20241217154700.php b/migrations/Version20241217154700.php deleted file mode 100644 index 2498b3d..0000000 --- a/migrations/Version20241217154700.php +++ /dev/null @@ -1,31 +0,0 @@ -addSql('ALTER TABLE nzine ADD slug TEXT DEFAULT NULL'); - } - - public function down(Schema $schema): void - { - // this down() migration is auto-generated, please modify it to your needs - $this->addSql('ALTER TABLE nzine DROP slug'); - } -} diff --git a/migrations/Version20241217154841.php b/migrations/Version20241217154841.php deleted file mode 100644 index 1dc3433..0000000 --- a/migrations/Version20241217154841.php +++ /dev/null @@ -1,31 +0,0 @@ -addSql('ALTER TABLE nzine ADD slug TEXT DEFAULT NULL'); - } - - public function down(Schema $schema): void - { - // this down() migration is auto-generated, please modify it to your needs - $this->addSql('ALTER TABLE nzine DROP slug'); - } -} diff --git a/migrations/Version20241217170102.php b/migrations/Version20241217170102.php deleted file mode 100644 index b3ac9bc..0000000 --- a/migrations/Version20241217170102.php +++ /dev/null @@ -1,31 +0,0 @@ -addSql('ALTER TABLE event ALTER created_at TYPE BIGINT USING EXTRACT(EPOCH FROM created_at)::BIGINT'); - } - - public function down(Schema $schema): void - { - // this down() migration is auto-generated, please modify it to your needs - $this->addSql('ALTER TABLE event ALTER created_at TYPE TIMESTAMP(0) WITHOUT TIME ZONE'); - } -} diff --git a/migrations/Version20241231150438.php b/migrations/Version20241231150438.php deleted file mode 100644 index b29ab08..0000000 --- a/migrations/Version20241231150438.php +++ /dev/null @@ -1,31 +0,0 @@ -addSql('ALTER TABLE event ADD slug TEXT DEFAULT NULL'); - } - - public function down(Schema $schema): void - { - // this down() migration is auto-generated, please modify it to your needs - $this->addSql('ALTER TABLE event DROP slug'); - } -} diff --git a/migrations/Version20241231153428.php b/migrations/Version20241231153428.php deleted file mode 100644 index ad81158..0000000 --- a/migrations/Version20241231153428.php +++ /dev/null @@ -1,31 +0,0 @@ -addSql('ALTER TABLE event DROP slug'); - } - - public function down(Schema $schema): void - { - // this down() migration is auto-generated, please modify it to your needs - $this->addSql('ALTER TABLE event ADD slug TEXT DEFAULT NULL'); - } -} diff --git a/migrations/Version20250105181626.php b/migrations/Version20250105181626.php deleted file mode 100644 index e1b8e1b..0000000 --- a/migrations/Version20250105181626.php +++ /dev/null @@ -1,33 +0,0 @@ -addSql('ALTER TABLE nzine ADD state VARCHAR(255) DEFAULT NULL'); - $this->addSql("UPDATE nzine SET state = 'draft'"); - $this->addSql('ALTER TABLE nzine ALTER COLUMN state SET NOT NULL'); - } - - public function down(Schema $schema): void - { - // this down() migration is auto-generated, please modify it to your needs - $this->addSql('ALTER TABLE nzine DROP state'); - } -} diff --git a/migrations/Version20250202160116.php b/migrations/Version20250202160116.php deleted file mode 100644 index 5c120e0..0000000 --- a/migrations/Version20250202160116.php +++ /dev/null @@ -1,31 +0,0 @@ -addSql('ALTER TABLE article ALTER title TYPE TEXT'); - } - - public function down(Schema $schema): void - { - // this down() migration is auto-generated, please modify it to your needs - $this->addSql('ALTER TABLE article ALTER title TYPE VARCHAR(225)'); - } -} diff --git a/migrations/Version20250206181740.php b/migrations/Version20250206181740.php deleted file mode 100644 index 202db87..0000000 --- a/migrations/Version20250206181740.php +++ /dev/null @@ -1,31 +0,0 @@ -addSql('ALTER TABLE event ADD event_id VARCHAR(225) DEFAULT NULL'); - } - - public function down(Schema $schema): void - { - // this down() migration is auto-generated, please modify it to your needs - $this->addSql('ALTER TABLE event DROP event_id'); - } -} diff --git a/migrations/Version20250210173157.php b/migrations/Version20250210173157.php deleted file mode 100644 index 870236b..0000000 --- a/migrations/Version20250210173157.php +++ /dev/null @@ -1,31 +0,0 @@ -addSql('ALTER TABLE event ALTER event_id SET NOT NULL'); - } - - public function down(Schema $schema): void - { - // this down() migration is auto-generated, please modify it to your needs - // $this->addSql('ALTER TABLE event ALTER event_id DROP NOT NULL'); - } -} diff --git a/migrations/Version20250210174710.php b/migrations/Version20250210174710.php deleted file mode 100644 index 5354916..0000000 --- a/migrations/Version20250210174710.php +++ /dev/null @@ -1,31 +0,0 @@ -addSql('ALTER TABLE event DROP event_id'); - } - - public function down(Schema $schema): void - { - // this down() migration is auto-generated, please modify it to your needs - // $this->addSql('ALTER TABLE event ADD event_id VARCHAR(225) DEFAULT NULL'); - } -} diff --git a/migrations/Version20250302163932.php b/migrations/Version20250302163932.php deleted file mode 100644 index 22d7a5c..0000000 --- a/migrations/Version20250302163932.php +++ /dev/null @@ -1,39 +0,0 @@ -addSql('ALTER TABLE app_user DROP name'); - $this->addSql('ALTER TABLE app_user DROP display_name'); - $this->addSql('ALTER TABLE app_user DROP about'); - $this->addSql('ALTER TABLE app_user DROP website'); - $this->addSql('ALTER TABLE app_user DROP picture'); - } - - public function down(Schema $schema): void - { - // this down() migration is auto-generated, please modify it to your needs - $this->addSql('ALTER TABLE app_user ADD name VARCHAR(255) DEFAULT NULL'); - $this->addSql('ALTER TABLE app_user ADD display_name VARCHAR(255) DEFAULT NULL'); - $this->addSql('ALTER TABLE app_user ADD about TEXT DEFAULT NULL'); - $this->addSql('ALTER TABLE app_user ADD website TEXT DEFAULT NULL'); - $this->addSql('ALTER TABLE app_user ADD picture TEXT DEFAULT NULL'); - } -} diff --git a/migrations/Version20250509100039.php b/migrations/Version20250509100039.php deleted file mode 100644 index c79bf4e..0000000 --- a/migrations/Version20250509100039.php +++ /dev/null @@ -1,38 +0,0 @@ -addSql(<<<'SQL' - DROP TABLE sessions - SQL); - } - - public function down(Schema $schema): void - { - // this down() migration is auto-generated, please modify it to your needs - $this->addSql(<<<'SQL' - CREATE TABLE sessions (sess_id VARCHAR(128) NOT NULL, sess_data BYTEA NOT NULL, sess_lifetime INT NOT NULL, sess_time INT NOT NULL, PRIMARY KEY(sess_id)) - SQL); - $this->addSql(<<<'SQL' - CREATE INDEX sess_lifetime_idx ON sessions (sess_lifetime) - SQL); - } -} diff --git a/migrations/Version20250509100408.php b/migrations/Version20250509100408.php deleted file mode 100644 index 2eff9e0..0000000 --- a/migrations/Version20250509100408.php +++ /dev/null @@ -1,35 +0,0 @@ -addSql(<<<'SQL' - CREATE TABLE credit_transaction (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, npub VARCHAR(64) NOT NULL, amount INT NOT NULL, type VARCHAR(16) NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, reason VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)) - SQL); - } - - public function down(Schema $schema): void - { - // this down() migration is auto-generated, please modify it to your needs - $this->addSql(<<<'SQL' - DROP TABLE credit_transaction - SQL); - } -}