| @@ 11-34 (lines=24) @@ | ||
| 8 | /** |
|
| 9 | * Auto-generated Migration: Please modify to your needs! |
|
| 10 | */ |
|
| 11 | class Version20170510222222 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('INSERT IGNORE INTO sysconfig VALUES (\'syslog_maillog_lastdate\', \'2017-05-01 00:00:01\')'); |
|
| 22 | } |
|
| 23 | ||
| 24 | /** |
|
| 25 | * @param Schema $schema |
|
| 26 | */ |
|
| 27 | public function down(Schema $schema) |
|
| 28 | { |
|
| 29 | // this down() migration is auto-generated, please modify it to your needs |
|
| 30 | $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.'); |
|
| 31 | ||
| 32 | $this->addSql('DROP TABLE field_note'); |
|
| 33 | } |
|
| 34 | } |
|
| 35 | ||
| @@ 11-55 (lines=45) @@ | ||
| 8 | /** |
|
| 9 | * Auto-generated Migration: Please modify to your needs! |
|
| 10 | */ |
|
| 11 | class Version20170516084212 extends AbstractMigration |
|
| 12 | { |
|
| 13 | /** |
|
| 14 | * @param Schema $schema |
|
| 15 | * @return void |
|
| 16 | */ |
|
| 17 | public function up(Schema $schema) |
|
| 18 | { |
|
| 19 | $this->abortIf( |
|
| 20 | $this->connection->getDatabasePlatform()->getName() != 'mysql', |
|
| 21 | 'Migration can only be executed safely on \'mysql\'.' |
|
| 22 | ); |
|
| 23 | ||
| 24 | $this->addSql(' |
|
| 25 | CREATE TABLE page_blocks( |
|
| 26 | id INT AUTO_INCREMENT NOT null, |
|
| 27 | page_group_id INT NOT null, |
|
| 28 | title VARCHAR(255) NOT null, |
|
| 29 | html LONGTEXT NOT null, |
|
| 30 | position INT DEFAULT null, |
|
| 31 | last_changed DATETIME NOT null, |
|
| 32 | active TINYINT(1) NOT null, |
|
| 33 | PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; |
|
| 34 | '); |
|
| 35 | ||
| 36 | $this->addSql(' |
|
| 37 | CREATE TABLE page_groups( |
|
| 38 | id INT AUTO_INCREMENT NOT null, |
|
| 39 | slug VARCHAR(80) NOT null UNIQUE , |
|
| 40 | meta_keywords VARCHAR(255) NOT null, |
|
| 41 | meta_description VARCHAR(255) DEFAULT null, |
|
| 42 | meta_social LONGTEXT DEFAULT null, |
|
| 43 | last_changed DATETIME NOT null, |
|
| 44 | active TINYINT(1) NOT null, |
|
| 45 | PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB; |
|
| 46 | '); |
|
| 47 | ||
| 48 | $this->addSql('ALTER TABLE page_blocks ADD FOREIGN KEY (page_group_id) REFERENCES page_groups(id);'); |
|
| 49 | } |
|
| 50 | ||
| 51 | /** |
|
| 52 | * @param Schema $schema |
|
| 53 | * @return void |
|
| 54 | */ |
|
| 55 | public function down(Schema $schema) |
|
| 56 | { |
|
| 57 | // this down() migration is auto-generated, please modify it to your needs |
|
| 58 | } |
|