init: 项目初始代码

This commit is contained in:
2026-10-14 14:00:29 +08:00
commit cc434cf89f
464 changed files with 66984 additions and 0 deletions

View File

@@ -0,0 +1,52 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
use think\migration\Migrator;
use think\migration\db\Column;
class AdminCreate extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('admin',['engine'=>'InnoDB','auto_increment'=>true,'charset'=>'utf8','primary_key'=>'id','comment'=>'管理员表'])->addIndex('id');
$table
->addColumn('mobile','string',['limit'=>11,'default'=>'','null'=>false,'comment'=>'手机号'])
->addColumn('code','string',['limit'=>10,'default'=>'','null'=>false,'comment'=>'业务员编码'])
->addColumn('role_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'角色ID'])
->addColumn('org_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'组织ID'])
->addColumn('dept_group_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'部门分组ID'])
->addColumn('dept_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'部门ID'])
->addColumn('avatar','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'头像'])
->addColumn('nickname','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'昵称'])
->addColumn('username','string',['limit'=>32,'default'=>'','null'=>false,'comment'=>'用户名'])
->addColumn('password','string',['limit'=>32,'default'=>'','null'=>false,'comment'=>'密码'])
->addColumn('create_ip','string',['limit'=>15,'default'=>'0.0.0.0','null'=>false,'comment'=>'注册IP'])
->addColumn('last_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'最后登录时间'])
->addColumn('last_ip','string',['limit'=>15,'default'=>'0.0.0.0','null'=>false,'comment'=>'最后登录IP'])
->addColumn('status','integer',['limit'=> MysqlAdapter::INT_TINY,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'状态,0=正常,1=禁用'])
->addColumn('create_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'创建时间'])
->addColumn('update_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'更新时间'])
->create();
}
}

View File

@@ -0,0 +1,39 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
class RoleCreate extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('role',['engine'=>'InnoDB','auto_increment'=>true,'charset'=>'utf8','primary_key'=>'id','comment'=>'角色表'])->addIndex('id');
$table
->addColumn('name','string',['limit'=>32,'default'=>'','null'=>false,'comment'=>'角色名称'])
->addColumn('desc','string',['limit'=>255,'default'=>'','null'=>false,'comment'=>'描述'])
->addColumn('create_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'创建时间'])
->addColumn('update_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'更新时间'])
->create();
}
}

View File

@@ -0,0 +1,45 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
use think\migration\Migrator;
use think\migration\db\Column;
class MenuCreate extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
// $table = $this->table('menu',['engine'=>'InnoDB','auto_increment'=>true,'charset'=>'utf8','primary_key'=>'id','comment'=>'菜单表'])->addIndex('id');
// $table
// ->addColumn('platform_id','integer',['limit'=>10,'default'=>0,'null'=>false,'comment'=>'平台ID'])
// ->addColumn('name','string',['limit'=>32,'default'=>'','null'=>false,'comment'=>'菜单名称'])
// ->addColumn('action','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'菜单规则'])
// ->addColumn('icon','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'图标'])
// ->addColumn('pid','integer',['limit'=> MysqlAdapter::INT_SMALL,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'父ID'])
// ->addColumn('sort','integer',['limit'=> MysqlAdapter::INT_TINY,'signed'=>false,'default'=>255,'null'=>false,'comment'=>'排序'])
// ->addColumn('is_show','integer',['limit'=> MysqlAdapter::INT_TINY,'signed'=>false,'default'=>1,'null'=>false,'comment'=>'是否显示,0=隐藏,1=显示'])
// ->addColumn('create_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'创建时间'])
// ->addColumn('update_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'更新时间'])
// ->create();
}
}

View File

@@ -0,0 +1,42 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
use think\migration\Migrator;
use think\migration\db\Column;
class RoleToMenuCreate extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
// $table = $this->table('role_to_menu',['engine'=>'InnoDB','auto_increment'=>true,'charset'=>'utf8','primary_key'=>'id','comment'=>'角色菜单表'])->addIndex('id');
// $table
// ->addColumn('platform_id','integer',['limit'=>10,'default'=>0,'null'=>false,'comment'=>'平台ID'])
// ->addColumn('role_id','integer',['limit'=> MysqlAdapter::INT_SMALL,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'角色ID'])
// ->addColumn('menu_id','integer',['limit'=> MysqlAdapter::INT_SMALL,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'菜单ID'])
// ->addColumn('create_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'创建时间'])
// ->addColumn('update_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'更新时间'])
// ->addIndex(['role_id','menu_id'],['unique'=>true])
// ->create();
}
}

View File

@@ -0,0 +1,40 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
use think\migration\Migrator;
use think\migration\db\Column;
class MenuModify extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
// $table = $this->table('menu');
// $table
// ->addColumn('path','string',['limit'=>64,'after'=>'icon','default'=>'','null'=>false,'comment'=>'菜单路径'])
// ->addColumn('component','string',['limit'=>128,'default'=>'','after'=>'path','null'=>false,'comment'=>'操作,如:/api/info'])
// ->addColumn('redirect','string',['limit'=>128,'default'=>'','after'=>'component','null'=>false,'comment'=>'跳转'])
// ->addColumn('is_menu','integer',['limit'=> MysqlAdapter::INT_SMALL,'after'=>'redirect','signed'=>false,'default'=>0,'null'=>false,'comment'=>'是否为菜单,0=否,1=是'])
// ->update();
}
}

View File

@@ -0,0 +1,46 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
use think\migration\Migrator;
use think\migration\db\Column;
class GoodsCategoryCreate extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('goods_category',['engine'=>'InnoDB','auto_increment'=>true,'charset'=>'utf8','primary_key'=>'id','comment'=>'商品分类表'])->addIndex('id');
$table
->addColumn('platform_id','integer',['limit'=>10,'default'=>0,'null'=>false,'comment'=>'平台ID'])
->addColumn('language_id','integer',['limit'=>MysqlAdapter::INT_TINY,'default'=>0,'null'=>false,'comment'=>'语言包ID'])
->addColumn('name','string',['limit'=>50,'default'=>'','null'=>false,'comment'=>'分类名'])
->addColumn('desc','string',['limit'=>50,'default'=>'','null'=>false,'comment'=>'描述'])
->addColumn('pid','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'父ID'])
->addColumn('icon','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'电脑端分类图标'])
->addColumn('sort','integer',['limit'=> MysqlAdapter::INT_TINY,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'排序'])
->addColumn('status','integer',['limit'=> MysqlAdapter::INT_TINY,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'状态,0=禁用,1=启用'])
->addColumn('create_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'创建时间'])
->addColumn('update_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'更新时间'])
->create();
}
}

View File

@@ -0,0 +1,46 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
use think\migration\Migrator;
use think\migration\db\Column;
class LanguageCreate extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('language',['engine'=>'InnoDB','auto_increment'=>true,'charset'=>'utf8','primary_key'=>'id','comment'=>'语言包表'])->addIndex('id');
$table
->addColumn('platform_id','integer',['limit'=>10,'default'=>0,'null'=>false,'comment'=>'平台ID'])
->addColumn('name','string',['limit'=>50,'default'=>'','null'=>false,'comment'=>'语言包名'])
->addColumn('code','string',['limit'=>20,'default'=>'','null'=>false,'comment'=>'标识'])
->addColumn('icon','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'图标'])
->addColumn('locale','string',['limit'=>50,'default'=>'','null'=>false,'comment'=>'作用范围'])
->addColumn('coin','string',['limit'=>50,'default'=>'','null'=>false,'comment'=>'货币'])
->addColumn('sort','integer',['limit'=>MysqlAdapter::INT_TINY,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'排序'])
->addColumn('status','integer',['limit'=>MysqlAdapter::INT_TINY,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'状态,0=正常,1=禁用'])
->addColumn('create_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'创建时间'])
->addColumn('update_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'更新时间'])
->create();
}
}

View File

@@ -0,0 +1,51 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
use think\migration\Migrator;
use think\migration\db\Column;
class GoodsCreate extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('goods',['engine'=>'InnoDB','auto_increment'=>true,'charset'=>'utf8','primary_key'=>'id','comment'=>'商品表'])->addIndex('id');
$table
->addColumn('platform_id','integer',['limit'=>10,'default'=>0,'null'=>false,'comment'=>'平台ID'])
->addColumn('language_id','integer',['limit'=>MysqlAdapter::INT_TINY,'default'=>0,'null'=>false,'comment'=>'语言包ID'])
->addColumn('name','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'产品标题'])
->addColumn('model_number','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'产品型号'])
->addColumn('goods_category_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'商品分类ID'])
->addColumn('price','decimal',['scale'=>2,'precision'=>10,'signed'=>false,'default'=>0.00,'null'=>false,'comment'=>'商品价格'])
->addColumn('details','text',['comment'=>'商品详情'])
->addColumn('params','text',['comment'=>'商品参数'])
->addColumn('title','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'页面title'])
->addColumn('keywords','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'关键词'])
->addColumn('description','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'页面描述SEO用'])
->addColumn('sort','integer',['limit'=>MysqlAdapter::INT_TINY,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'排序'])
->addColumn('status','integer',['limit'=>MysqlAdapter::INT_TINY,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'状态,0=正常,1=禁用'])
->addColumn('create_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'创建时间'])
->addColumn('update_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'更新时间'])
->create();
}
}

View File

@@ -0,0 +1,48 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
use think\migration\Migrator;
use think\migration\db\Column;
class NavMenuCreate extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('navigator',['engine'=>'InnoDB','auto_increment'=>true,'charset'=>'utf8','primary_key'=>'id','comment'=>'导航栏表'])->addIndex('id');
$table
->addColumn('platform_id','integer',['limit'=>10,'default'=>0,'null'=>false,'comment'=>'平台ID'])
->addColumn('language_id','integer',['limit'=>10,'default'=>0,'null'=>false,'comment'=>'语言包ID'])
->addColumn('pid','integer',['limit'=>10,'default'=>0,'null'=>false,'comment'=>'父ID'])
->addColumn('name','string',['limit'=>60,'default'=>'','null'=>false,'comment'=>'名称'])
->addColumn('desc','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'描述'])
->addColumn('icon','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'图标'])
->addColumn('link','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'链接'])
->addColumn('sort','integer',['limit'=>MysqlAdapter::INT_TINY,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'排序'])
->addColumn('status','integer',['limit'=>MysqlAdapter::INT_TINY,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'状态,0 启用 1 禁用'])
->addColumn('create_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'创建时间'])
->addColumn('update_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'更新时间'])
->create();
}
}

View File

@@ -0,0 +1,43 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
use think\migration\Migrator;
use think\migration\db\Column;
class PlatformCreate extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('platform',['engine'=>'InnoDB','auto_increment'=>true,'charset'=>'utf8','primary_key'=>'id','comment'=>'平台表'])->addIndex('id');
$table
->addColumn('name','string',['limit'=>60,'default'=>'','null'=>false,'comment'=>'名称'])
->addColumn('desc','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'描述'])
->addColumn('icon','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'图标'])
->addColumn('sort','integer',['limit'=>MysqlAdapter::INT_TINY,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'排序'])
->addColumn('status','integer',['limit'=>MysqlAdapter::INT_TINY,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'状态,0 启用 1 禁用'])
->addColumn('create_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'创建时间'])
->addColumn('update_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'更新时间'])
->create();
}
}

View File

@@ -0,0 +1,48 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
use think\migration\Migrator;
use think\migration\db\Column;
class QuestionCreate extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('question',['engine'=>'InnoDB','auto_increment'=>true,'charset'=>'utf8','primary_key'=>'id','comment'=>'用户反馈'])->addIndex('id');
$table
->addColumn('platform_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'平台ID'])
->addColumn('language_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'语言包ID'])
->addColumn('country_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'国家ID'])
->addColumn('name','string',['limit'=>40,'default'=>'','null'=>false,'comment'=>'姓名'])
->addColumn('email','string',['limit'=>60,'default'=>'','null'=>false,'comment'=>'邮箱'])
->addColumn('order_sn','string',['limit'=>50,'default'=>'','null'=>false,'comment'=>'描述'])
->addColumn('product_model','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'产品型号'])
->addColumn('os','string',['limit'=>50,'default'=>'','null'=>false,'comment'=>'操作系统'])
->addColumn('desc','text',['comment'=>'描述'])
->addColumn('sort','integer',['limit'=>MysqlAdapter::INT_TINY,'default'=>0,'null'=>false,'comment'=>'排序'])
->addColumn('create_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'创建时间'])
->addColumn('update_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'更新时间'])
->create();
}
}

View File

@@ -0,0 +1,43 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
class CountryCreate extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('country',['engine'=>'InnoDB','auto_increment'=>true,'charset'=>'utf8','primary_key'=>'id','comment'=>'国家表'])->addIndex('id');
$table
->addColumn('code','string',['limit'=>4,'default'=>'','null'=>false,'comment'=>'地区码'])
->addColumn('en','string',['limit'=>30,'default'=>'','null'=>false,'comment'=>'英文名'])
->addColumn('locale','string',['limit'=>10,'default'=>'','null'=>false,'comment'=>'缩写'])
->addColumn('zh','string',['limit'=>20,'default'=>'','null'=>false,'comment'=>'简体中文名'])
->addColumn('tw','string',['limit'=>20,'default'=>'','null'=>false,'comment'=>'繁体中文名'])
->addColumn('icon','string',['limit'=>60,'default'=>'','null'=>false,'comment'=>'国旗图标'])
->addColumn('create_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'创建时间'])
->addColumn('update_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'更新时间'])
->create();
}
}

View File

@@ -0,0 +1,46 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
use think\migration\Migrator;
use think\migration\db\Column;
class SoftManualCreate extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('soft_manual',['engine'=>'InnoDB','auto_increment'=>true,'charset'=>'utf8','primary_key'=>'id','comment'=>'软件帮助手册表'])->addIndex('id');
$table
->addColumn('platform_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'平台ID'])
->addColumn('language_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'语言包ID'])
->addColumn('file_type_id','integer',['limit'=>MysqlAdapter::INT_TINY,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'文件类型ID'])
->addColumn('name','string',['limit'=>40,'default'=>'','null'=>false,'comment'=>'名称'])
->addColumn('introduce','string',['limit'=>255,'default'=>'','null'=>false,'comment'=>'下载介绍'])
->addColumn('support','string',['limit'=>255,'default'=>'','null'=>false,'comment'=>'支持型号'])
->addColumn('os','string',['limit'=>60,'default'=>'','null'=>false,'comment'=>'操作系统'])
->addColumn('download_count','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'下载次数'])
->addColumn('create_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'创建时间'])
->addColumn('update_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'更新时间'])
->create();
}
}

View File

@@ -0,0 +1,47 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
use think\migration\Migrator;
use think\migration\db\Column;
class ArticleCreate extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('article',['engine'=>'InnoDB','auto_increment'=>true,'charset'=>'utf8','primary_key'=>'id','comment'=>'文章表'])->addIndex('id');
$table
->addColumn('platform_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'平台ID'])
->addColumn('language_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'语音包ID'])
->addColumn('title','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'文章标题'])
->addColumn('desc','string',['limit'=>255,'default'=>'','null'=>false,'comment'=>'文章描述'])
->addColumn('thumb','string',['limit'=>255,'default'=>'','null'=>false,'comment'=>'文章缩略图'])
->addColumn('url','string',['limit'=>255,'default'=>'','null'=>false,'comment'=>'链接'])
->addColumn('detail','string',['limit'=>255,'default'=>'','null'=>false,'comment'=>'详情'])
->addColumn('sort','integer',['limit'=>MysqlAdapter::INT_TINY,'default'=>0,'null'=>false,'comment'=>'排序'])
->addColumn('click_num','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'点击次数'])
->addColumn('create_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'创建时间'])
->addColumn('update_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'更新时间'])
->create();
}
}

View File

@@ -0,0 +1,46 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
class LogVisitCreate extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('log_visit',['engine'=>'innodb','auto_increment'=>true,'charset'=>'utf8','primary_key'=>'id','comment'=>'日志记录表'])->addIndex('id');
$table
->addColumn('platform_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'平台ID'])
->addColumn('admin_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'管理员ID'])
->addColumn('admin_name','string',['limit'=>255,'default'=>'','null'=>false,'comment'=>'管理员名称'])
->addColumn('url','string',['limit'=>255,'default'=>'','null'=>false,'comment'=>'请求的URL'])
->addColumn('params','text',['comment'=>'请求参数'])
->addColumn('controller','string',['limit'=>50,'default'=>'','null'=>false,'comment'=>'操作模块'])
->addColumn('action','string',['limit'=>50,'default'=>'','null'=>false,'comment'=>'操作方法'])
->addColumn('ip','string',['limit'=>15,'default'=>'','null'=>false,'comment'=>'访问IP'])
->addColumn('create_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'创建时间'])
->addColumn('update_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'更新时间'])
->addIndex(['controller','create_time'])
->create();
}
}

View File

@@ -0,0 +1,40 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
use think\migration\Migrator;
use think\migration\db\Column;
class GoodsImagesCreate extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('goods_images',['engine'=>'InnoDB','auto_increment'=>true,'charset'=>'utf8','primary_key'=>'id','comment'=>'商品主图表'])->addIndex('id');
$table
->addColumn('goods_id','integer',['limit'=>10,'default'=>0,'null'=>false,'comment'=>'商品ID'])
->addColumn('image','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'产品图片'])
->addColumn('create_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'创建时间'])
->addColumn('update_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'更新时间'])
->create();
}
}

View File

@@ -0,0 +1,41 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
use think\migration\Migrator;
use think\migration\db\Column;
class GoodsBuyNowCreate extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('goods_buy_now',['engine'=>'InnoDB','auto_increment'=>true,'charset'=>'utf8','primary_key'=>'id','comment'=>'商品链接表'])->addIndex('id');
$table
->addColumn('goods_id','integer',['limit'=>10,'default'=>0,'null'=>false,'comment'=>'商品ID'])
->addColumn('name','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'链接名称'])
->addColumn('url','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'链接地址'])
->addColumn('create_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'创建时间'])
->addColumn('update_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'更新时间'])
->create();
}
}

View File

@@ -0,0 +1,41 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
use think\migration\Migrator;
use think\migration\db\Column;
class GoodsConnectCreate extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('goods_connect',['engine'=>'InnoDB','auto_increment'=>true,'charset'=>'utf8','primary_key'=>'id','comment'=>'商品相关表'])->addIndex('id');
$table
->addColumn('goods_id','integer',['limit'=>10,'default'=>0,'null'=>false,'comment'=>'商品ID'])
->addColumn('goods_category_id','integer',['limit'=>10,'default'=>0,'null'=>false,'comment'=>'商品分类ID'])
->addColumn('connect_good_id','integer',['limit'=>10,'default'=>0,'null'=>false,'comment'=>'关联商品ID'])
->addColumn('create_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'创建时间'])
->addColumn('update_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'更新时间'])
->create();
}
}

View File

@@ -0,0 +1,46 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
use think\migration\Migrator;
use think\migration\db\Column;
class BulkBuyCreate extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('bulk_buy',['engine'=>'InnoDB','auto_increment'=>true,'charset'=>'utf8','primary_key'=>'id','comment'=>'大量采购表'])->addIndex('id');
$table
->addColumn('platform_id','integer',['limit'=>10,'default'=>0,'null'=>false,'comment'=>'平台ID'])
->addColumn('language_id','integer',['limit'=>MysqlAdapter::INT_TINY,'default'=>0,'null'=>false,'comment'=>'语言包ID'])
->addColumn('name','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'产品标题'])
->addColumn('mode_number','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'产品型号'])
->addColumn('email','string',['limit'=>60,'default'=>'','null'=>false,'comment'=>'邮箱'])
->addColumn('arrival_country','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'收货地址'])
->addColumn('sort','integer',['limit'=>MysqlAdapter::INT_TINY,'default'=>0,'null'=>false,'comment'=>'排序'])
->addColumn('delivery_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'交货日期'])
->addColumn('create_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'创建时间'])
->addColumn('update_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'更新时间'])
->create();
}
}

View File

@@ -0,0 +1,44 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
use think\migration\Migrator;
use think\migration\db\Column;
class FileTypeCreate extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('file_type',['engine'=>'InnoDB','auto_increment'=>true,'charset'=>'utf8','primary_key'=>'id','comment'=>'文件类型'])->addIndex('id');
$table
->addColumn('platform_id','integer',['limit'=>10,'default'=>0,'null'=>false,'comment'=>'平台ID'])
->addColumn('language_id','integer',['limit'=>MysqlAdapter::INT_TINY,'default'=>0,'null'=>false,'comment'=>'语言包ID'])
->addColumn('name','string',['limit'=>32,'default'=>'','null'=>false,'comment'=>'分类名称'])
->addColumn('desc','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'分类描述'])
->addColumn('icon','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'分类图标'])
->addColumn('sort','integer',['limit'=>MysqlAdapter::INT_TINY,'default'=>0,'null'=>false,'comment'=>'排序'])
->addColumn('create_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'创建时间'])
->addColumn('update_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'更新时间'])
->create();
}
}

View File

@@ -0,0 +1,46 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
use think\migration\Migrator;
use think\migration\db\Column;
class CommentCreate extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('comment',['engine'=>'InnoDB','auto_increment'=>true,'charset'=>'utf8','primary_key'=>'id','comment'=>'客户评价表'])->addIndex('id');
$table
->addColumn('platform_id','integer',['limit'=>10,'default'=>0,'null'=>false,'comment'=>'平台ID'])
->addColumn('language_id','integer',['limit'=>MysqlAdapter::INT_TINY,'default'=>0,'null'=>false,'comment'=>'语言包ID'])
->addColumn('avatar','string',['limit'=>32,'default'=>'','null'=>false,'comment'=>'头像'])
->addColumn('name','string',['limit'=>32,'default'=>'','null'=>false,'comment'=>'分类名称'])
->addColumn('nickname','string',['limit'=>50,'default'=>'','null'=>false,'comment'=>'客户昵称'])
->addColumn('comment','text',['comment'=>'评论'])
->addColumn('url','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'产品链接'])
->addColumn('sort','integer',['limit'=>MysqlAdapter::INT_TINY,'default'=>0,'null'=>false,'comment'=>'排序'])
->addColumn('create_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'创建时间'])
->addColumn('update_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'更新时间'])
->create();
}
}

View File

@@ -0,0 +1,40 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
use think\migration\Migrator;
use think\migration\db\Column;
class CommentImageCreate extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('comment_image',['engine'=>'InnoDB','auto_increment'=>true,'charset'=>'utf8','primary_key'=>'id','comment'=>'客户评价图片表'])->addIndex('id');
$table
->addColumn('comment_id','integer',['limit'=>10,'default'=>0,'null'=>false,'comment'=>'评论ID'])
->addColumn('image','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'图片'])
->addColumn('create_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'创建时间'])
->addColumn('update_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'更新时间'])
->create();
}
}

View File

@@ -0,0 +1,41 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
use think\migration\Migrator;
use think\migration\db\Column;
class GoodsSoftManualCreate extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('goods_soft_manual',['engine'=>'InnoDB','auto_increment'=>true,'charset'=>'utf8','primary_key'=>'id','comment'=>'商品手册驱动表'])->addIndex('id');
$table
->addColumn('goods_id','integer',['limit'=>10,'default'=>0,'null'=>false,'comment'=>'文件类型ID'])
->addColumn('file_type_id','integer',['limit'=>10,'default'=>0,'null'=>false,'comment'=>'文件类型ID'])
->addColumn('soft_manual_id','integer',['limit'=>10,'default'=>0,'null'=>false,'comment'=>'文档驱动ID'])
->addColumn('create_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'创建时间'])
->addColumn('update_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'更新时间'])
->create();
}
}

View File

@@ -0,0 +1,36 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
class AdminAddField extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('admin');
$table
->addColumn('platform_id','integer',['limit'=>10,'after'=>'id','default'=>0,'null'=>false,'comment'=>'平台ID'])
->update();
}
}

View File

@@ -0,0 +1,39 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
class QuestionAttachment extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('question_attachment',['engine'=>'InnoDB','auto_increment'=>true,'charset'=>'utf8','primary_key'=>'id','comment'=>'用户反馈附件表'])->addIndex('id');
$table
->addColumn('question_id','integer',['limit'=>10,'default'=>0,'null'=>false,'comment'=>'反馈ID'])
->addColumn('attach','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'附件'])
->addColumn('create_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'创建时间'])
->addColumn('update_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'更新时间'])
->create();
}
}

View File

@@ -0,0 +1,50 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
use think\migration\Migrator;
use think\migration\db\Column;
class AdvertisementCreate extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('advertisement',['engine'=>'InnoDB','auto_increment'=>true,'charset'=>'utf8','primary_key'=>'id','comment'=>'广告表'])->addIndex('id');
$table
->addColumn('platform_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'平台ID'])
->addColumn('language_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'语言包ID'])
->addColumn('advertise_space_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'广告位ID'])
->addColumn('advertise_space_name','string',['limit'=>30,'signed'=>false,'default'=>'','null'=>false,'comment'=>'广告位名称'])
->addColumn('ad_name','string',['limit'=>40,'default'=>'','null'=>false,'comment'=>'名称'])
->addColumn('image','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'广告图'])
->addColumn('url','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'广告图链接'])
->addColumn('start_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'开始时间'])
->addColumn('stop_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'结束时间'])
->addColumn('play_order','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'轮播顺序'])
->addColumn('sort','integer',['limit'=>MysqlAdapter::INT_TINY,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'排序'])
->addColumn('status','integer',['limit'=>MysqlAdapter::INT_TINY,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'状态,0=可用,1=禁用'])
->addColumn('create_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'创建时间'])
->addColumn('update_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'更新时间'])
->create();
}
}

View File

@@ -0,0 +1,46 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
use think\migration\Migrator;
use think\migration\db\Column;
class AdvertiseSpaceCreate extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('advertise_space',['engine'=>'InnoDB','auto_increment'=>true,'charset'=>'utf8','primary_key'=>'id','comment'=>'广告位表'])->addIndex('id');
$table
->addColumn('platform_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'平台ID'])
->addColumn('language_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'语言包ID'])
->addColumn('advertise_page_id','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'广告页面ID'])
->addColumn('name','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'广告位名称'])
->addColumn('max_num','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'数量上限'])
->addColumn('width','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'宽,单位像素'])
->addColumn('height','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'长,单位像素'])
->addColumn('sort','integer',['limit'=>MysqlAdapter::INT_TINY,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'排序'])
->addColumn('create_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'创建时间'])
->addColumn('update_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'更新时间'])
->create();
}
}

View File

@@ -0,0 +1,43 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
use think\migration\Migrator;
use think\migration\db\Column;
class AdvertisePageCreate extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('advertise_page',['engine'=>'InnoDB','auto_increment'=>true,'charset'=>'utf8','primary_key'=>'id','comment'=>'广告所属页表'])->addIndex('id');
$table
->addColumn('platform_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'平台ID'])
->addColumn('language_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'语言包ID'])
->addColumn('name','string',['limit'=>30,'default'=>'','null'=>false,'comment'=>'页面名称'])
->addColumn('sort','integer',['limit'=>MysqlAdapter::INT_TINY,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'排序'])
->addColumn('create_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'创建时间'])
->addColumn('update_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'更新时间'])
->create();
}
}

View File

@@ -0,0 +1,43 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
use think\migration\Migrator;
use think\migration\db\Column;
class GoodsCouponCreate extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('goods_coupon',['engine'=>'InnoDB','auto_increment'=>true,'charset'=>'utf8','primary_key'=>'id','comment'=>'优惠券表'])->addIndex('id');
$table
->addColumn('platform_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'平台ID'])
->addColumn('language_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'语言包ID'])
->addColumn('old_code','string',['limit'=>30,'default'=>'','null'=>false,'comment'=>'旧口令'])
->addColumn('new_code','string',['limit'=>30,'default'=>'','null'=>false,'comment'=>'新口令'])
->addColumn('create_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'创建时间'])
->addColumn('update_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'更新时间'])
->create();
}
}

View File

@@ -0,0 +1,38 @@
<?php
use think\migration\Migrator;
class PlatformAddField extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('platform');
$table
->addColumn('vi_color1','string',['limit'=>10,'after'=>'name','default'=>'','null'=>false,'comment'=>'品牌vi色1'])
->addColumn('vi_color2','string',['limit'=>10,'after'=>'vi_color1','default'=>'','null'=>false,'comment'=>'品牌vi色2'])
->addColumn('vi_color3','string',['limit'=>10,'after'=>'vi_color2','default'=>'','null'=>false,'comment'=>'品牌vi色3'])
->addColumn('language_id','integer',['limit'=>10,'after'=>'vi_color3','signed'=>false,'default'=>0,'null'=>false,'comment'=>'语言ID'])
->addColumn('currency_id','integer',['limit'=>10,'after'=>'language_id','signed'=>false,'default'=>0,'null'=>false,'comment'=>'币种ID'])
->update();
}
}

View File

@@ -0,0 +1,42 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
use think\migration\Migrator;
use think\migration\db\Column;
class CurrencyCreate extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('currency',['engine'=>'InnoDB','auto_increment'=>true,'charset'=>'utf8','primary_key'=>'id','comment'=>'币种表'])->addIndex('id');
$table
->addColumn('name','string',['limit'=>50,'default'=>'','null'=>false,'comment'=>'货币名称'])
->addColumn('code','string',['limit'=>20,'default'=>'','null'=>false,'comment'=>'英文缩写'])
->addColumn('signal','string',['limit'=>20,'default'=>'','null'=>false,'comment'=>'符号'])
->addColumn('status','integer',['limit'=>MysqlAdapter::INT_TINY,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'状态,0=正常,1=禁用'])
->addColumn('create_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'创建时间'])
->addColumn('update_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'更新时间'])
->create();
}
}

View File

@@ -0,0 +1,38 @@
<?php
use think\migration\Migrator;
class PlatformLanguageCreate extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('platform_language',['engine'=>'InnoDB','auto_increment'=>true,'charset'=>'utf8','primary_key'=>'id','comment'=>'平台语言表'])->addIndex('id');
$table
->addColumn('platform_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'平台ID'])
->addColumn('language_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'语言ID'])
->addColumn('create_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'创建时间'])
->addColumn('update_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'更新时间'])
->create();
}
}

View File

@@ -0,0 +1,39 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
class MenuLanguageCreate extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
// $table = $this->table('menu_language',['engine'=>'InnoDB','auto_increment'=>true,'charset'=>'utf8','primary_key'=>'id','comment'=>'菜单语言表'])->addIndex('id');
// $table
// ->addColumn('menu_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'菜单ID'])
// ->addColumn('language_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'语言ID'])
// ->addColumn('create_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'创建时间'])
// ->addColumn('update_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'更新时间'])
// ->create();
}
}

View File

@@ -0,0 +1,39 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
class PlatformCoinCreate extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('platform_coin',['engine'=>'InnoDB','auto_increment'=>true,'charset'=>'utf8','primary_key'=>'id','comment'=>'平台币种表'])->addIndex('id');
$table
->addColumn('platform_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'平台ID'])
->addColumn('currency_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'币种ID'])
->addColumn('create_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'创建时间'])
->addColumn('update_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'更新时间'])
->create();
}
}

View File

@@ -0,0 +1,39 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
class PlatformMenuCreate extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
// $table = $this->table('platform_menu',['engine'=>'InnoDB','auto_increment'=>true,'charset'=>'utf8','primary_key'=>'id','comment'=>'平台菜单表'])->addIndex('id');
// $table
// ->addColumn('platform_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'语言ID'])
// ->addColumn('menu_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'菜单ID'])
// ->addColumn('create_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'创建时间'])
// ->addColumn('update_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'更新时间'])
// ->create();
}
}

View File

@@ -0,0 +1,43 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
use think\migration\Migrator;
use think\migration\db\Column;
class SiteCreate extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('site',['engine'=>'InnoDB','auto_increment'=>true,'charset'=>'utf8','primary_key'=>'id','comment'=>'站点表'])->addIndex('id');
$table
->addColumn('platform_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'所属品牌ID'])
->addColumn('language_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'语言包ID'])
->addColumn('currency_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'币种ID'])
->addColumn('domain','string',['limit'=>50,'default'=>'','null'=>false,'comment'=>'域名'])
->addColumn('status','integer',['limit'=>MysqlAdapter::INT_TINY,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'状态,0=正常,1=禁用'])
->addColumn('create_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'创建时间'])
->addColumn('update_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'更新时间'])
->create();
}
}

View File

@@ -0,0 +1,40 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
class SiteMenuCreate extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
// $table = $this->table('site_menu',['engine'=>'InnoDB','auto_increment'=>true,'charset'=>'utf8','primary_key'=>'id','comment'=>'站点栏目表'])->addIndex('id');
// $table
// ->addColumn('site_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'语言ID'])
// ->addColumn('menu_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'菜单ID'])
// ->addColumn('create_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'创建时间'])
// ->addColumn('update_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'更新时间'])
// ->create();
}
}

View File

@@ -0,0 +1,33 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
class DropPlatformMenuCreate extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
// $this->table('platform_menu')->drop();
}
}

View File

@@ -0,0 +1,36 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
class SiteMenuChange extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
// $table = $this->table('site_menu');
// $table
// ->renameColumn('menu_id','navigator_id')
// ->update();
}
}

View File

@@ -0,0 +1,41 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
use think\migration\Migrator;
use think\migration\db\Column;
class MenuPlatformCreate extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
// $table = $this->table('menu_platform',['engine'=>'InnoDB','auto_increment'=>true,'charset'=>'utf8','primary_key'=>'id','comment'=>'站点栏目表'])->addIndex('id');
// $table
// ->addColumn('menu_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'菜单ID'])
// ->addColumn('platform_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'品牌ID'])
// ->addColumn('status','integer',['limit'=>MysqlAdapter::INT_TINY,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'状态,0=正常,1=禁用'])
// ->addColumn('create_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'创建时间'])
// ->addColumn('update_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'更新时间'])
// ->create();
}
}

View File

@@ -0,0 +1,36 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
class MenuChangeFieldIsShowToStatus extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
// $table = $this->table('menu');
// $table
// ->renameColumn('is_show','status')
// ->update();
}
}

View File

@@ -0,0 +1,40 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
class SoftManualAddField extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('soft_manual');
$table
->addColumn('file_name','string',['limit'=>60,'after'=>'introduce','default'=>'','null'=>false,'comment'=>'下载名称'])
->addColumn('url','string',['limit'=>128,'after'=>'file_name','default'=>'','null'=>false,'comment'=>'下载链接'])
->addColumn('btn_tips','string',['limit'=>50,'after'=>'file_name','default'=>'','null'=>false,'comment'=>'下载提示语'])
->changeColumn('introduce','string',['limit'=>500,'default'=>'','null'=>false,'comment'=>'下载介绍'])
->update();
}
}

View File

@@ -0,0 +1,45 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
use think\migration\Migrator;
use think\migration\db\Column;
class FaqCreate extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('faq',['engine'=>'InnoDB','auto_increment'=>true,'charset'=>'utf8','primary_key'=>'id','comment'=>'常见问题表'])->addIndex('id');
$table
->addColumn('platform_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'所属品牌ID'])
->addColumn('language_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'语言包ID'])
->addColumn('faq_type_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'常见问题分类ID'])
->addColumn('question','string',['limit'=>150,'default'=>'','null'=>false,'comment'=>'问题内容'])
->addColumn('answer','text',['comment'=>'回答内容'])
->addColumn('sort','integer',['limit'=>MysqlAdapter::INT_TINY,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'排序'])
->addColumn('status','integer',['limit'=>MysqlAdapter::INT_TINY,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'状态,0=正常,1=禁用'])
->addColumn('create_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'创建时间'])
->addColumn('update_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'更新时间'])
->create();
}
}

View File

@@ -0,0 +1,44 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
use think\migration\Migrator;
use think\migration\db\Column;
class FaqTypeCreate extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('faq_type',['engine'=>'InnoDB','auto_increment'=>true,'charset'=>'utf8','primary_key'=>'id','comment'=>'常见问题分类表'])->addIndex('id');
$table
->addColumn('platform_id','integer',['limit'=>10,'default'=>0,'null'=>false,'comment'=>'平台ID'])
->addColumn('language_id','integer',['limit'=>MysqlAdapter::INT_TINY,'default'=>0,'null'=>false,'comment'=>'语言包ID'])
->addColumn('name','string',['limit'=>32,'default'=>'','null'=>false,'comment'=>'分类名称'])
->addColumn('desc','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'分类描述'])
->addColumn('icon','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'分类图标'])
->addColumn('sort','integer',['limit'=>MysqlAdapter::INT_TINY,'default'=>0,'null'=>false,'comment'=>'排序'])
->addColumn('create_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'创建时间'])
->addColumn('update_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'更新时间'])
->create();
}
}

View File

@@ -0,0 +1,36 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
class CommentModifyField extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('comment');
$table
->changeColumn('avatar','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'头像'])
->update();
}
}

View File

@@ -0,0 +1,37 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
class AdvertisementModifyField extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('advertisement');
$table
->renameColumn('ad_name','name')
->changeColumn('name','string',['limit'=>50,'default'=>'','null'=>false,'comment'=>'名称'])
->update();
}
}

View File

@@ -0,0 +1,37 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
use think\migration\Migrator;
use think\migration\db\Column;
class QuestionAddField extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('question');
$table
->addColumn('is_done','integer',['limit'=>MysqlAdapter::INT_TINY,'after'=>'sort','signed'=>false,'default'=>0,'null'=>false,'comment'=>'解决与否,0=未解决,1=已解决'])
->update();
}
}

View File

@@ -0,0 +1,42 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
use think\migration\Migrator;
use think\migration\db\Column;
class CouponSubscribe extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('coupon_subscribe',['engine'=>'InnoDB','auto_increment'=>true,'charset'=>'utf8','primary_key'=>'id','comment'=>'优惠券领用记录表'])->addIndex('id');
$table
->addColumn('platform_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'所属品牌ID'])
->addColumn('language_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'语言包ID'])
->addColumn('goods_coupon_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'优惠券ID'])
->addColumn('email','string',['limit'=>150,'default'=>'','null'=>false,'comment'=>'订阅邮箱'])
->addColumn('create_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'创建时间'])
->addColumn('update_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'更新时间'])
->create();
}
}

View File

@@ -0,0 +1,43 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
use think\migration\Migrator;
use think\migration\db\Column;
class GoodsAttributeCreate extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('goods_attribute',['engine'=>'InnoDB','auto_increment'=>true,'charset'=>'utf8','primary_key'=>'id','comment'=>'商品属性表'])->addIndex('id');
$table
->addColumn('goods_id','integer',['limit'=>10,'default'=>0,'null'=>false,'comment'=>'商品ID'])
->addColumn('attribute_id','integer',['limit'=>10,'default'=>0,'null'=>false,'comment'=>'属性ID'])
->addColumn('value','string',['limit'=>255,'default'=>'','null'=>false,'comment'=>'商品属性值'])
->addColumn('sort','integer',['limit'=> MysqlAdapter::INT_TINY,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'排序'])
->addColumn('create_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'创建时间'])
->addColumn('update_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'更新时间'])
->create();
}
}

View File

@@ -0,0 +1,40 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
class AttributeCreate extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('attribute',['engine'=>'InnoDB','auto_increment'=>true,'charset'=>'utf8','primary_key'=>'id','comment'=>'属性表'])->addIndex('id');
$table
->addColumn('platform_id','integer',['limit'=>10,'default'=>0,'null'=>false,'comment'=>'平台ID'])
->addColumn('language_id','integer',['limit'=>10,'default'=>0,'null'=>false,'comment'=>'语言包ID'])
->addColumn('name','string',['limit'=>255,'default'=>'','null'=>false,'comment'=>'属性名'])
->addColumn('create_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'创建时间'])
->addColumn('update_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'更新时间'])
->create();
}
}

View File

@@ -0,0 +1,39 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
class GoodsCatesCreate extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('goods_cate',['engine'=>'InnoDB','auto_increment'=>true,'charset'=>'utf8','primary_key'=>'id','comment'=>'商品多分类表'])->addIndex('id');
$table
->addColumn('goods_id','integer',['limit'=>10,'default'=>0,'null'=>false,'comment'=>'商品ID'])
->addColumn('goods_category_id','integer',['limit'=>10,'default'=>0,'null'=>false,'comment'=>'属性ID'])
->addColumn('create_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'创建时间'])
->addColumn('update_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'更新时间'])
->create();
}
}

View File

@@ -0,0 +1,37 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
class GoodsAddField extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('goods');
$table
->addColumn('main_img','string',['limit'=>128,'default'=>'','after'=>'model_number','null'=>false,'comment'=>'产品主图'])
->removeColumn('params')
->update();
}
}

View File

@@ -0,0 +1,38 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
class GoodsModifyField extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('goods');
$table
->changeColumn('title','string',['limit'=>255,'default'=>'','null'=>false,'comment'=>'页面title'])
->changeColumn('keywords','string',['limit'=>255,'default'=>'','null'=>false,'comment'=>'关键词'])
->changeColumn('description','string',['limit'=>255,'default'=>'','null'=>false,'comment'=>'页面描述SEO用'])
->update();
}
}

View File

@@ -0,0 +1,36 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
class SoftManualAddFieldImage extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('soft_manual');
$table
->addColumn('image','string',['limit'=>60,'after'=>'url','default'=>'','null'=>false,'comment'=>'图片'])
->update();
}
}

View File

@@ -0,0 +1,37 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
class CommonModifyField extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('comment');
$table
->changeColumn('name','string',['limit'=>255,'default'=>'','null'=>false,'comment'=>'评论标题'])
->changeColumn('nickname','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'客户昵称'])
->update();
}
}

View File

@@ -0,0 +1,34 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
class LanguageRemovePlatformId extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('language');
$table->removeColumn('platform_id')->update();
}
}

View File

@@ -0,0 +1,36 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
class SoftManualModifyField extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('soft_manual');
$table
->changeColumn('name','string',['limit'=>255,'default'=>'','null'=>false,'comment'=>'名称'])
->update();
}
}

View File

@@ -0,0 +1,36 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
class BulkBuyAddField extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('bulk_buy');
$table
->addColumn('needed_num','integer',['limit'=>10,'after'=>'mode_number','default'=>0,'null'=>false,'comment'=>'需要数量'])
->update();
}
}

View File

@@ -0,0 +1,37 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
class FaqModifyField extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('faq');
$table
->changeColumn('question','text',['comment'=>'问题内容'])
->update();
}
}

View File

@@ -0,0 +1,36 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
class SoftManualModifyImageField extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('soft_manual');
$table
->changeColumn('image','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'图片'])
->update();
}
}

View File

@@ -0,0 +1,38 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
class GoodsAddFields extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('goods');
$table
->addColumn('model','string',['limit'=>128,'default'=>'','after'=>'model_number','null'=>false,'comment'=>'模型型号'])
->addColumn('sku','string',['limit'=>128,'default'=>'','after'=>'model','null'=>false,'comment'=>'SKU'])
->addColumn('viewed','integer',['limit'=>10,'signed'=>false,'default'=>0,'after'=>'sku','null'=>false,'comment'=>'查看次数'])
->update();
}
}

View File

@@ -0,0 +1,36 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
class NavigatorModifyField extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('navigator');
$table
->renameColumn('link','url')
->update();
}
}

View File

@@ -0,0 +1,37 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
use think\migration\Migrator;
use think\migration\db\Column;
class SoftManualAddFieldStatus extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('soft_manual');
$table
->addColumn('status','integer',['limit'=>MysqlAdapter::INT_TINY,'after'=>'download_count','signed'=>false,'default'=>0,'null'=>false,'comment'=>'状态,0=正常,1=禁用'])
->update();
}
}

View File

@@ -0,0 +1,40 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
class SoftManualBtnCreate extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('soft_manual_btn',['engine'=>'InnoDB','auto_increment'=>true,'charset'=>'utf8','primary_key'=>'id','comment'=>'文档手册分表'])->addIndex('id');
$table
->addColumn('soft_manual_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'文档手册主表ID'])
->addColumn('btn_tips','string',['limit'=>50,'default'=>'','null'=>false,'comment'=>'按钮名称'])
->addColumn('url','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'下载链接'])
->addColumn('create_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'创建时间'])
->addColumn('update_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'更新时间'])
->create();
}
}

View File

@@ -0,0 +1,36 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
class SoftManualModifyFieldFileName extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('soft_manual');
$table
->changeColumn('file_name','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'文件名'])
->update();
}
}

View File

@@ -0,0 +1,37 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
class GoodsConnectModifyField extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('goods_connect');
$table
->renameColumn('goods_category_id','type')
->changeColumn('type','integer',['limit'=>10,'default'=>0,'null'=>false,'comment'=>'页面标识'])
->update();
}
}

View File

@@ -0,0 +1,40 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
use think\migration\Migrator;
use think\migration\db\Column;
class QuestionAddFieldEmail extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('question');
$table
->addColumn('is_send_email','integer',['limit'=>MysqlAdapter::INT_TINY,'after'=>'is_done','signed'=>false,'default'=>0,'null'=>false,'comment'=>'是否发送邮件,0=否,1=是'])
->addColumn('is_send_status','integer',['limit'=>MysqlAdapter::INT_TINY,'after'=>'is_send_email','signed'=>false,'default'=>0,'null'=>false,'comment'=>'是否发送成功,0=否,1=是'])
->addColumn('send_time','integer',['limit'=>10,'after'=>'is_send_status','signed'=>false,'default'=>0,'null'=>false,'comment'=>'发送时间'])
->addColumn('send_details','text',['after'=>'send_time','null'=>true,'comment'=>'发送反馈'])
->update();
}
}

View File

@@ -0,0 +1,37 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
use think\migration\Migrator;
use think\migration\db\Column;
class SoftManualAddFieldSort extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('soft_manual');
$table
->addColumn('sort','integer',['limit'=>MysqlAdapter::INT_TINY,'after'=>'os','signed'=>false,'default'=>0,'null'=>false,'comment'=>'排序'])
->update();
}
}

View File

@@ -0,0 +1,38 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
use think\migration\Migrator;
use think\migration\db\Column;
class NavigatorAddField extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('navigator');
$table
->addColumn('is_top','integer',['limit'=>MysqlAdapter::INT_TINY,'after'=>'status','signed'=>false,'default'=>0,'null'=>false,'comment'=>'是否顶部导航,0=是,1=否'])
->addColumn('is_foot','integer',['limit'=>MysqlAdapter::INT_TINY,'after'=>'is_top','signed'=>false,'default'=>0,'null'=>false,'comment'=>'是否底部导航,0=是,1=否'])
->update();
}
}

View File

@@ -0,0 +1,37 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
class GoodsConnectModifyFieldType extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('goods_connect');
$table
->changeColumn('type','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'商品分类ID'])
->renameColumn('type','goods_category_id')
->update();
}
}

View File

@@ -0,0 +1,142 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
use think\migration\Migrator;
use think\migration\db\Column;
class DoSelectIdToNull extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('advertise_space');
$table
->changeColumn('advertise_page_id','integer',['limit'=>10,'default'=>null,'null'=>true,'comment'=>'广告页面ID'])
->update();
$table = $this->table('advertisement');
$table
->changeColumn('advertise_space_id','integer',['limit'=>10,'default'=>null,'null'=>true,'comment'=>'广告位ID'])
->update();
$table = $this->table('coupon_subscribe');
$table
->changeColumn('goods_coupon_id','integer',['limit'=>10,'default'=>null,'null'=>true,'comment'=>'优惠券ID'])
->update();
$table = $this->table('faq');
$table
->changeColumn('faq_type_id','integer',['limit'=>10,'default'=>null,'null'=>true,'comment'=>'常见问题分类ID'])
->update();
$table = $this->table('faq');
$table
->changeColumn('faq_type_id','integer',['limit'=>10,'default'=>null,'null'=>true,'comment'=>'常见问题分类ID'])
->update();
$table = $this->table('goods');
$table
->changeColumn('goods_category_id','integer',['limit'=>10,'default'=>null,'null'=>true,'comment'=>'商品分类ID'])
->update();
$table = $this->table('goods');
$table
->changeColumn('goods_category_id','integer',['limit'=>10,'default'=>null,'null'=>true,'comment'=>'商品分类ID'])
->update();
$table = $this->table('goods_attribute');
$table
->changeColumn('goods_id','integer',['limit'=>10,'default'=>null,'null'=>true,'comment'=>'商品ID'])
->changeColumn('attribute_id','integer',['limit'=>10,'default'=>null,'null'=>true,'comment'=>'属性ID'])
->update();
$table = $this->table('goods_buy_now');
$table
->changeColumn('goods_id','integer',['limit'=>10,'default'=>null,'null'=>true,'comment'=>'商品ID'])
->update();
$table = $this->table('goods_connect');
$table
->changeColumn('goods_id','integer',['limit'=>10,'default'=>null,'null'=>true,'comment'=>'商品ID'])
->changeColumn('goods_category_id','integer',['limit'=>10,'default'=>null,'null'=>true,'comment'=>'商品分类ID'])
->changeColumn('connect_good_id','integer',['limit'=>10,'default'=>null,'null'=>true,'comment'=>'关联商品ID'])
->update();
$table = $this->table('goods_soft_manual');
$table
->changeColumn('goods_id','integer',['limit'=>10,'default'=>null,'null'=>true,'comment'=>'商品ID'])
->changeColumn('file_type_id','integer',['limit'=>10,'default'=>null,'null'=>true,'comment'=>'文件类型ID'])
->changeColumn('soft_manual_id','integer',['limit'=>10,'default'=>null,'null'=>true,'comment'=>'文档驱动ID'])
->update();
// $table = $this->table('menu_language');
// $table
// ->changeColumn('menu_id','integer',['limit'=>10,'default'=>null,'null'=>true,'comment'=>'菜单ID'])
// ->update();
// $table = $this->table('menu_platform');
// $table
// ->changeColumn('menu_id','integer',['limit'=>10,'default'=>null,'null'=>true,'comment'=>'菜单ID'])
// ->update();
//
// $table = $this->table('menu_platform');
// $table
// ->changeColumn('menu_id','integer',['limit'=>10,'default'=>null,'null'=>true,'comment'=>'菜单ID'])
// ->update();
$table = $this->table('question');
$table
->changeColumn('country_id','integer',['limit'=>10,'default'=>null,'null'=>true,'comment'=>'国家ID'])
->changeColumn('order_sn','string',['limit'=>50,'default'=>'','null'=>false,'comment'=>'订单号'])
->update();
$table = $this->table('soft_manual');
$table
->changeColumn('file_type_id','integer',['limit'=>10,'default'=>null,'null'=>true,'comment'=>'文件类型ID'])
->update();
// $table = $this->table('platform');
// $table
// ->renameColumn('coin_id','currency_id')
// ->changeColumn('currency_id','integer',['limit'=>10,'default'=>null,'null'=>true,'comment'=>'币种ID'])
// ->update();
// $table = $this->table('platform_coin');
// $table
// ->renameColumn('coin_id','currency_id')
// ->changeColumn('currency_id','integer',['limit'=>10,'default'=>null,'null'=>true,'comment'=>'币种ID'])
// ->update();
// $table = $this->table('site');
// $table
// ->renameColumn('coin_id','currency_id')
// ->changeColumn('currency_id','integer',['limit'=>10,'default'=>null,'null'=>true,'comment'=>'币种ID'])
// ->update();
}
}

View File

@@ -0,0 +1,38 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
use think\migration\Migrator;
use think\migration\db\Column;
class GoodsAddFieldIsNew extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('goods');
$table
->addColumn('is_new','integer',['limit'=>MysqlAdapter::INT_TINY,'after'=>'price','signed'=>false,'null'=>false,'default'=>1,'comment'=>'是否新品,0=是,1=否'])
->addColumn('is_discount','integer',['limit'=>MysqlAdapter::INT_TINY,'after'=>'price','signed'=>false,'null'=>false,'default'=>1,'comment'=>'折扣商品,0=是,1=否'])
->update();
}
}

View File

@@ -0,0 +1,37 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
use think\migration\Migrator;
use think\migration\db\Column;
class CommentModifyFieldSort extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('comment');
$table
->changeColumn('sort','integer',['limit'=>MysqlAdapter::INT_TINY,'signed'=>false,'null'=>false,'default'=>1,'comment'=>'排序'])
->update();
}
}

View File

@@ -0,0 +1,36 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
class FaqTypeModifyName extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('faq_type');
$table
->changeColumn('name','string',['limit'=>60,'null'=>false,'default'=>'','comment'=>'分类名称'])
->update();
}
}

View File

@@ -0,0 +1,36 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
class AdvertisementAddFields extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('advertisement');
$table
->addColumn('command','string',['limit'=>255,'after'=>'play_order','null'=>false,'default'=>'','comment'=>'悬浮提示'])
->update();
}
}

View File

@@ -0,0 +1,36 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
use think\migration\Migrator;
class GoodsModifySortFiledDefault extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('goods');
$table
->changeColumn('sort','integer',['limit'=>MysqlAdapter::INT_TINY,'signed'=>false,'default'=>1,'null'=>false,'comment'=>'排序'])
->update();
}
}

View File

@@ -0,0 +1,36 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
class SoftManualBtnAddField extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('soft_manual_btn');
$table
->addColumn('file_name','string',['limit'=>128,'after'=>'url','null'=>false,'default'=>'','comment'=>'文件名称'])
->update();
}
}

View File

@@ -0,0 +1,121 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
class AllTableAddFieldSiteId extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('advertise_page');
$table
->addColumn('site_id','integer',['limit'=>10,'signed'=>false,'after'=>'language_id','default'=>0,'null'=>false,'comment'=>'站点ID'])
->update();
$table = $this->table('advertise_space');
$table
->addColumn('site_id','integer',['limit'=>10,'signed'=>false,'after'=>'language_id','default'=>0,'null'=>false,'comment'=>'站点ID'])
->update();
$table = $this->table('advertisement');
$table
->addColumn('site_id','integer',['limit'=>10,'signed'=>false,'after'=>'language_id','default'=>0,'null'=>false,'comment'=>'站点ID'])
->update();
$table = $this->table('article');
$table
->addColumn('site_id','integer',['limit'=>10,'signed'=>false,'after'=>'language_id','default'=>0,'null'=>false,'comment'=>'站点ID'])
->update();
$table = $this->table('attribute');
$table
->addColumn('site_id','integer',['limit'=>10,'signed'=>false,'after'=>'language_id','default'=>0,'null'=>false,'comment'=>'站点ID'])
->update();
$table = $this->table('bulk_buy');
$table
->addColumn('site_id','integer',['limit'=>10,'signed'=>false,'after'=>'language_id','default'=>0,'null'=>false,'comment'=>'站点ID'])
->update();
$table = $this->table('comment');
$table
->addColumn('site_id','integer',['limit'=>10,'signed'=>false,'after'=>'language_id','default'=>0,'null'=>false,'comment'=>'站点ID'])
->update();
$table = $this->table('coupon_subscribe');
$table
->addColumn('site_id','integer',['limit'=>10,'signed'=>false,'after'=>'language_id','default'=>0,'null'=>false,'comment'=>'站点ID'])
->update();
$table = $this->table('faq');
$table
->addColumn('site_id','integer',['limit'=>10,'signed'=>false,'after'=>'language_id','default'=>0,'null'=>false,'comment'=>'站点ID'])
->update();
$table = $this->table('faq_type');
$table
->addColumn('site_id','integer',['limit'=>10,'signed'=>false,'after'=>'language_id','default'=>0,'null'=>false,'comment'=>'站点ID'])
->update();
$table = $this->table('file_type');
$table
->addColumn('site_id','integer',['limit'=>10,'signed'=>false,'after'=>'language_id','default'=>0,'null'=>false,'comment'=>'站点ID'])
->update();
$table = $this->table('goods');
$table
->addColumn('site_id','integer',['limit'=>10,'signed'=>false,'after'=>'language_id','default'=>0,'null'=>false,'comment'=>'站点ID'])
->update();
$table = $this->table('goods_category');
$table
->addColumn('site_id','integer',['limit'=>10,'signed'=>false,'after'=>'language_id','default'=>0,'null'=>false,'comment'=>'站点ID'])
->update();
$table = $this->table('goods_coupon');
$table
->addColumn('site_id','integer',['limit'=>10,'signed'=>false,'after'=>'language_id','default'=>0,'null'=>false,'comment'=>'站点ID'])
->update();
$table = $this->table('navigator');
$table
->addColumn('site_id','integer',['limit'=>10,'signed'=>false,'after'=>'language_id','default'=>0,'null'=>false,'comment'=>'站点ID'])
->update();
$table = $this->table('question');
$table
->addColumn('site_id','integer',['limit'=>10,'signed'=>false,'after'=>'language_id','default'=>0,'null'=>false,'comment'=>'站点ID'])
->update();
$table = $this->table('soft_manual');
$table
->addColumn('site_id','integer',['limit'=>10,'signed'=>false,'after'=>'language_id','default'=>0,'null'=>false,'comment'=>'站点ID'])
->update();
}
}

View File

@@ -0,0 +1,37 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
class GoodsBuyNowUrlModify extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('goods_buy_now');
$table
->changeColumn('url','text',['comment'=>'链接地址'])
->update();
}
}

View File

@@ -0,0 +1,36 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
class SoftManualAddFieldFileMd5 extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('soft_manual_btn');
$table
->addColumn('md5','string',['limit'=>32,'null'=>false,'after'=>'file_name','default'=>'','comment'=>'文件MD5值'])
->update();
}
}

