buzzingpixel / corbomite-migrations
Corbomite migrations
Requires
- php: >=7.2
- buzzingpixel/corbomite-cli: ^1.0.3
- buzzingpixel/corbomite-di: ^1.0
- robmorgan/phinx: ^0.10.6
Requires (Dev)
- codedungeon/phpunit-result-printer: ^0.26.1
- phpmd/phpmd: ^2.6
- phpunit/phpunit: ^8.0
- roave/security-advisories: dev-master
- squizlabs/php_codesniffer: ^3.4
- vlucas/phpdotenv: ^2.5
This package is auto-updated.
Last update: 2024-11-29 05:33:54 UTC
README
Part of BuzzingPixel's Corbomite project.
Provides a light wrapper around Phinx to make it available to Corbomite.
Usage
APP_BASE_PATH constant
You can define APP_BASE_PATH
as a constant to give Corbomite DB knowledge about the app's base path, otherwise Crobomite DB will try to figure it out automatically.
Environment variables
Required environment variables
DB_DATABASE
DB_USER
DB_PASSWORD
Optional environment variables
PHINX_MIGRATION_TABLE
(default:migrations
)PHINX_ADAPTER
(default:mysql
)DB_HOST
(default:localhost
)DB_PORT
(default:3306
)DB_CHARSET
(default:utf8mb4
)DB_COLLATION
(default:utf8mb4_general_ci
)PHINX_VERSION_ORDER
(default:creation
)
CLI commands
Once you've composer required into your Corbomite project, there will be some new commands available on the command line.
migrate/create-sample-config
Creates a phinx.php
config file with sample values at the root of your project.
migrate/create
Creates a migration file in the directory specified in your phinx.php
config file.
You can also provide an argument to name the migration and skip the question asking what the name of the migration should be.
migrate/status
Shows the status of migrations.
migrate/up
Runs any migrations that have not yet been run.
migrate/down
Rolls back the previous migration or to the specified target.
seed/create
Creates a seeder class.
You can also provide an argument to name the seeder class and skip the question asking what the name of the seeder should be.
seed/run
Runs seeders. If no argument is provided, all seeders will be run. Provide the class name to run a single seeder
License
Copyright 2019 BuzzingPixel, LLC
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.