diff options
Diffstat (limited to 'app/DoctrineMigrations')
-rw-r--r-- | app/DoctrineMigrations/Version20160410190541.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/app/DoctrineMigrations/Version20160410190541.php b/app/DoctrineMigrations/Version20160410190541.php index ebf4135f..6294d842 100644 --- a/app/DoctrineMigrations/Version20160410190541.php +++ b/app/DoctrineMigrations/Version20160410190541.php | |||
@@ -34,13 +34,21 @@ class Version20160410190541 extends AbstractMigration implements ContainerAwareI | |||
34 | { | 34 | { |
35 | $entryTable = $schema->getTable($this->getTable('entry')); | 35 | $entryTable = $schema->getTable($this->getTable('entry')); |
36 | 36 | ||
37 | $this->skipIf($entryTable->hasColumn('uid'), 'It seems that you already played this migration.'); | 37 | $this->skipIf($entryTable->hasColumn('uid') || $entryTable->hasColumn('uuid'), 'It seems that you already played this migration.'); |
38 | 38 | ||
39 | $entryTable->addColumn('uid', 'string', [ | 39 | $entryTable->addColumn('uid', 'string', [ |
40 | 'notnull' => false, | 40 | 'notnull' => false, |
41 | 'length' => 23, | 41 | 'length' => 23, |
42 | ]); | 42 | ]); |
43 | $this->addSql('INSERT INTO '.$this->getTable('craue_config_setting')." (name, value, section) VALUES ('share_public', '1', 'entry')"); | 43 | |
44 | $sharePublic = $this->container | ||
45 | ->get('doctrine.orm.default_entity_manager') | ||
46 | ->getConnection() | ||
47 | ->fetchArray('SELECT * FROM '.$this->getTable('craue_config_setting')." WHERE name = 'share_public'"); | ||
48 | |||
49 | if (false === $sharePublic) { | ||
50 | $this->addSql('INSERT INTO '.$this->getTable('craue_config_setting')." (name, value, section) VALUES ('share_public', '1', 'entry')"); | ||
51 | } | ||
44 | } | 52 | } |
45 | 53 | ||
46 | /** | 54 | /** |