migration = $factory; } public function getMigrations(Updater $updater) { $columns = array( 'idreport' => 'INT(11) NOT NULL', 'token' => ' VARCHAR(100) NULL', 'email' => 'VARCHAR(100) NOT NULL', 'ts_subscribed' => 'TIMESTAMP DEFAULT CURRENT_TIMESTAMP', 'ts_unsubscribed' => 'TIMESTAMP NULL', ); return array( $this->migration->db->createTable('report_subscriptions', $columns, ['idreport', 'email']), $this->migration->db->addUniqueKey('report_subscriptions', 'token', 'unique_token') ); } public function doUpdate(Updater $updater) { $updater->executeMigrations(__FILE__, $this->getMigrations($updater)); } }