Permalink
Browse files

added postgres schema [Robby Russell]

git-svn-id: http://svn.typosphere.org/typo/trunk@80 820eb932-12ee-0310-9ca8-eeb645f39767
  • Loading branch information...
tobi
tobi committed Mar 13, 2005
1 parent 1bc7c6e commit 2b734efebe5d6029c624bf5b72f3544a5896711c
Showing with 78 additions and 0 deletions.
  1. +78 −0 db/schema.psql.sql
View
@@ -0,0 +1,78 @@
--
-- PostgreSQL schema file for Type
-- Modified by Robby Russell <robby@planetargon.com>
--
CREATE TABLE articles (
id SERIAL PRIMARY KEY NOT NULL,
title varchar(255) default NULL,
author varchar(255) default NULL,
body text,
body_html text,
extended text,
excerpt text,
keywords varchar(255) default NULL,
allow_comments int default NULL,
allow_pings int default NULL,
published int NOT NULL default '1',
created_at TIMESTAMP DEFAULT now(),
updated_at TIMESTAMP DEFAULT now()
);
CREATE TABLE categories (
id SERIAL PRIMARY KEY NOT NULL,
name varchar(255) default NULL,
position int NOT NULL default '0'
);
INSERT INTO categories (name, position) VALUES ('RubyOnRails', 1);
INSERT INTO categories (name, position) VALUES ('Typo', 2);
CREATE TABLE articles_categories (
article_id int REFERENCES articles,
category_id int REFERENCES categories,
primary_item int default NULL
);
CREATE TABLE comments (
id SERIAL PRIMARY KEY NOT NULL,
article_id int REFERENCES articles,
title varchar(255) default NULL,
author varchar(255) default NULL,
email varchar(255) default NULL,
url varchar(255) default NULL,
body text,
body_html text,
created_at TIMESTAMP DEFAULT now(),
updated_at TIMESTAMP DEFAULT now()
);
CREATE TABLE resources (
id SERIAL PRIMARY KEY NOT NULL,
size int default NULL,
filename varchar(255) default NULL,
mime varchar(255) default NULL,
created_at TIMESTAMP DEFAULT now(),
updated_at TIMESTAMP DEFAULT now()
);
CREATE TABLE sidebar_blocks (
id SERIAL PRIMARY KEY NOT NULL,
type varchar(255) default NULL,
data text,
position int default NULL
);
CREATE TABLE trackbacks (
id SERIAL PRIMARY KEY NOT NULL,
article_id int REFERENCES articles,
blog_name varchar(255) default NULL,
title varchar(255) default NULL,
excerpt varchar(255) default NULL,
url varchar(255) default NULL,
ip varchar(15) default NULL,
created_at TIMESTAMP DEFAULT now(),
updated_at TIMESTAMP DEFAULT now()
);

1 comment on commit 2b734ef

@robbyrussell

This comment has been minimized.

Show comment
Hide comment
@robbyrussell

robbyrussell Mar 13, 2015

Where are the DB indexes!? ;-)

robbyrussell commented on 2b734ef Mar 13, 2015

Where are the DB indexes!? ;-)

Please sign in to comment.