From 6d638934535878b2896104161c4a66752a5eab53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nu=C5=A1a=20Puk=C5=A1i=C4=8D?= Date: Mon, 6 Oct 2025 16:42:33 +0200 Subject: [PATCH] Migration --- migrations/Version20251006135000.php | 59 ++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 migrations/Version20251006135000.php diff --git a/migrations/Version20251006135000.php b/migrations/Version20251006135000.php new file mode 100644 index 0000000..ee2f015 --- /dev/null +++ b/migrations/Version20251006135000.php @@ -0,0 +1,59 @@ +addSql(<<<'SQL' + DROP INDEX idx_article_slug + SQL); + $this->addSql(<<<'SQL' + DROP INDEX idx_3bae0aa7afece2eb + SQL); + $this->addSql(<<<'SQL' + DROP INDEX idx_event_kind_created + SQL); + $this->addSql(<<<'SQL' + DROP INDEX idx_event_pubkey + SQL); + $this->addSql(<<<'SQL' + ALTER TABLE visit ADD session_id VARCHAR(255) DEFAULT NULL + SQL); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql(<<<'SQL' + CREATE INDEX idx_article_slug ON article (slug) + SQL); + $this->addSql(<<<'SQL' + ALTER TABLE visit DROP session_id + SQL); + $this->addSql(<<<'SQL' + CREATE INDEX idx_3bae0aa7afece2eb ON event (kind) + SQL); + $this->addSql(<<<'SQL' + CREATE INDEX idx_event_kind_created ON event (kind, created_at) + SQL); + $this->addSql(<<<'SQL' + CREATE INDEX idx_event_pubkey ON event (pubkey) + SQL); + } +}