/
Version20140930000000.php
42 lines (37 loc) · 1.1 KB
/
Version20140930000000.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
namespace Concrete\Core\Updater\Migrations\Migrations;
use Concrete\Core\Updater\Migrations\AbstractMigration;
use Concrete\Core\Updater\Migrations\RepeatableMigrationInterface;
use Doctrine\DBAL\Schema\Schema;
class Version20140930000000 extends AbstractMigration implements RepeatableMigrationInterface
{
/**
* {@inheritdoc}
*
* @see \Doctrine\DBAL\Migrations\AbstractMigration::getDescription()
*/
public function getDescription()
{
return '5.7.0.4';
}
/**
* {@inheritdoc}
*
* @see \Doctrine\DBAL\Migrations\AbstractMigration::preUp()
*/
public function preUp(Schema $schema)
{
\Database::query('UPDATE Config SET configNamespace="" WHERE configNamespace IS NULL');
}
/**
* {@inheritdoc}
*
* @see \Concrete\Core\Updater\Migrations\AbstractMigration::upgradeSchema()
*/
public function upgradeSchema(Schema $schema)
{
$config = $schema->getTable('Config');
$config->dropPrimaryKey();
$config->setPrimaryKey(['configNamespace', 'configGroup', 'configItem']);
}
}