Skip to content

Instantly share code, notes, and snippets.

@smiler
Created July 2, 2014 11:47
Show Gist options
  • Save smiler/d1e8e909ee207fc13308 to your computer and use it in GitHub Desktop.
Save smiler/d1e8e909ee207fc13308 to your computer and use it in GitHub Desktop.
CREATE TABLE `auction_premium_users` (
`auction_id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
PRIMARY KEY (`auction_id`,`user_id`),
KEY `a_idx` (`user_id`),
CONSTRAINT `premium_users_auctions` FOREIGN KEY (`auction_id`) REFERENCES `auctions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `premium_users_users` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment