ALTER TABLE `transactions` ADD `event_id` int(10) unsigned NULL AFTER `community_id`, ADD KEY `event_id` (`event_id`), ADD CONSTRAINT `transactions_event_id` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`);