View File

@@ -0,0 +1,36 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
class AdvertisePageAddFields extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('advertise_page');
$table
->changeColumn('name', 'string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'页面名称'])
->update();
}
}

View File

@@ -0,0 +1,44 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
use think\migration\Migrator;
use think\migration\db\Column;
class ArticleTypeCreate extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('article_type',['engine'=>'InnoDB','auto_increment'=>true,'charset'=>'utf8','primary_key'=>'id','comment'=>'文章分类表'])->addIndex('id');
$table
->addColumn('platform_id','integer',['limit'=>10,'default'=>0,'null'=>false,'comment'=>'平台ID'])
->addColumn('site_id','integer',['limit'=>MysqlAdapter::INT_TINY,'default'=>0,'null'=>false,'comment'=>'语言包ID'])
->addColumn('name','string',['limit'=>32,'default'=>'','null'=>false,'comment'=>'分类名称'])
->addColumn('desc','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'分类描述'])
->addColumn('icon','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'分类图标'])
->addColumn('sort','integer',['limit'=>MysqlAdapter::INT_TINY,'default'=>0,'null'=>false,'comment'=>'排序'])
->addColumn('create_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'创建时间'])
->addColumn('update_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'更新时间'])
->create();
}
}

View File

@@ -0,0 +1,39 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
use think\migration\Migrator;
use think\migration\db\Column;
class ArticleAddFieldCreate extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('article');
$table
->addColumn('article_type_id','integer',['limit'=>10,'signed'=>false,'after'=>'site_id','default'=>0,'null'=>false,'comment'=>'文章分类ID'])
->addColumn('status','integer',['limit'=>MysqlAdapter::INT_TINY,'default'=>1,'after'=>'sort','null'=>false,'comment'=>'状态,0=启动,1=禁用'])
->changeColumn('detail','text',['comment'=>'文件详情'])
->update();
}
}

