Skip to content

Instantly share code, notes, and snippets.

@inri13666
Forked from evgeniy1204/settings.php
Last active September 4, 2017 15:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save inri13666/73ce99a45d023bddac0cfdae2d30bb42 to your computer and use it in GitHub Desktop.
Save inri13666/73ce99a45d023bddac0cfdae2d30bb42 to your computer and use it in GitHub Desktop.
<?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