承接 fabiopaiva/pdo-simple-migration 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

fabiopaiva/pdo-simple-migration

Composer 安装命令:

composer require fabiopaiva/pdo-simple-migration

包简介

Database version control using PDO connection

README 文档

README

Simple migration is a minimalist tool to manage your database versioning.

Installation

composer require fabiopaiva/pdo-simple-migration

Installation

Configuration

This library tries to find a file called config.php in working directory with PDO setup, if file doesn't exist, you can send PDO parameters in command line.

config.php (optional)

<?php
    return [
        'db' => [
            'dsn' => 'mysql:host=localhost;dbname=myDb;port=3306;charset=UTF8',
            'username' => 'root',
            'password' => 'pass',
        ],
        'table' => 'migrations',
        'dir' => 'migrations'
    ];

table is the name of database table to control your versioning, migrations is default.

dir is the path where you want to store you migrations file.

Usage

Status

List current status of your migrations

vendor/bin/migration status

Status

Generate

Generate a empty migration

vendor/bin/migration generate

Generate

Generated code example

<?php

namespace PDOSimpleMigration\Migrations;

use PDOSimpleMigration\Library\AbstractMigration;

class Version20160128130854 extends AbstractMigration
{
    public static $description = "Migration description";

    public function up()
    {
        //$this->addSql(/*Sql instruction*/);
    }

    public function down()
    {
        //$this->addSql(/*Sql instruction*/);
    }
}

Migrate

Migrate to latest version

vendor/bin/migration migrate

Migrate

Execute

Execute specific migration version (up or down)

vendor/bin/migration execute version --up --down

Execute

Options

--dump

If --dump parameter is present, migration will only dump query in screen

--dsn and --username

If you don't want to create config.php file, you can send --dsn setup parameter. If you send --dsn parameter, you need to send --username parameter too. The prompt will ask your database password.

--dir

Directory where to save migrations classes, default migrations

--table

Table where to store migrations versioning history, default migrations

Issues

Please report issues to Github Issue Tracker

统计信息

  • 总下载量: 172
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-01-29

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固