-
Notifications
You must be signed in to change notification settings - Fork 3.7k
/
schema.sqlite.sql
196 lines (170 loc) · 4.92 KB
/
schema.sqlite.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
-- 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 (
id INTEGER PRIMARY KEY NOT NULL,
title varchar(255),
author varchar(255),
body text,
body_html text,
extended text,
excerpt text,
keywords varchar(255),
allow_comments integer,
allow_pings integer,
published integer DEFAULT '1',
created_at datetime,
updated_at datetime,
extended_html text,
guid varchar(255),
permalink varchar(255),
user_id integer,
text_filter_id integer
);
CREATE TABLE articles_categories (
article_id integer,
category_id integer,
is_primary integer
);
CREATE TABLE articles_tags (
article_id integer,
tag_id integer
);
CREATE TABLE blacklist_patterns (
id INTEGER PRIMARY KEY NOT NULL,
type varchar(255),
pattern varchar(255)
);
CREATE TABLE categories (
id INTEGER PRIMARY KEY NOT NULL,
name varchar(255),
position integer,
permalink varchar(255)
);
CREATE TABLE comments (
id INTEGER PRIMARY KEY NOT NULL,
article_id integer,
title varchar(255),
author varchar(255),
email varchar(255),
url varchar(255),
ip varchar(255),
body text,
body_html text,
created_at datetime,
updated_at datetime,
user_id integer,
guid varchar(255)
);
CREATE TABLE page_caches (
id INTEGER PRIMARY KEY NOT NULL,
name varchar(255)
);
CREATE TABLE pages (
id INTEGER PRIMARY KEY NOT NULL,
name varchar(255),
user_id integer,
body text,
body_html text,
created_at datetime,
updated_at datetime,
title varchar(255),
text_filter_id integer
);
CREATE TABLE pings (
id INTEGER PRIMARY KEY NOT NULL,
article_id integer,
url varchar(255),
created_at datetime
);
CREATE TABLE resources (
id INTEGER PRIMARY KEY NOT NULL,
size integer,
filename varchar(255),
mime varchar(255),
created_at datetime,
updated_at datetime,
article_id integer
);
CREATE TABLE sessions (
id INTEGER PRIMARY KEY NOT NULL,
sessid varchar(255),
data text,
created_at datetime,
updated_at datetime
);
CREATE TABLE settings (
id INTEGER PRIMARY KEY NOT NULL,
name varchar(255),
value varchar(255),
position integer
);
CREATE TABLE sidebars (
id INTEGER PRIMARY KEY NOT NULL,
controller varchar(255),
active_position integer,
active_config text,
staged_position integer,
staged_config text
);
CREATE TABLE tags (
id INTEGER PRIMARY KEY NOT NULL,
name varchar(255),
created_at datetime,
updated_at datetime
);
CREATE TABLE text_filters (
id INTEGER PRIMARY KEY NOT NULL,
name varchar(255),
description varchar(255),
markup varchar(255),
filters text,
params text
);
CREATE TABLE trackbacks (
id INTEGER PRIMARY KEY NOT NULL,
article_id integer,
blog_name varchar(255),
title varchar(255),
excerpt varchar(255),
url varchar(255),
ip varchar(255),
created_at datetime,
updated_at datetime,
guid varchar(255)
);
CREATE TABLE users (
id INTEGER PRIMARY KEY NOT NULL,
login varchar(255),
password varchar(255),
email text,
name text
);
-- indexes
CREATE INDEX articles_permalink_index ON articles (permalink);
CREATE INDEX blacklist_patterns_pattern_index ON blacklist_patterns (pattern);
CREATE INDEX categories_permalink_index ON categories (permalink);
CREATE INDEX comments_article_id_index ON comments (article_id);
CREATE INDEX page_caches_name_index ON page_caches (name);
CREATE INDEX pings_article_id_index ON pings (article_id);
CREATE INDEX trackbacks_article_id_index ON trackbacks (article_id);
-- data
INSERT INTO sidebars ('staged_position', 'active_config', 'active_position', 'controller', 'staged_config') VALUES(NULL, NULL, 0, 'category', NULL);
INSERT INTO sidebars ('staged_position', 'active_config', 'active_position', 'controller', 'staged_config') VALUES(NULL, NULL, 1, 'static', NULL);
INSERT INTO sidebars ('staged_position', 'active_config', 'active_position', 'controller', 'staged_config') VALUES(NULL, NULL, 2, 'xml', NULL);
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');
-- schema version meta-info
CREATE TABLE schema_info (
version integer
);
insert into schema_info (version) values (18);