View File

@@ -0,0 +1,40 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
use think\migration\Migrator;
use think\migration\db\Column;
class ArticleAddField extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('article');
$table
->addColumn('is_outer_chain','integer',['limit'=>MysqlAdapter::INT_TINY,'default'=>1,'after'=>'status','null'=>false,'comment'=>'是否外链,0=是,1=否'])
->addColumn('brief','string',['limit'=>255,'after'=>'is_outer_chain','default'=>'','null'=>false,'comment'=>'文章简介'])
->addColumn('keywords','string',['limit'=>255,'after'=>'is_outer_chain','default'=>'','null'=>false,'comment'=>'关键字'])
->addColumn('meta_title','string',['limit'=>255,'after'=>'is_outer_chain','default'=>'','null'=>false,'comment'=>'meta标题'])
->update();
}
}

View File

@@ -0,0 +1,37 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
class SiteAddField extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('site');
$table
->addColumn('app_id','string',['limit'=>32,'after'=>'status','default'=>'','null'=>false,'comment'=>'客户端APPID'])
->addColumn('app_key','string',['limit'=>64,'after'=>'app_id','default'=>'','null'=>false,'comment'=>'客户端APPKEY'])
->update();
}
}

View File

@@ -0,0 +1,39 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
class TwoLevelCreate extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('area',['engine'=>'innodb','auto_increment'=>true,'charset'=>'utf8','primary_key'=>'id','comment'=>'地区联动表'])->addIndex('id');
$table
->addColumn('pid','integer',['limit'=>10,'default'=>0,'null'=>false,'comment'=>'父id'])
->addColumn('name','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'名称'])
->addColumn('level','integer',['limit'=>10,'default'=>0,'null'=>false,'comment'=>'层级'])
->addIndex(['pid'])
->create();
}
}

