From 22ea2cd2ef76bff2b485ce7f8b416f3c027414d7 Mon Sep 17 00:00:00 2001 From: "Gergely Polonkai (W00d5t0ck)" Date: Thu, 23 Aug 2012 17:08:38 +0200 Subject: [PATCH] Fixed initial Doctrine migrations file Added ForumTopic title and slug unique constraints Signed-off-by: Gergely Polonkai (W00d5t0ck) --- app/DoctrineMigrations/Version20120731113533.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/DoctrineMigrations/Version20120731113533.php b/app/DoctrineMigrations/Version20120731113533.php index 5154290..d0c19c9 100644 --- a/app/DoctrineMigrations/Version20120731113533.php +++ b/app/DoctrineMigrations/Version20120731113533.php @@ -49,7 +49,7 @@ class Version20120731113533 extends AbstractMigration $this->addSql("CREATE TABLE forum_topic_groups (id INT AUTO_INCREMENT NOT NULL, created_by_id INT DEFAULT NULL, createdAt DATETIME NOT NULL, slug VARCHAR(100) NOT NULL, title VARCHAR(100) NOT NULL, UNIQUE INDEX UNIQ_6BB4FCEF989D9B62 (slug), UNIQUE INDEX UNIQ_6BB4FCEF2B36786B (title), INDEX IDX_6BB4FCEFB03A8386 (created_by_id), PRIMARY KEY(id)) ENGINE = InnoDB"); $this->addSql("ALTER TABLE forum_topic_groups ADD CONSTRAINT FK_6BB4FCEFB03A8386 FOREIGN KEY (created_by_id) REFERENCES users (id)"); - $this->addSql("CREATE TABLE forum_topics (id INT AUTO_INCREMENT NOT NULL, created_by_id INT DEFAULT NULL, topic_group_id INT DEFAULT NULL, last_post_id INT DEFAULT NULL, created_at DATETIME NOT NULL, slug VARCHAR(100) NOT NULL, title VARCHAR(100) NOT NULL, INDEX IDX_895975E8B03A8386 (created_by_id), INDEX IDX_895975E88655441 (topic_group_id), UNIQUE INDEX UNIQ_895975E82D053F64 (last_post_id), PRIMARY KEY(id)) ENGINE = InnoDB"); + $this->addSql("CREATE TABLE forum_topics (id INT AUTO_INCREMENT NOT NULL, created_by_id INT DEFAULT NULL, topic_group_id INT DEFAULT NULL, last_post_id INT DEFAULT NULL, created_at DATETIME NOT NULL, slug VARCHAR(100) NOT NULL, title VARCHAR(100) NOT NULL, INDEX IDX_895975E8B03A8386 (created_by_id), INDEX IDX_895975E88655441 (topic_group_id), UNIQUE INDEX UNIQ_895975E82D053F64 (last_post_id), UNIQUE INDEX UNIQ_895975E886554412B36786B (topic_group_id, title), UNIQUE INDEX UNIQ_895975E88655441989D9B62 (topic_group_id, slug), PRIMARY KEY(id)) ENGINE = InnoDB"); $this->addSql("ALTER TABLE forum_topics ADD CONSTRAINT FK_895975E8B03A8386 FOREIGN KEY (created_by_id) REFERENCES users (id)"); $this->addSql("ALTER TABLE forum_topics ADD CONSTRAINT FK_895975E88655441 FOREIGN KEY (topic_group_id) REFERENCES forum_topic_groups (id)");