|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace RDV\Bundle\MigrationBundle\Migration; |
|
4
|
|
|
|
|
5
|
|
|
use Doctrine\DBAL\Schema\Schema; |
|
6
|
|
|
|
|
7
|
|
|
class CreateMigrationTableMigration implements Migration |
|
8
|
|
|
{ |
|
9
|
|
|
/** |
|
10
|
|
|
* @inheritdoc |
|
11
|
|
|
*/ |
|
12
|
|
|
public function up(Schema $schema, QueryBag $queries) |
|
13
|
|
|
{ |
|
14
|
|
|
$table = $schema->createTable(Tables::MIGRATION_TABLE); |
|
15
|
|
|
$table->addColumn('id', 'integer', ['notnull' => true, 'autoincrement' => true]); |
|
16
|
|
|
$table->addColumn('bundle', 'string', ['notnull' => true, 'length' => 250]); |
|
17
|
|
|
$table->addColumn('version', 'string', ['notnull' => true, 'length' => 250]); |
|
18
|
|
|
$table->addColumn('loaded_at', 'datetime', ['notnull' => true]); |
|
19
|
|
|
$table->setPrimaryKey(['id']); |
|
20
|
|
|
$table->addIndex(['bundle'], 'idx_rdv_migrations', []); |
|
21
|
|
|
|
|
22
|
|
|
$table = $schema->createTable(Tables::MIGRATION_DATA_TABLE); |
|
23
|
|
|
$table->addColumn('id', 'integer', ['notnull' => true, 'autoincrement' => true]); |
|
24
|
|
|
$table->addColumn('class_name', 'string', ['default' => null, 'notnull' => true, 'length' => 255]); |
|
25
|
|
|
$table->addColumn('loaded_at', 'datetime', ['notnull' => true]); |
|
26
|
|
|
$table->addColumn('version', 'string', ['notnull' => false, 'length' => 255]); |
|
27
|
|
|
$table->setPrimaryKey(['id']); |
|
28
|
|
|
} |
|
29
|
|
|
} |
|
30
|
|
|
|