CREATE TABLE `blog_posts` (
  `id` int(11) NOT NULL PRIMARY KEY,
  `name` varchar(255) NOT NULL,
  `created` datetime DEFAULT NULL,
  `modified` datetime DEFAULT NULL
);

CREATE TABLE `blog_posts_categories` (
  `category_id` int(11) NOT NULL,
  `blog_post_id` int(11) NOT NULL
);
ALTER TABLE `blog_posts_categories`
  ADD PRIMARY KEY (`category_id`,`blog_post_id`);

CREATE TABLE `categories` (
  `id` int(11) NOT NULL PRIMARY KEY,
  `name` varchar(255) NOT NULL,
  `created` datetime DEFAULT NULL,
  `modified` datetime DEFAULT NULL
);