| @@ 8-24 (lines=17) @@ | ||
| 5 | use Doctrine\Migrations\AbstractMigration; |
|
| 6 | use Doctrine\DBAL\Schema\Schema; |
|
| 7 | ||
| 8 | class Version20150917142245 extends AbstractMigration |
|
| 9 | { |
|
| 10 | public function up(Schema $schema) : void |
|
| 11 | { |
|
| 12 | $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.'); |
|
| 13 | ||
| 14 | $this->addSql('ALTER TABLE performance_schedule ADD venue VARCHAR(255) NOT NULL'); |
|
| 15 | $this->addSql("UPDATE performance_schedule SET venue='venue-theatre' WHERE datetime < date('2015-07-01')"); |
|
| 16 | } |
|
| 17 | ||
| 18 | public function down(Schema $schema) : void |
|
| 19 | { |
|
| 20 | $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.'); |
|
| 21 | ||
| 22 | $this->addSql('ALTER TABLE performance_schedule DROP venue'); |
|
| 23 | } |
|
| 24 | } |
|
| 25 | ||
| @@ 8-23 (lines=16) @@ | ||
| 5 | use Doctrine\Migrations\AbstractMigration; |
|
| 6 | use Doctrine\DBAL\Schema\Schema; |
|
| 7 | ||
| 8 | class Version20160503093009 extends AbstractMigration |
|
| 9 | { |
|
| 10 | public function up(Schema $schema) : void |
|
| 11 | { |
|
| 12 | $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.'); |
|
| 13 | ||
| 14 | $this->addSql('ALTER TABLE posts ADD pinned TINYINT(1) NOT NULL'); |
|
| 15 | } |
|
| 16 | ||
| 17 | public function down(Schema $schema) : void |
|
| 18 | { |
|
| 19 | $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.'); |
|
| 20 | ||
| 21 | $this->addSql('ALTER TABLE posts DROP pinned'); |
|
| 22 | } |
|
| 23 | } |
|
| 24 | ||