Skip to content

Commit 1d9170b

Browse files
committed
Support for Migrations 3
1 parent ed94f81 commit 1d9170b

17 files changed

+2148
-871
lines changed

.doctrine-project.json

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,24 @@
66
"docsSlug": "doctrine-orm-module",
77
"versions": [
88
{
9-
"name": "3.0.x",
10-
"branchName": "3.0.x",
11-
"slug": "3.0.x",
9+
"name": "3.1.x",
10+
"branchName": "3.1.x",
11+
"slug": "3.1.x",
1212
"current": true,
1313
"maintained": true,
1414
"aliases": [
1515
"current",
16-
"stable"
16+
"stable",
17+
"latest"
1718
]
1819
},
20+
{
21+
"name": "3.0.x",
22+
"branchName": "3.0.x",
23+
"slug": "3.0.x",
24+
"current": false,
25+
"maintained": true
26+
},
1927
{
2028
"name": "3.x",
2129
"branchName": "3.x",

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ phpunit.xml
44
.project/
55
nbproject/
66
composer.phar
7-
.php_cs.cache
87
.phpunit.result.cache
8+
.php_cs.cache
9+
.phpcs-cache

.travis/Version20120714005702.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,14 @@ class Version20120714005702 extends AbstractMigration
3232
*/
3333
public function up(Schema $schema) : void
3434
{
35-
$this->addSql("SELECT 'Migration succeeded!'");
35+
$this->addSql("CREATE TABLE test (id int)");
3636
}
3737

3838
/**
3939
* {@inheritDoc}
4040
*/
4141
public function down(Schema $schema) : void
4242
{
43+
$this->addSql("DROP TABLE test");
4344
}
4445
}

.travis/config/travis.config.php

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,21 @@
2323
],
2424
'migrations_configuration' => [
2525
'orm_default' => [
26-
'directory' => '.travis',
27-
'namespace' => 'TravisDoctrineMigrations',
26+
'table_storage' => [
27+
'table_name' => 'DoctrineMigrationVersions',
28+
'version_column_name' => 'version',
29+
'version_column_length' => 1024,
30+
'executed_at_column_name' => 'executedAt',
31+
'execution_time_column_name' => 'executionTime',
32+
],
33+
'migrations_paths' => [
34+
'TravisDoctrineMigrations' => '.travis',
35+
],
36+
'migrations' => [],
37+
'all_or_nothing' => false,
38+
'check_database_platform' => true,
39+
'organize_migrations' => 'year', // year or year_and_month
40+
'custom_template' => null,
2841
],
2942
],
3043
'cache' => [

.travis/run-cli-migrations.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
./vendor/bin/doctrine-module migrations:generate
2-
./vendor/bin/doctrine-module migrations:diff
3-
./vendor/bin/doctrine-module migrations:execute 20120714005702 -n
4-
./vendor/bin/doctrine-module migrations:migrate --no-interaction
2+
./vendor/bin/doctrine-module migrations:diff -n
3+
./vendor/bin/doctrine-module migrations:execute --up 'TravisDoctrineMigrations\Version20120714005702' -n
4+
./vendor/bin/doctrine-module migrations:migrate -n
5+
./vendor/bin/doctrine-module migrations:sync-metadata-storage
6+
./vendor/bin/doctrine-module migrations:list
7+
./vendor/bin/doctrine-module migrations:current
8+
./vendor/bin/doctrine-module migrations:latest
9+
./vendor/bin/doctrine-module migrations:up-to-date
10+
./vendor/bin/doctrine-module migrations:status --no-interaction
11+
./vendor/bin/doctrine-module migrations:version --delete 'TravisDoctrineMigrations\Version20120714005702' -n

composer.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"doctrine/annotations": "^1.8",
6161
"doctrine/coding-standard": "^8.0",
6262
"doctrine/data-fixtures": "^1.2.1",
63-
"doctrine/migrations": "^1.5 || ^2.0, < 2.3.0",
63+
"doctrine/migrations": "^3.0",
6464
"laminas/laminas-code": "^3.3.2",
6565
"laminas/laminas-console": "^2.6",
6666
"laminas/laminas-developer-tools": "^1.1",
@@ -74,17 +74,14 @@
7474
"squizlabs/php_codesniffer": "^3.5"
7575
},
7676
"conflict": {
77-
"doctrine/migrations": ">=3.0"
77+
"doctrine/migrations": "<3.0"
7878
},
7979
"suggest": {
8080
"laminas/laminas-form": "if you want to use form elements backed by Doctrine",
8181
"laminas/laminas-developer-tools": "laminas-developer-tools if you want to profile operations executed by the ORM during development",
8282
"doctrine/migrations": "doctrine migrations if you want to keep your schema definitions versioned"
8383
},
8484
"autoload": {
85-
"files": [
86-
"src/autoload.php"
87-
],
8885
"psr-0": {
8986
"DoctrineORMModule\\": "src/"
9087
}

0 commit comments

Comments
 (0)