Skip to content

atakansn/simple-migration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Migration Example

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

Migrate

php migrate create

Create

php migrate down

Down

Displays a warning if the migration name is left break.

Empty

About

Simple database application for mysql

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages