~justin-fathomdb/nova/justinsb-openstack-api-volumes

« back to all changes in this revision

Viewing changes to vendor/tornado/demos/blog/schema.sql

  • Committer: Jesse Andrews
  • Date: 2010-05-28 06:05:26 UTC
  • Revision ID: git-v1:bf6e6e718cdc7488e2da87b21e258ccc065fe499
initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
-- Copyright 2009 FriendFeed
 
2
--
 
3
-- Licensed under the Apache License, Version 2.0 (the "License"); you may
 
4
-- not use this file except in compliance with the License. You may obtain
 
5
-- a copy of the License at
 
6
--
 
7
--     http://www.apache.org/licenses/LICENSE-2.0
 
8
--
 
9
-- Unless required by applicable law or agreed to in writing, software
 
10
-- distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 
11
-- WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 
12
-- License for the specific language governing permissions and limitations
 
13
-- under the License.
 
14
 
 
15
-- To create the database:
 
16
--   CREATE DATABASE blog;
 
17
--   GRANT ALL PRIVILEGES ON blog.* TO 'blog'@'localhost' IDENTIFIED BY 'blog';
 
18
--
 
19
-- To reload the tables:
 
20
--   mysql --user=blog --password=blog --database=blog < schema.sql
 
21
 
 
22
SET SESSION storage_engine = "InnoDB";
 
23
SET SESSION time_zone = "+0:00";
 
24
ALTER DATABASE CHARACTER SET "utf8";
 
25
 
 
26
DROP TABLE IF EXISTS entries;
 
27
CREATE TABLE entries (
 
28
    id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
 
29
    author_id INT NOT NULL REFERENCES authors(id),
 
30
    slug VARCHAR(100) NOT NULL UNIQUE,
 
31
    title VARCHAR(512) NOT NULL,
 
32
    markdown MEDIUMTEXT NOT NULL,
 
33
    html MEDIUMTEXT NOT NULL,
 
34
    published DATETIME NOT NULL,
 
35
    updated TIMESTAMP NOT NULL,
 
36
    KEY (published)
 
37
);
 
38
 
 
39
DROP TABLE IF EXISTS authors;
 
40
CREATE TABLE authors (
 
41
    id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
 
42
    email VARCHAR(100) NOT NULL UNIQUE,
 
43
    name VARCHAR(100) NOT NULL
 
44
);