|
1 | 1 | PhpDbMigration - full PHP database migration tool |
2 | 2 | ================================================= |
3 | 3 |
|
4 | | -This is a full standalone PHP tool inspired by the rails database migration tool and MyBatis. |
| 4 | +This is a full standalone PHP tool based on symfony console and inspired by the rails database migration tool and MyBatis. |
5 | 5 | It merge the functionnality of the two tools and has been desined to be as flexible as possible. |
6 | 6 |
|
7 | 7 | Initialization |
8 | 8 | -------------- |
9 | | - |
10 | | -The first time the tool is run, it needs a first initialization like the following: |
11 | | - |
12 | | - ./migrate --init --driver=<driver> --database=<database> --host=<host> --login=<db_login> --password=<db_password> --changelog=<changelog_table_name> |
13 | | - |
14 | | -Example: |
15 | | - |
16 | | - ./migrate --init --driver=pgsql --database=php_migration_test --host=localhost --login=my_login --password=my_password --changelog=changelog |
17 | | - |
18 | | -wich will create the following directories/files |
19 | | - |
20 | | - ./environments |
21 | | - |----development.ini |
22 | | - |----preproduction.ini |
23 | | - `----production.ini |
24 | | - |
25 | | - ./migrations |
26 | | - |
27 | | -just edit/change the environment ini files in order to match with your database access. |
| 9 | +Initialization |
| 10 | +-------------- |
| 11 | + |
28 | 12 |
|
29 | 13 | Usage |
30 | 14 | ----- |
31 | | - |
32 | | - Usage: ./migrate command [parameters] [--env=<environment>] |
33 | | - |
34 | | - Commands: |
35 | | - --env=<environment> Environment to configure. Default environment is 'dev'. |
36 | | - --generate <description> Creates a new migration with the provided description. |
37 | | - --up Run unapplied migrations, ALL by default. |
38 | | - --up=<version> Run unapplied migrations up to version (included). |
39 | | - --down Undoes migrations applied to the database. ONE by default. |
40 | | - --down=<version> Undoes migrations applied to the database. Down to version (included). |
41 | | - --force Run or undoes only specified migration (not recommended). |
42 | | - --transactional Rollback all applied migration up or down on error. |
43 | | - --status Show migrations status (applied, unapplied ect...). |
44 | | - |
45 | | - Examples: |
46 | | - ./migrate [--generate <migration_name>] |
47 | | - ./migrate [--up | --up=<version> | --down | --down=<version>] [--transactional] [--force] [--env=<environment>] |
48 | | - ./migrate [--status] [--env=<environment>] |
0 commit comments