-- This file is autogenerated by the Rail schema generator, using
-- the schema defined in db/migration/*.rb
--
-- Do not edit this file.  Instead, add a new migration using
-- ./script/generate migration <name>, and then run
-- ./script/generate schema

-- tables 

CREATE TABLE articles_tags (
  "article_id" integer DEFAULT NULL,
  "tag_id" integer DEFAULT NULL
);

CREATE TABLE blacklist_patterns (
  "id" serial primary key,
  "type" character varying(255) DEFAULT NULL,
  "pattern" character varying(255) DEFAULT NULL
);

CREATE TABLE blogs (
  "id" serial primary key,
  "settings" text DEFAULT NULL,
  "base_url" character varying(255) DEFAULT NULL
);

CREATE TABLE categories (
  "id" serial primary key,
  "name" character varying(255) DEFAULT NULL,
  "position" integer DEFAULT NULL,
  "permalink" character varying(255) DEFAULT NULL
);

CREATE TABLE categorizations (
  "id" serial primary key,
  "article_id" integer DEFAULT NULL,
  "category_id" integer DEFAULT NULL,
  "is_primary" boolean DEFAULT NULL
);

CREATE TABLE contents (
  "id" serial primary key,
  "type" character varying(255) DEFAULT NULL,
  "title" character varying(255) DEFAULT NULL,
  "author" character varying(255) DEFAULT NULL,
  "body" text DEFAULT NULL,
  "extended" text DEFAULT NULL,
  "excerpt" text DEFAULT NULL,
  "keywords" character varying(255) DEFAULT NULL,
  "created_at" timestamp DEFAULT NULL,
  "updated_at" timestamp DEFAULT NULL,
  "user_id" integer DEFAULT NULL,
  "permalink" character varying(255) DEFAULT NULL,
  "guid" character varying(255) DEFAULT NULL,
  "text_filter_id" integer DEFAULT NULL,
  "whiteboard" text DEFAULT NULL,
  "name" character varying(255) DEFAULT NULL,
  "published" boolean DEFAULT 'f',
  "allow_pings" boolean DEFAULT NULL,
  "allow_comments" boolean DEFAULT NULL,
  "blog_id" integer NOT NULL,
  "published_at" timestamp DEFAULT NULL,
  "state" text DEFAULT NULL
);

CREATE TABLE feedback (
  "id" serial primary key,
  "type" character varying(255) DEFAULT NULL,
  "title" character varying(255) DEFAULT NULL,
  "author" character varying(255) DEFAULT NULL,
  "body" text DEFAULT NULL,
  "extended" text DEFAULT NULL,
  "excerpt" text DEFAULT NULL,
  "keywords" character varying(255) DEFAULT NULL,
  "created_at" timestamp DEFAULT NULL,
  "updated_at" timestamp DEFAULT NULL,
  "user_id" integer DEFAULT NULL,
  "permalink" character varying(255) DEFAULT NULL,
  "guid" character varying(255) DEFAULT NULL,
  "text_filter_id" integer DEFAULT NULL,
  "whiteboard" text DEFAULT NULL,
  "article_id" integer DEFAULT NULL,
  "email" character varying(255) DEFAULT NULL,
  "url" character varying(255) DEFAULT NULL,
  "ip" character varying(40) DEFAULT NULL,
  "blog_name" character varying(255) DEFAULT NULL,
  "name" character varying(255) DEFAULT NULL,
  "published" boolean DEFAULT 'f',
  "allow_pings" boolean DEFAULT NULL,
  "allow_comments" boolean DEFAULT NULL,
  "blog_id" integer NOT NULL,
  "published_at" timestamp DEFAULT NULL,
  "state" text DEFAULT NULL,
  "status_confirmed" boolean DEFAULT NULL
);

CREATE TABLE notifications (
  "id" serial primary key,
  "content_id" integer DEFAULT NULL,
  "user_id" integer DEFAULT NULL,
  "created_at" timestamp DEFAULT NULL,
  "updated_at" timestamp DEFAULT NULL
);

CREATE TABLE page_caches (
  "id" serial primary key,
  "name" character varying(255) DEFAULT NULL
);

CREATE TABLE pings (
  "id" serial primary key,
  "article_id" integer DEFAULT NULL,
  "url" character varying(255) DEFAULT NULL,
  "created_at" timestamp DEFAULT NULL
);

CREATE TABLE redirects (
  "id" serial primary key,
  "from_path" character varying(255) DEFAULT NULL,
  "to_path" character varying(255) DEFAULT NULL
);

CREATE TABLE resources (
  "id" serial primary key,
  "size" integer DEFAULT NULL,
  "filename" character varying(255) DEFAULT NULL,
  "mime" character varying(255) DEFAULT NULL,
  "created_at" timestamp DEFAULT NULL,
  "updated_at" timestamp DEFAULT NULL,
  "article_id" integer DEFAULT NULL,
  "itunes_metadata" boolean DEFAULT NULL,
  "itunes_author" character varying(255) DEFAULT NULL,
  "itunes_subtitle" character varying(255) DEFAULT NULL,
  "itunes_duration" integer DEFAULT NULL,
  "itunes_summary" text DEFAULT NULL,
  "itunes_keywords" character varying(255) DEFAULT NULL,
  "itunes_category" character varying(255) DEFAULT NULL,
  "itunes_explicit" boolean DEFAULT NULL
);

CREATE TABLE sessions (
  "id" serial primary key,
  "sessid" character varying(255) DEFAULT NULL,
  "data" text DEFAULT NULL,
  "created_at" timestamp DEFAULT NULL,
  "updated_at" timestamp DEFAULT NULL
);

CREATE TABLE sidebars (
  "id" serial primary key,
  "active_position" integer DEFAULT NULL,
  "config" text DEFAULT NULL,
  "staged_position" integer DEFAULT NULL,
  "type" character varying(255) DEFAULT NULL,
  "blog_id" integer DEFAULT NULL
);

CREATE TABLE tags (
  "id" serial primary key,
  "name" character varying(255) DEFAULT NULL,
  "created_at" timestamp DEFAULT NULL,
  "updated_at" timestamp DEFAULT NULL,
  "display_name" character varying(255) DEFAULT NULL
);

CREATE TABLE text_filters (
  "id" serial primary key,
  "name" character varying(255) DEFAULT NULL,
  "description" character varying(255) DEFAULT NULL,
  "markup" character varying(255) DEFAULT NULL,
  "filters" text DEFAULT NULL,
  "params" text DEFAULT NULL
);

CREATE TABLE triggers (
  "id" serial primary key,
  "pending_item_id" integer DEFAULT NULL,
  "pending_item_type" character varying(255) DEFAULT NULL,
  "due_at" timestamp DEFAULT NULL,
  "trigger_method" character varying(255) DEFAULT NULL
);

CREATE TABLE users (
  "id" serial primary key,
  "login" character varying(255) DEFAULT NULL,
  "password" character varying(255) DEFAULT NULL,
  "email" text DEFAULT NULL,
  "name" text DEFAULT NULL,
  "notify_via_email" boolean DEFAULT NULL,
  "notify_on_new_articles" boolean DEFAULT NULL,
  "notify_on_comments" boolean DEFAULT NULL,
  "notify_watch_my_articles" boolean DEFAULT NULL,
  "notify_via_jabber" boolean DEFAULT NULL,
  "jabber" character varying(255) DEFAULT NULL
);


-- indexes 

CREATE  INDEX "index_blacklist_patterns_on_pattern" ON blacklist_patterns ("pattern");
CREATE  INDEX "index_categories_on_permalink" ON categories ("permalink");
CREATE  INDEX "index_contents_on_blog_id" ON contents ("blog_id");
CREATE  INDEX "index_contents_on_text_filter_id" ON contents ("text_filter_id");
CREATE  INDEX "index_contents_on_published" ON contents ("published");
CREATE  INDEX "index_feedback_on_text_filter_id" ON feedback ("text_filter_id");
CREATE  INDEX "index_feedback_on_article_id" ON feedback ("article_id");
CREATE  INDEX "index_page_caches_on_name" ON page_caches ("name");
CREATE  INDEX "index_pings_on_article_id" ON pings ("article_id");
CREATE  INDEX "index_sessions_on_sessid" ON sessions ("sessid");

-- data 

INSERT INTO text_filters ("name", "filters", "description", "params", "markup") VALUES('none', '--- []

', 'None', '--- {}

', 'none');
INSERT INTO text_filters ("name", "filters", "description", "params", "markup") VALUES('markdown', '--- []

', 'Markdown', '--- {}

', 'markdown');
INSERT INTO text_filters ("name", "filters", "description", "params", "markup") VALUES('smartypants', '--- 
- :smartypants
', 'SmartyPants', '--- {}

', 'none');
INSERT INTO text_filters ("name", "filters", "description", "params", "markup") VALUES('markdown smartypants', '--- 
- :smartypants
', 'Markdown with SmartyPants', '--- {}

', 'markdown');
INSERT INTO text_filters ("name", "filters", "description", "params", "markup") VALUES('textile', '--- []

', 'Textile', '--- {}

', 'textile');

INSERT INTO sidebars ("id", "active_position", "config", "staged_position", "type", "blog_id") VALUES (1, 0, '--- !map:HashWithIndifferentAccess \nempty: false\ncount: true\n', 0, 'CategorySidebar', 1);
INSERT INTO sidebars ("id", "active_position", "config", "staged_position", "type", "blog_id") VALUES (2, 2, '--- !map:HashWithIndifferentAccess \nformat: rss20\ntrackbacks: false\ncomments: true\narticles: true\n', 2, 'XmlSidebar', 1);
INSERT INTO sidebars ("id", "active_position", "config", "staged_position", "type", "blog_id") VALUES (3, 1, '--- !map:HashWithIndifferentAccess \nbody: "<ul>\\n  <li><a href=\\"http://www.typosphere.org\\" title=\\"Typo\\">Typo</a></li>\\n  <li><a href=\\"http://blog.leetsoft.com\\" title=\\"too-biased\\">too-biased</a></li>\\n  <li><a href=\\"http://blog.remor.com/\\" title=\\"seth hall\\">Seth Hall</a></li>\\n  <li><a href=\\"http://scottstuff.net\\" title=\\"Scottstuff\\">scottstuff.net</a></li>\\n  <li><a href=\\"http://www.bofh.org.uk\\" title=\\"Just a Summary\\">Just A Summary</a></li>\\n  <li><a href=\\"http://nubyonrails.com\\" title=\\"Topfunky\\">Topfunky</a></li>\\n  <li><a href=\\"http://planettypo.com\\" title=\\"PlanetTypo\\">PlanetTypo</a></li>\\n  <li><a href=\\"http://typoforums.org\\" title=\\"Typo Forums\\">Typo Forums</a></li>\\n  <li><a href=\\"http://fredericdevillamil.com\\" title=\\"Fr\\xC3\\xA9d\\xC3\\xA9ric de Villamil\\">Fr\\xC3\\xA9d\\xC3\\xA9ric de Villamil</a></li>\\n\\\n  </ul>\\n"\ntitle: Links\n', NULL, 'StaticSidebar', 1);


-- schema version meta-info 

CREATE TABLE schema_info (
  "version" integer DEFAULT NULL
);

insert into schema_info (version) values (61);
