| Total Complexity | 2 |
| Total Lines | 26 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | class Version20170101183347 extends AbstractMigration |
||
|
|
|||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @param Schema $schema |
||
| 15 | */ |
||
| 16 | public function up(Schema $schema) |
||
| 17 | { |
||
| 18 | // this up() migration is auto-generated, please modify it to your needs |
||
| 19 | $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); |
||
| 20 | |||
| 21 | $this->addSql('ALTER TABLE thought ADD author_id INT NOT NULL'); |
||
| 22 | $this->addSql('ALTER TABLE thought ADD CONSTRAINT FK_91BB9F6CF675F31B FOREIGN KEY (author_id) REFERENCES user (id)'); |
||
| 23 | $this->addSql('CREATE INDEX IDX_91BB9F6CF675F31B ON thought (author_id)'); |
||
| 24 | } |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @param Schema $schema |
||
| 28 | */ |
||
| 29 | public function down(Schema $schema) |
||
| 37 | } |
||
| 38 | } |
||
| 39 |