feat: init

This commit is contained in:
2024-12-20 18:03:35 +08:00
commit ec7b29a4fc
77 changed files with 2162 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
<?php
use think\migration\Migrator;
class CreateAgent 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('agent', ['engine' => 'MyISAM', 'comment' => '代理商表']);
$table->addColumn('language_id', 'integer', ['signed' => false, 'null' => false, 'comment' => '语言ID'])
->addColumn('corp_name', 'string', ['limit' => 64, 'null' => false, 'comment' => '公司名称'])
->addColumn('email', 'string', ['limit' => 64, 'null' => false, 'comment' => '邮箱'])
->addColumn('phone', 'string', ['limit' => 64, 'null' => false, 'comment' => '电话'])
->addColumn('website_url', 'string', ['limit' => 128, 'null' => false, 'comment' => '网站地址'])
->addColumn('business_type', 'integer', ['null' => false, 'comment' => '业务类型'])
->addColumn('enterprise_size', 'integer', ['null' => false, 'comment' => '企业规模'])
->addColumn('province', 'string', ['limit' => 64, 'null' => true, 'default' => null, 'comment' => '省'])
->addColumn('city', 'string', ['limit' => 64, 'null' => true, 'default' => null, 'comment' => '市'])
->addColumn('district', 'string', ['limit' => 64, 'null' => true, 'default' => null, 'comment' => '区/县'])
->addColumn('address', 'string', ['limit' => 255, 'null' => true, 'default' => null, 'comment' => '地址'])
->addColumn('message', 'text', ['null' => true, 'default' => null, 'comment' => '留言'])
->addColumn('created_at', 'timestamp', ['null' => false, 'default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间'])
->create();
}
}