Solves issue #12 Signed-off-by: Gergely Polonkai (W00d5t0ck) <polesz@w00d5t0ck.info>master
parent
4d8ae5c0f0
commit
6bdb9530a3
5 changed files with 223 additions and 1 deletions
@ -0,0 +1,30 @@ |
||||
<?php |
||||
|
||||
namespace Application\Migrations; |
||||
|
||||
use Doctrine\DBAL\Migrations\AbstractMigration, |
||||
Doctrine\DBAL\Schema\Schema; |
||||
|
||||
/** |
||||
* Auto-generated Migration: Please modify to your need! |
||||
*/ |
||||
class Version20120823160202 extends AbstractMigration |
||||
{ |
||||
public function up(Schema $schema) |
||||
{ |
||||
// this up() migration is autogenerated, please modify it to your needs |
||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); |
||||
|
||||
$this->addSql("CREATE TABLE user_favourite_forum_topics (user_id INT NOT NULL, forum_topic_id INT NOT NULL, INDEX IDX_917D04B0A76ED395 (user_id), INDEX IDX_917D04B038A6ADDA (forum_topic_id), PRIMARY KEY(user_id, forum_topic_id)) ENGINE = InnoDB"); |
||||
$this->addSql("ALTER TABLE user_favourite_forum_topics ADD CONSTRAINT FK_917D04B0A76ED395 FOREIGN KEY (user_id) REFERENCES user_data (user_id)"); |
||||
$this->addSql("ALTER TABLE user_favourite_forum_topics ADD CONSTRAINT FK_917D04B038A6ADDA FOREIGN KEY (forum_topic_id) REFERENCES forum_topics (id)"); |
||||
} |
||||
|
||||
public function down(Schema $schema) |
||||
{ |
||||
// this down() migration is autogenerated, please modify it to your needs |
||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); |
||||
|
||||
$this->addSql("DROP TABLE user_favourite_forum_topics"); |
||||
} |
||||
} |
Loading…
Reference in new issue