View File

@@ -0,0 +1,36 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
class BuldBuyAddFieldAreaId extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('bulk_buy');
$table
->addColumn('area_id','integer',['limit'=>10,'after'=>'site_id','default'=>0,'null'=>false,'comment'=>'地区ID'])
->update();
}
}

View File

@@ -0,0 +1,36 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
class BuldBuyAddFieldPhone extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('bulk_buy');
$table
->addColumn('phone','string',['limit'=>20,'after'=>'email','default'=>'','null'=>false,'comment'=>'联系电话'])
->update();
}
}

View File

@@ -0,0 +1,36 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
class CouponScribeAddFieldPhone extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('coupon_subscribe');
$table
->addColumn('phone','string',['limit'=>20,'default'=>'','after'=>'email','null'=>false,'comment'=>'手机号'])
->update();
}
}

View File

@@ -0,0 +1,36 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
class QuestionAddFieldPhone extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('question');
$table
->addColumn('phone','string',['limit'=>20,'default'=>'','after'=>'email','null'=>false,'comment'=>'手机号'])
->update();
}
}

View File

@@ -0,0 +1,45 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
class ImagesFilesCreate extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('attachment',['engine'=>'InnoDB','auto_increment'=>true,'charset'=>'utf8','primary_key'=>'id','comment'=>'附件表'])->addIndex('id');
$table
->addColumn('platform_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'平台ID'])
->addColumn('site_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'语音包ID'])
->addColumn('path','string',['limit'=>255,'default'=>'','null'=>false,'comment'=>'相对路径'])
->addColumn('local','string',['limit'=>255,'default'=>'','null'=>false,'comment'=>'本地路径'])
->addColumn('hash','string',['limit'=>32,'default'=>'','null'=>false,'comment'=>'文件hash'])
->addColumn('md5','string',['limit'=>32,'default'=>'','null'=>false,'comment'=>'文件md5'])
->addColumn('name','string',['limit'=>255,'default'=>'','null'=>false,'comment'=>'文件名'])
->addColumn('type','string',['limit'=>255,'default'=>'','null'=>false,'comment'=>'文件类型'])
->addColumn('create_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'创建时间'])
->addColumn('update_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'更新时间'])
->create();
}
}

View File

@@ -0,0 +1,36 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
class BulkBuyModifyField extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('bulk_buy');
$table
->addColumn('model_name','string',['limit'=>255,'default'=>'','null'=>false,'comment'=>'产品型号'])
->update();
}
}

