| 12345678910111213141516171819202122232425 |
- <?php
- declare(strict_types=1);
- use Phinx\Migration\AbstractMigration;
- final class GoodsLimitPurchaseRule extends AbstractMigration
- {
- public function change(): void
- {
- $this->table('goods_limit_purchase_rule', ['comment' => '商品限购规则关联表'])
- ->addColumn('goods_id', 'integer', [
- 'signed' => false,
- 'comment' => '商品ID',
- ])
- ->addColumn('rule_id', 'integer', [
- 'signed' => false,
- 'comment' => '限购规则ID',
- ])
- ->addTimestamps('create_time', 'update_time')
- ->addIndex(['goods_id'], ['unique' => true, 'name' => 'uk_goods_id'])
- ->addIndex(['rule_id'], ['name' => 'idx_rule_id'])
- ->create();
- }
- }
|