123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php
- use think\migration\Migrator;
- use think\migration\db\Column;
- class CreateCustomerExtensionTable 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('customer_extension', ['comment' => '员工pc端推广明细表', 'engine'=>'InnoDB']);
- $table->addColumn('addtime', 'date',array('comment'=>'投放日期'))
- ->addColumn(Column::decimal('money',10,2)->setComment('推广费用')->setDefault(0))
- ->addColumn('show', 'integer', array('default'=> '0', 'comment'=>'展现次数'))
- ->addColumn('click', 'integer', array('default'=> '0', 'comment'=>'点击次数'))
- ->addColumn('root_id', 'integer', array('default'=> '0', 'comment'=>'所属企业'))
- ->addColumn('employee_id', 'integer', array('default'=> '0', 'comment'=>'员工id'))
- ->addColumn('org_id', 'integer', array('default'=> '0', 'comment'=>'所属部门id'))
- ->addColumn('source_id', 'integer', array('default'=> '0', 'comment'=>'来源id'))
- ->create();
- }
- }
|