-
Install the package:
composer require colibri-fw/migration
-
Create
migration
file in root folder of your project with the following contents:#!/usr/bin/env php <?php require_once './vendor/autoload.php'; use Colibri\Config\Config; Config::setBaseDir(__DIR__ . '/configs'); // <-- path to configs folder in your project require './vendor/colibri-fw/migration/bin/migration';
and change configs folder to yours one.
-
Make it executable:
chmod +x ./migration
-
In your configs folder create
database.php
file to configure your connection<?php use Colibri\Database\Type as DbType; return [ 'connection' => [ 'default' => 'mysql', 'mysql' => [ 'type' => DbType::MYSQL, 'host' => 'localhost', 'database' => 'database_name', 'user' => 'user', 'password' => 'password', 'persistent' => false, ], ], ];
-
In your configs folder create
migration.php
file to configure migrations:<?php return [ /** * Name of the table where to store executed migrations. */ 'table' => 'migration', /** * Folder where all migration classes lives. */ 'folder' => __DIR__ . '/../App/Migration', // <-- Change to yours one /** * Namespace where all migration classes lives. */ 'namespace' => 'App\Migration', // <-- Change to yours one ];
-
Notifications
You must be signed in to change notification settings - Fork 0
[READ ONLY] PHP Colibri :: Migration component.
Colibri-FW/migration
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
[READ ONLY] PHP Colibri :: Migration component.
Topics
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published