12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php
- use think\migration\Migrator;
- use think\migration\db\Column;
- class CreateSmartScreenConstructionTable 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('smart_screen_construction')->setComment('智慧屏在施工地')
- ->addColumn('owner_name', 'string', ['limit'=> 200, 'default'=> '', 'comment'=> '业主姓名'])
- ->addColumn('address', 'string', ['limit'=> 255, 'default'=> '', 'comment'=> '工程地址'])
- ->addColumn('designer_id', 'integer', ['limit'=> 10, 'default'=> 0, 'comment'=> '设计师id'])
- ->addColumn('project_manager', 'string', ['limit'=> 100, 'default'=> '', 'comment'=> '项目经理'])
- ->addColumn('inspection', 'string', ['limit'=> 100, 'default'=> '', 'comment'=> '片区/质检'])
- ->addColumn('status', 'integer', ['limit'=> 5, 'default'=> 0, 'comment'=> '施工状态'])
- ->addColumn('employee_id', 'integer', ['limit'=> 10, 'default'=> 0, 'comment'=> '上传人'])
- ->addColumn('root_id', 'integer', ['limit'=> 10, 'default'=> 0, 'comment'=> '组织id'])
- ->addColumn('addtime', 'timestamp', ['default'=> 'CURRENT_TIMESTAMP', 'comment'=> '添加时间'])
- ->create();
- }
- }
|