123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <?php
- use think\migration\Migrator;
- use think\migration\db\Column;
- class CreateSmartScreenImportTable 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_import_log')->setComment('智慧屏资料导入记录')
- ->addColumn('name', 'string', ['limit'=> 200, 'default'=> '', 'comment'=> '导入文件名'])
- ->addColumn('type', 'integer', ['limit'=> 2, 'default'=> 0, 'comment'=> '1、在施工地2、项目清单'])
- ->addColumn('count', 'integer', ['limit'=> 10, 'default'=> 0, 'comment'=> '资源条数'])
- ->addColumn('valid_count', 'integer', ['limit'=> 10, 'default'=> 0, 'comment'=> '有效数量'])
- ->addColumn('invalid_count', 'integer', ['limit'=> 10, 'default'=> 0, 'comment'=> '无效数量'])
- ->addColumn('status', 'integer', ['limit'=> 1, 'default'=> 0, 'comment'=> '导入状态 0、未开始 1、进行中2、完成'])
- ->addColumn('employee_id', 'integer', ['limit'=> 10, 'default'=> 0, 'comment'=> '导入人'])
- ->addColumn('root_id', 'integer', ['limit'=> '10', 'default'=> 0, 'comment'=> '企业id'])
- ->addColumn('execute_rows', 'integer', ['limit'=> 10, 'default'=> 0, 'comment'=> '执行行数'])
- ->addColumn('tmp_path', 'string', ['limit'=> 255, 'default'=> '', 'comment'=> '临时文件路径'])
- ->addColumn('path', 'string', ['limit'=> 255, 'default'=> '', 'comment'=> '文件路径'])
- ->create();
- }
- }
|