CREATE TABLE `transactions` ( id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, channel_id INT(11) UNSIGNED NOT NULL, code VARCHAR(255) NOT NULL, type VARCHAR(255) NOT NULL, total INT(11) NOT NULL, created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id`), FOREIGN KEY (`channel_id`) REFERENCES channels(`id`) );