【发布时间】:2018-10-02 10:18:24
【问题描述】:
我有桌子:
CREATE TABLE `ticket` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`price` int(11) DEFAULT NULL,
`status` NOT NULL DEFAULT,
`date_created` datetime NOT NULL,
`date_used` datetime DEFAULT NULL,
`used_by_user_id` int(11) DEFAULT NULL,)
ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
我已经创建了表格
$this->createTable('used', [
'id' => $this->primaryKey(),
'ticket_id' => $this->integer()->notNull(),
'date_used' => $this->integer()->notNull(),
'used_by_user_id' => $this->integer()->notNull(),
], 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB');
我想将一些数据(date_used & used_by_user_id)从表 ticket 移动到查询中与迁移 yii2 一起使用的其他表。但是如果没有ActiveRecord & array,我不知道该怎么做。
【问题讨论】:
标签: php database yii yii2 migration