From c65e0344b62abb27db31f47e711552dc960a8661 Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Mon, 3 Jan 2011 10:04:28 -0500 Subject: [PATCH] adding sql for creating blog data --- web-cake/html/app/models/blog-init.sql | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 web-cake/html/app/models/blog-init.sql diff --git a/web-cake/html/app/models/blog-init.sql b/web-cake/html/app/models/blog-init.sql new file mode 100644 index 0000000..7a7efdf --- /dev/null +++ b/web-cake/html/app/models/blog-init.sql @@ -0,0 +1,16 @@ +/* First, create our posts table: */ +CREATE TABLE posts ( + id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, + title VARCHAR(50), + body TEXT, + created DATETIME DEFAULT NULL, + modified DATETIME DEFAULT NULL +); + +/* Then insert some posts for testing: */ +INSERT INTO posts (title,body,created) + VALUES ('The title', 'This is the post body.', NOW()); +INSERT INTO posts (title,body,created) + VALUES ('A title once again', 'And the post body follows.', NOW()); +INSERT INTO posts (title,body,created) + VALUES ('Title strikes back', 'This is really exciting! Not.', NOW());