Files
orico-official-website/database/migrations/20241224032339_create_bulk_purchase_inquiry.php
2024-12-24 18:09:25 +08:00

48 lines
2.3 KiB
PHP

<?php
use think\migration\Migrator;
class CreateBulkPurchaseInquiry 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('bulk_purchase_inquiry', ['engine' => 'MyISAM', 'comment' => '批量采购询盘表']);
$table->addColumn('language_id', 'integer', ['signed' => false, 'null' => false, 'comment' => '语言ID'])
->addColumn('corp_name', 'string', ['limit' => 64, 'null' => false, 'comment' => '公司名称'])
->addColumn('first_name', 'string', ['limit' => 64, 'null' => false, 'comment' => '姓'])
->addColumn('last_name', 'string', ['limit' => 64, 'null' => false, 'comment' => '名'])
->addColumn('email', 'string', ['limit' => 128, 'null' => false, 'comment' => '邮箱'])
->addColumn('phone', 'string', ['limit' => 32, 'null' => false, 'comment' => '电话'])
->addColumn('province', 'string', ['limit' => 64, 'null' => false, 'comment' => '省'])
->addColumn('city', 'string', ['limit' => 64, 'null' => false, 'comment' => '市'])
->addColumn('district', 'string', ['limit' => 64, 'null' => false, 'comment' => '区'])
->addColumn('address', 'string', ['limit' => 255, 'null' => false, 'comment' => '地址'])
->addColumn('interest', 'string', ['limit' => 255, 'null' => false, 'comment' => '兴趣(感兴趣的产品品类)'])
->addColumn('message', 'text', ['null' => false, 'comment' => '留言内容'])
->addColumn('ip', 'string', ['limit' => 64, 'null' => false, 'comment' => 'IP'])
->addColumn('created_at', 'timestamp', ['null' => false, 'default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间'])
->create();
}
}