citrusbyte / quiki

Super simple wiki targeted at developers

quiki / db / development_structure.sql
100644 410 lines (270 sloc) 8.984 kb
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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
--
-- PostgreSQL database dump
--
 
SET client_encoding = 'UTF8';
SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET escape_string_warning = off;
 
--
-- Name: SCHEMA public; Type: COMMENT; Schema: -; Owner: -
--
 
COMMENT ON SCHEMA public IS 'standard public schema';
 
 
SET search_path = public, pg_catalog;
 
SET default_tablespace = '';
 
SET default_with_oids = false;
 
--
-- Name: code_blocks; Type: TABLE; Schema: public; Owner: -; Tablespace:
--
 
CREATE TABLE code_blocks (
    id integer NOT NULL,
    page_id integer,
    version integer,
    "language" character varying(255),
    code text,
    highlighted text,
    theme character varying(255),
    created_at timestamp without time zone
);
 
 
--
-- Name: code_blocks_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
 
CREATE SEQUENCE code_blocks_id_seq
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;
 
 
--
-- Name: code_blocks_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
 
ALTER SEQUENCE code_blocks_id_seq OWNED BY code_blocks.id;
 
 
--
-- Name: destinations; Type: TABLE; Schema: public; Owner: -; Tablespace:
--
 
CREATE TABLE destinations (
    id integer NOT NULL,
    name character varying(255),
    url character varying(255),
    created_at timestamp without time zone,
    updated_at timestamp without time zone
);
 
 
--
-- Name: destinations_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
 
CREATE SEQUENCE destinations_id_seq
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;
 
 
--
-- Name: destinations_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
 
ALTER SEQUENCE destinations_id_seq OWNED BY destinations.id;
 
 
--
-- Name: page_versions; Type: TABLE; Schema: public; Owner: -; Tablespace:
--
 
CREATE TABLE page_versions (
    id integer NOT NULL,
    page_id integer,
    version integer,
    path character varying(255) DEFAULT NULL::character varying,
    body text,
    rendered text,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    parser character varying(255) DEFAULT NULL::character varying,
    section_id integer,
    title character varying(255) NOT NULL
);
 
 
--
-- Name: page_versions_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
 
CREATE SEQUENCE page_versions_id_seq
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;
 
 
--
-- Name: page_versions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
 
ALTER SEQUENCE page_versions_id_seq OWNED BY page_versions.id;
 
 
--
-- Name: pages; Type: TABLE; Schema: public; Owner: -; Tablespace:
--
 
CREATE TABLE pages (
    id integer NOT NULL,
    path character varying(255) NOT NULL,
    body text,
    rendered text,
    created_at timestamp without time zone,
    updated_at timestamp without time zone,
    parser character varying(255),
    version integer DEFAULT 0 NOT NULL,
    section_id integer,
    title character varying(255) NOT NULL
);
 
 
--
-- Name: pages_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
 
CREATE SEQUENCE pages_id_seq
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;
 
 
--
-- Name: pages_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
 
ALTER SEQUENCE pages_id_seq OWNED BY pages.id;
 
 
--
-- Name: publishings; Type: TABLE; Schema: public; Owner: -; Tablespace:
--
 
CREATE TABLE publishings (
    id integer NOT NULL,
    destination_id integer,
    page_version_id integer,
    created_at timestamp without time zone
);
 
 
--
-- Name: publishings_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
 
CREATE SEQUENCE publishings_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;
 
 
--
-- Name: publishings_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
 
ALTER SEQUENCE publishings_id_seq OWNED BY publishings.id;
 
 
--
-- Name: schema_migrations; Type: TABLE; Schema: public; Owner: -; Tablespace:
--
 
CREATE TABLE schema_migrations (
    version character varying(255) NOT NULL
);
 
 
--
-- Name: sections; Type: TABLE; Schema: public; Owner: -; Tablespace:
--
 
CREATE TABLE sections (
    id integer NOT NULL,
    name character varying(255) DEFAULT NULL::character varying
);
 
 
--
-- Name: sections_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
 
CREATE SEQUENCE sections_id_seq
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;
 
 
--
-- Name: sections_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
 
ALTER SEQUENCE sections_id_seq OWNED BY sections.id;
 
 
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
--
 
ALTER TABLE code_blocks ALTER COLUMN id SET DEFAULT nextval('code_blocks_id_seq'::regclass);
 
 
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
--
 
