-
-
Save inri13666/73ce99a45d023bddac0cfdae2d30bb42 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Application\Migrations; | |
use Doctrine\DBAL\Migrations\AbstractMigration; | |
use Doctrine\DBAL\Schema\Schema; | |
/** | |
* Auto-generated Migration: Please modify to your needs! | |
*/ | |
class Version20170904175832 extends AbstractMigration | |
{ | |
/** | |
* @param Schema $schema | |
*/ | |
public function up(Schema $schema) | |
{ | |
// this up() migration is auto-generated, please modify it to your needs | |
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.'); | |
$socials = array( | |
'social_telegram_link' => 'Telegram url', | |
'social_viber_link' => 'Viber url', | |
'social_inst_link' => 'Instagram url', | |
'social_yo_link' => 'Youtube url', | |
); | |
foreach($socials as $key=>$title) { | |
$this->addSql(sprintf( | |
'INSERT INTO settings (id, title, setting_key, value) VALUES (NULL, \'%s\', \'%s\', NULL)', | |
$title, | |
$key | |
)); | |
} | |
} | |
/** | |
* @param Schema $schema | |
*/ | |
public function down(Schema $schema) | |
{ | |
// this down() migration is auto-generated, please modify it to your needs | |
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment