shankarbala33/php_migration 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

shankarbala33/php_migration

Composer 安装命令:

composer require shankarbala33/php_migration

包简介

Collection of PHP Snippets

README 文档

README

Simple PHP package for Database Migration, with zero dependancy.

Packagist Release Wordpresss License

For Wordpress Migration

include_once('/wordpress/migration.php');

$my_table_schema =  [
          'student_meta' => [
             'id' => [                  // Result : "id int(20) auto_increment primary key"
                 'key' => [
                     'auto_increment',
                     'primary key'
                 ],
                 'type' => 'int',
                 'limit' => 20
             ],
             'name' => [                // Result : "name varchar(255) unique key"
                 'key' => [
                     'unique key'
                 ],
                 'type' => 'varchar',
                 'limit' => 255
             ],
             'value' => [               // Result : "value longtext"
                 'key' => [],
                 'type' => 'longtext',
                 'limit' => ''
             ],
              '__table_property' => [    // For Table Properties.
                'ENGINE' => 'InnoDB'
            ]
           ]
          ];

For Core PHP

  $my_table_schema = [
        'student' => [
            'student_id' => 'integer',
            'name' => 'string',
            'class' => 'string',
            'dob'  => 'data',
            'age' => 'integer'
        ],
        'class' => [
            'class_id' => 'integer',
            'student_id' => 'integer',
            'section' => 'string'
        ]
     ];

Finally

$table_schema = "YOUR_TABLE_SCHEMA" ($my_table_schema)

// Trigger Migration.
ST_DATABASE::migrate($table_schema);     // It's Generate Formatted MySQL Query and Execute.

It will creates the table Student and Class with given properties.

License

MIT License © Shankar Thiyagaraajan

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-06-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固