ALTER TABLE destinations ALTER COLUMN id SET DEFAULT nextval('destinations_id_seq'::regclass);
 
 
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
--
 
ALTER TABLE page_versions ALTER COLUMN id SET DEFAULT nextval('page_versions_id_seq'::regclass);
 
 
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
--
 
ALTER TABLE pages ALTER COLUMN id SET DEFAULT nextval('pages_id_seq'::regclass);
 
 
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
--
 
ALTER TABLE publishings ALTER COLUMN id SET DEFAULT nextval('publishings_id_seq'::regclass);
 
 
--
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
--
 
ALTER TABLE sections ALTER COLUMN id SET DEFAULT nextval('sections_id_seq'::regclass);
 
 
--
-- Name: code_blocks_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
--
 
ALTER TABLE ONLY code_blocks
    ADD CONSTRAINT code_blocks_pkey PRIMARY KEY (id);
 
 
--
-- Name: destinations_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
--
 
ALTER TABLE ONLY destinations
    ADD CONSTRAINT destinations_pkey PRIMARY KEY (id);
 
 
--
-- Name: page_versions_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
--
 
ALTER TABLE ONLY page_versions
    ADD CONSTRAINT page_versions_pkey PRIMARY KEY (id);
 
 
--
-- Name: pages_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
--
 
ALTER TABLE ONLY pages
    ADD CONSTRAINT pages_pkey PRIMARY KEY (id);
 
 
--
-- Name: publishings_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
--
 
ALTER TABLE ONLY publishings
    ADD CONSTRAINT publishings_pkey PRIMARY KEY (id);
 
 
--
-- Name: sections_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
--
 
ALTER TABLE ONLY sections
    ADD CONSTRAINT sections_pkey PRIMARY KEY (id);
 
 
--
-- Name: index_code_blocks_on_created_at; Type: INDEX; Schema: public; Owner: -; Tablespace:
--
 
CREATE INDEX index_code_blocks_on_created_at ON code_blocks USING btree (created_at);
 
 
--
-- Name: index_code_blocks_on_language; Type: INDEX; Schema: public; Owner: -; Tablespace:
--
 
CREATE INDEX index_code_blocks_on_language ON code_blocks USING btree ("language");
 
 
--
-- Name: index_code_blocks_on_page_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
--
 
CREATE INDEX index_code_blocks_on_page_id ON code_blocks USING btree (page_id);
 
 
--
-- Name: index_code_blocks_on_version; Type: INDEX; Schema: public; Owner: -; Tablespace:
--
 
CREATE INDEX index_code_blocks_on_version ON code_blocks USING btree (version);
 
 
--
-- Name: index_page_versions_on_section_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
--
 
CREATE INDEX index_page_versions_on_section_id ON page_versions USING btree (section_id);
 
 
--
-- Name: index_pages_on_path; Type: INDEX; Schema: public; Owner: -; Tablespace:
--
 
CREATE INDEX index_pages_on_path ON pages USING btree (path);
 
 
--
-- Name: index_pages_on_section_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
--
 
CREATE INDEX index_pages_on_section_id ON pages USING btree (section_id);
 
 
--
-- Name: index_publishings_on_destination_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
--
 
CREATE INDEX index_publishings_on_destination_id ON publishings USING btree (destination_id);
 
 
--
-- Name: index_publishings_on_page_version_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
--
 
CREATE INDEX index_publishings_on_page_version_id ON publishings USING btree (page_version_id);
 
 
--
-- Name: unique_schema_migrations; Type: INDEX; Schema: public; Owner: -; Tablespace:
--
 
CREATE UNIQUE INDEX unique_schema_migrations ON schema_migrations USING btree (version);
 
 
--
-- PostgreSQL database dump complete
--
 
INSERT INTO schema_migrations (version) VALUES ('20080710050843');
 
INSERT INTO schema_migrations (version) VALUES ('20080710083826');
 
INSERT INTO schema_migrations (version) VALUES ('20080710091131');
 
INSERT INTO schema_migrations (version) VALUES ('20080710215125');
 
INSERT INTO schema_migrations (version) VALUES ('20080712210113');
 
INSERT INTO schema_migrations (version) VALUES ('20080712230833');
 
INSERT INTO schema_migrations (version) VALUES ('20080718040324');
 
INSERT INTO schema_migrations (version) VALUES ('20080827084511');
 
INSERT INTO schema_migrations (version) VALUES ('20080927224142');