CraftCamp /
official-website
| 1 | <?php declare(strict_types = 1); |
||
| 2 | |||
| 3 | namespace App\Migrations; |
||
| 4 | |||
| 5 | use Doctrine\DBAL\Migrations\AbstractMigration; |
||
| 6 | use Doctrine\DBAL\Schema\Schema; |
||
| 7 | |||
| 8 | /** |
||
| 9 | * Auto-generated Migration: Please modify to your needs! |
||
| 10 | */ |
||
| 11 | class Version20180307131125 extends AbstractMigration |
||
|
0 ignored issues
–
show
Deprecated Code
introduced
by
Loading history...
|
|||
| 12 | { |
||
| 13 | public function up(Schema $schema) |
||
| 14 | { |
||
| 15 | // this up() migration is auto-generated, please modify it to your needs |
||
| 16 | $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); |
||
| 17 | |||
| 18 | $this->addSql('ALTER TABLE developtech_agility__projects ADD updated_at DATETIME'); |
||
| 19 | $this->addSql('UPDATE developtech_agility__projects SET updated_at = created_at WHERE 1'); |
||
| 20 | $this->addSql('ALTER TABLE developtech_agility__projects CHANGE updated_at updated_at DATETIME NOT NULL'); |
||
| 21 | } |
||
| 22 | |||
| 23 | public function down(Schema $schema) |
||
| 24 | { |
||
| 25 | // this down() migration is auto-generated, please modify it to your needs |
||
| 26 | $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); |
||
| 27 | |||
| 28 | $this->addSql('ALTER TABLE developtech_agility__projects DROP updated_at'); |
||
| 29 | } |
||
| 30 | } |
||
| 31 |