· 8 years ago · Jan 24, 2018, 01:18 PM
1<?php
2
3use Phinx\Migration\AbstractMigration;
4
5class SmsDistributionTvAds extends AbstractMigration
6{
7
8 public function up()
9 {
10 $this->execute('
11CREATE TABLE IF NOT EXISTS `sms_distribution_tv_ads` (
12 `id` integer UNSIGNED NOT NULL AUTO_INCREMENT,
13 `user_id` integer UNSIGNED NOT NULL,
14 `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
15 PRIMARY KEY (`id`),
16 KEY `i_user_id` (`user_id`)
17) ENGINE=InnoDB DEFAULT CHARSET=utf8;
18');
19 }
20
21 public function down()
22 {
23 $this->execute('DROP TABLE IF EXISTS `sms_distribution_tv_ads`;');
24 }
25
26}