View File

@@ -0,0 +1,36 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
class AdvertiseModifyField extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('advertisement');
$table
->changeColumn('play_order','integer',['limit'=>10,'signed'=>false,'default'=>1,'null'=>false,'comment'=>'轮播顺序'])
->update();
}
}

View File

@@ -0,0 +1,57 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
use think\migration\Migrator;
use think\migration\db\Column;
class UserCreate extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('user',['engine'=>'InnoDB','auto_increment'=>true,'charset'=>'utf8mb4','primary_key'=>'id','comment'=>'用户表'])->addIndex('id');
$table
->addColumn('uc_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'用户全局维一ID'])
->addColumn('admin_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'管理员ID'])
->addColumn('org_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'组织ID'])
->addColumn('role_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'用户角色ID'])
->addColumn('dept_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'部门ID'])
->addColumn('staff_code','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'用户唯一标识符'])
->addColumn('nickname','string',['limit'=>64,'default'=>'','null'=>false,'comment'=>'用户昵称'])
->addColumn('mobile','string',['limit'=>11,'default'=>'','null'=>false,'comment'=>'手机号'])
->addColumn('email','string',['limit'=>64,'default'=>'','null'=>false,'comment'=>'邮箱'])
->addColumn('avatar','string',['limit'=>120,'default'=>'','null'=>false,'comment'=>'用户头像'])
->addColumn('gender','integer',['limit'=>MysqlAdapter::INT_TINY,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'0为保密;1为男;2为女'])
->addColumn('signin_ip','string',['limit'=>15,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'登录ip'])
->addColumn('status','integer',['limit'=>MysqlAdapter::INT_TINY,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'0为启用;1为禁用'])
->addColumn('create_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'注册时间'])
->addColumn('update_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'更新时间'])
->addColumn('signin_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'登录时间'])
->addIndex('nickname')
->addIndex('mobile')
->addIndex('admin_id')
->addIndex('dept_id')
->addIndex('uc_id')
->create();
}
}

View File

@@ -0,0 +1,53 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
use think\migration\Migrator;
use think\migration\db\Column;
class InvestmentCreate extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('investment',['engine'=>'InnoDB','auto_increment'=>true,'charset'=>'utf8','primary_key'=>'id','comment'=>'招商留言表'])->addIndex('id');
$table
->addColumn('platform_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'平台ID'])
->addColumn('language_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'语言包ID'])
->addColumn('site_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'站点ID'])
->addColumn('country_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'国家ID'])
->addColumn('province_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'省'])
->addColumn('city_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'市'])
->addColumn('area','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'合作区域'])
->addColumn('phone','string',['limit'=>30,'default'=>'','null'=>false,'comment'=>'手机号'])
->addColumn('name','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'姓名'])
->addColumn('email','string',['limit'=>60,'default'=>'','null'=>false,'comment'=>'邮箱'])
->addColumn('wechat','string',['limit'=>60,'default'=>'','null'=>false,'comment'=>'微信'])
->addColumn('qq','string',['limit'=>60,'default'=>'','null'=>false,'comment'=>'QQ'])
->addColumn('desc','text',['comment'=>'留言详情'])
->addColumn('sort','integer',['limit'=>MysqlAdapter::INT_TINY,'default'=>0,'null'=>false,'comment'=>'排序'])
->addColumn('is_open','integer',['limit'=>MysqlAdapter::INT_TINY,'default'=>0,'null'=>false,'comment'=>'厂家查看:0=否,1=是'])
->addColumn('create_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'创建时间'])
->addColumn('update_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'更新时间'])
->create();
}
}

View File

@@ -0,0 +1,36 @@
<?php
use think\migration\Migrator;
use think\migration\db\Column;
class InvestmentAddField extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('investment');
$table
->addColumn('from','string',['limit'=>30,'default'=>'','after'=>'area','null'=>false,'comment'=>'来源'])
->update();
}
}

View File

@@ -0,0 +1,47 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
use think\migration\Migrator;
use think\migration\db\Column;
class SystemConfigCreate extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('system_config',['engine'=>'InnoDB','auto_increment'=>true,'charset'=>'utf8','primary_key'=>'id','comment'=>'系统配置'])->addIndex('id');
$table
->addColumn('platform_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'平台ID'])
->addColumn('language_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'语言包ID'])
->addColumn('site_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'站点ID'])
->addColumn('type','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'类型1=文本,2=图片,3=富文本'])
->addColumn('page','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'所属页'])
->addColumn('pos','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'位置'])
->addColumn('name','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'配置名'])
->addColumn('value','text',['null'=>true,'default'=>null,'comment'=>'配置值'])
->addColumn('image','text',['null'=>true,'default'=>null,'comment'=>'图片'])
->addColumn('create_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'创建时间'])
->addColumn('update_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'更新时间'])
->create();
}
}

View File

@@ -0,0 +1,55 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
use think\migration\Migrator;
use think\migration\db\Column;
class ResourceCreate extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('resource',['engine'=>'InnoDB','auto_increment'=>true,'charset'=>'utf8','primary_key'=>'id','comment'=>'资源中心表'])->addIndex('id');
$table
->addColumn('platform_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'平台ID'])
->addColumn('language_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'语音包ID'])
->addColumn('resource_type_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'资源中心分类ID'])
->addColumn('site_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'站点ID'])
->addColumn('title','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'文章标题'])
->addColumn('desc','string',['limit'=>255,'default'=>'','null'=>false,'comment'=>'文章描述'])
->addColumn('thumb','string',['limit'=>255,'default'=>'','null'=>false,'comment'=>'文章缩略图'])
->addColumn('url','string',['limit'=>255,'default'=>'','null'=>false,'comment'=>'链接'])
->addColumn('detail','text',['comment'=>'详情'])
->addColumn('sort','integer',['limit'=>MysqlAdapter::INT_TINY,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'排序'])
->addColumn('click_num','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'点击次数'])
->addColumn('meta_title','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'标题'])
->addColumn('brief','string',['limit'=>255,'default'=>'','null'=>false,'comment'=>'描述'])
->addColumn('keywords','string',['limit'=>255,'default'=>'','null'=>false,'comment'=>'关键字'])
->addColumn('is_outer_chain','integer',['limit'=>MysqlAdapter::INT_TINY,'default'=>1,'null'=>false,'comment'=>'是否外链,0=是,1=否'])
->addColumn('status','integer',['limit'=>MysqlAdapter::INT_TINY,'default'=>1,'null'=>false,'comment'=>'状态,0=启动,1=禁用'])
->addColumn('is_on_index','integer',['limit'=>MysqlAdapter::INT_TINY,'default'=>0,'null'=>false,'comment'=>'是否在首页,0=否,1=是'])
->addColumn('create_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'创建时间'])
->addColumn('update_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'更新时间'])
->create();
}
}

View File

@@ -0,0 +1,55 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
use think\migration\Migrator;
use think\migration\db\Column;
class BrandCreate extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('brand',['engine'=>'InnoDB','auto_increment'=>true,'charset'=>'utf8','primary_key'=>'id','comment'=>'品牌矩阵表'])->addIndex('id');
$table
->addColumn('platform_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'平台ID'])
->addColumn('language_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'语音包ID'])
->addColumn('brand_type_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'品牌矩阵分类ID'])
->addColumn('site_id','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'站点ID'])
->addColumn('title','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'文章标题'])
->addColumn('desc','string',['limit'=>255,'default'=>'','null'=>false,'comment'=>'文章描述'])
->addColumn('thumb','string',['limit'=>255,'default'=>'','null'=>false,'comment'=>'文章缩略图'])
->addColumn('url','string',['limit'=>255,'default'=>'','null'=>false,'comment'=>'链接'])
->addColumn('detail','text',['comment'=>'详情'])
->addColumn('sort','integer',['limit'=>MysqlAdapter::INT_TINY,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'排序'])
->addColumn('click_num','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'点击次数'])
->addColumn('meta_title','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'标题'])
->addColumn('brief','string',['limit'=>255,'default'=>'','null'=>false,'comment'=>'描述'])
->addColumn('keywords','string',['limit'=>255,'default'=>'','null'=>false,'comment'=>'关键字'])
->addColumn('is_outer_chain','integer',['limit'=>MysqlAdapter::INT_TINY,'default'=>1,'null'=>false,'comment'=>'是否外链,0=是,1=否'])
->addColumn('status','integer',['limit'=>MysqlAdapter::INT_TINY,'default'=>1,'null'=>false,'comment'=>'状态,0=启动,1=禁用'])
->addColumn('is_on_index','integer',['limit'=>MysqlAdapter::INT_TINY,'default'=>0,'null'=>false,'comment'=>'是否在首页,0=否,1=是'])
->addColumn('create_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'创建时间'])
->addColumn('update_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'更新时间'])
->create();
}
}

View File

@@ -0,0 +1,44 @@
<?php
use Phinx\Db\Adapter\MysqlAdapter;
use think\migration\Migrator;
use think\migration\db\Column;
class BrandTypeCreate extends Migrator
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('brand_type',['engine'=>'InnoDB','auto_increment'=>true,'charset'=>'utf8','primary_key'=>'id','comment'=>'品牌矩阵分类表'])->addIndex('id');
$table
->addColumn('platform_id','integer',['limit'=>10,'default'=>0,'null'=>false,'comment'=>'平台ID'])
->addColumn('site_id','integer',['limit'=>MysqlAdapter::INT_TINY,'default'=>0,'null'=>false,'comment'=>'语言包ID'])
->addColumn('name','string',['limit'=>32,'default'=>'','null'=>false,'comment'=>'分类名称'])
->addColumn('desc','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'分类描述'])
->addColumn('icon','string',['limit'=>128,'default'=>'','null'=>false,'comment'=>'分类图标'])
->addColumn('sort','integer',['limit'=>MysqlAdapter::INT_TINY,'default'=>0,'null'=>false,'comment'=>'排序'])
->addColumn('create_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'创建时间'])
->addColumn('update_time','integer',['limit'=>10,'signed'=>false,'default'=>0,'null'=>false,'comment'=>'更新时间'])
->create();
}
}

Some files were not shown because too many files have changed in this diff Show More