3 namespace Application\Migrations
;
5 use Doctrine\DBAL\Migrations\AbstractMigration
;
6 use Doctrine\DBAL\Schema\Schema
;
8 class Version20161106113822
extends AbstractMigration
11 * @var ContainerInterface
15 public function setContainer(ContainerInterface
$container = null)
17 $this->container
= $container;
20 private function getTable($tableName)
22 return $this->container
->getParameter('database_table_prefix') . $tableName;
26 * @param Schema $schema
28 public function up(Schema
$schema)
30 $this->addSql('ALTER TABLE "'.$this->getTable('config').'" ADD action_mark_as_read INT DEFAULT 0');
34 * @param Schema $schema
36 public function down(Schema
$schema)
38 $this->abortIf($this->connection
->getDatabasePlatform()->getName() != 'sqlite', 'This down migration can\'t be executed on SQLite databases, because SQLite don\'t support DROP COLUMN.');
40 $this->addSql('ALTER TABLE "'.$this->getTable('config').'" DROP action_mark_as_read');