migration / app
Simple Migration Application
Installs: 12
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:simple
Requires
- ext-pdo: *
- vlucas/phpdotenv: ^5.4
Requires (Dev)
- roave/security-advisories: dev-latest
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