12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php
- use think\migration\Migrator;
- use think\migration\db\Column;
- class CreateVrFloder 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('vr_floder', ['comment' => 'vr文件夹'])
- ->addColumn('fld_name', 'string', ['comment' => '文件夹名'])
- ->addColumn('createtime', 'integer', ['comment' => '创建时间'])
- ->addColumn('vr_num', 'integer', ['comment' => 'vr数量', 'default' => 0])
- ->addColumn('fld_type', 'boolean', ['comment' => '文件夹类型(1个人2团队)', 'default' => 1])
- ->addColumn('create_user', 'integer', ['comment' => '文件夹创建人'])
- ->addColumn('lft', 'string', ['comment' => '二叉树左侧数'])
- ->addColumn('rgt', 'string', ['comment' => '二叉树右侧数'])
- ->addColumn('depth', 'boolean', ['comment' => '层级深度', 'default' => 1])
- ->addColumn('root_id', 'integer', ['comment' => '团队id', 'null' => true, 'default' => 0])
- ->create();
- }
- }
|