From 31fec5f363b915fb694d9a6e925d02da1e83b508 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sun, 4 Dec 2016 12:56:20 +0100 Subject: Ensure craue_config_setting migration are ok We now can run the migration every time, new line from `craue_config_setting` are properly checked. --- app/DoctrineMigrations/Version20161122144743.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'app/DoctrineMigrations/Version20161122144743.php') diff --git a/app/DoctrineMigrations/Version20161122144743.php b/app/DoctrineMigrations/Version20161122144743.php index 536b8339..02113031 100644 --- a/app/DoctrineMigrations/Version20161122144743.php +++ b/app/DoctrineMigrations/Version20161122144743.php @@ -32,6 +32,13 @@ class Version20161122144743 extends AbstractMigration implements ContainerAwareI */ public function up(Schema $schema) { + $access = $this->container + ->get('doctrine.orm.default_entity_manager') + ->getConnection() + ->fetchArray('SELECT * FROM '.$this->getTable('craue_config_setting').' WHERE name = "restricted_access"'); + + $this->skipIf(false !== $access, 'It seems that you already played this migration.'); + $this->addSql('INSERT INTO '.$this->getTable('craue_config_setting')." (name, value, section) VALUES ('restricted_access', 0, 'entry')"); } -- cgit v1.2.3