migration / app
There is no license information available for the latest version (v1.0.1) of this package.
Simple Migration Application
v1.0.1
2022-04-06 11:44 UTC
Requires
- ext-pdo: *
- vlucas/phpdotenv: ^5.4
Requires (Dev)
- roave/security-advisories: dev-latest
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
An application for MySQL that can create database tables with the help of console in simple applications.
Installion
composer require migration/app
Create migrate.php file.
Paste the following codes into the migrate file.
#!usr/bin/php <?php use SimpleMigration\Application; use SimpleMigration\Database\Connection; require __DIR__ . '/vendor/autoload.php'; $database = require __DIR__ . '/Database/database.php'; $connection = new Connection($database); $app = new Application($connection, $argv); $app->run();
Edit the database.php file according to your mysql database.
<?php return [ 'connection' => 'mysql', 'host' => 'localhost', 'database' => 'migration_exam', 'user' => 'root', 'password' => 'root', 'port' => 3306, ];
Command descriptions
| Command | Description |
|---|---|
php migrate |
Sends all migrations to the database. |
php migrate create <migration name> |
Create a migration file. |
php migrate down |
Deletes inserted databases |
Screenshots
php migrate
php migrate create
php migrate down