Commit 896402de by Trevor Austin

Finish example

parent b5ab49f3
......@@ -17,9 +17,9 @@ use weblog;
create table posts_and_comments (
id INT AUTO_INCREMENT PRIMARY KEY,
body TEXT,
slug VARCHAR(30) NOT NULL,
title VARCHAR(255) NOT NULL,
body TEXT NOT NULL,
slug VARCHAR(30),
title VARCHAR(255),
post_id INT,
author VARCHAR(30)
)
);
-- migrate the posts first
use weblog;
insert into posts_and_comments(id, body, slug, title)
SELECT id, body, slug, title from posts;
-- then migrate the comments
insert into posts_and_comments(body, author, post_id)
select body, author, post_id from comments;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment