forked from writefreely/writefreely
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsqlite.sql
More file actions
Latest commit
229 lines (181 loc) · 5.17 KB
/
Copy pathsqlite.sql
File metadata and controls
229 lines (181 loc) · 5.17 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
--
-- Database: writefreely
--
-- --------------------------------------------------------
--
-- Table structure for table accesstokens
--
CREATETABLEIF NOT EXISTS `accesstokens` (
token TEXTNOT NULLPRIMARY KEY,
user_id INTEGERNOT NULL,
sudo INTEGERNOT NULL DEFAULT '0',
one_time INTEGERNOT NULL DEFAULT '0',
created DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
expires DATETIME DEFAULT NULL,
user_agent TEXT DEFAULT NULL
);
-- --------------------------------------------------------
--
-- Table structure for table appcontent
--
CREATETABLEIF NOT EXISTS `appcontent` (
id TEXTNOT NULLPRIMARY KEY,
content TEXTNOT NULL,
updated DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
-- --------------------------------------------------------
--
-- Table structure for table appmigrations
--
CREATETABLE `appmigrations` (
`version`INTNOT NULL,
`migrated` DATETIME NOT NULL,
`result`TEXTNOT NULL
);
-- --------------------------------------------------------
--
-- Table structure for table collectionattributes
--
CREATETABLEIF NOT EXISTS `collectionattributes` (
collection_id INTEGERNOT NULL,
attribute TEXTNOT NULL,
value TEXTNOT NULL,
PRIMARY KEY (collection_id, attribute)
);
-- --------------------------------------------------------
--
-- Table structure for table collectionkeys
--
CREATETABLEIF NOT EXISTS `collectionkeys` (
collection_id INTEGERPRIMARY KEY,
public_key blob NOT NULL,
private_key blob NOT NULL
);
-- --------------------------------------------------------
--
-- Table structure for table collectionpasswords
--
CREATETABLEIF NOT EXISTS `collectionpasswords` (
collection_id INTEGERPRIMARY KEY,
password TEXTNOT NULL
);
-- --------------------------------------------------------
--
-- Table structure for table collectionredirects
--
CREATETABLEIF NOT EXISTS `collectionredirects` (
prev_alias TEXTNOT NULLPRIMARY KEY,
new_alias TEXTNOT NULL
);
-- --------------------------------------------------------
--
-- Table structure for table collections
--
CREATETABLEIF NOT EXISTS `collections` (
id INTEGERPRIMARY KEY AUTOINCREMENT,
alias TEXT DEFAULT NULL UNIQUE,
title TEXTNOT NULL,
description TEXTNOT NULL,
style_sheet TEXT,
script TEXT,
format TEXT DEFAULT NULL,
privacy INTEGERNOT NULL,
owner_id INTEGERNOT NULL,
view_count INTEGERNOT NULL
);
-- --------------------------------------------------------
--
-- Table structure for table posts
--
CREATETABLEIF NOT EXISTS `posts` (
id TEXTNOT NULL,
slug TEXT DEFAULT NULL,
modify_token TEXT DEFAULT NULL,
text_appearance TEXTNOT NULL DEFAULT 'norm',
language TEXT DEFAULT NULL,
rtl INTEGER DEFAULT NULL,
privacy INTEGERNOT NULL,
owner_id INTEGER DEFAULT NULL,
collection_id INTEGER DEFAULT NULL,
pinned_position INTEGER UNSIGNED DEFAULT NULL,
created DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
view_count INTEGERNOT NULL,
title TEXTNOT NULL,
content TEXTNOT NULL,
CONSTRAINT id_slug UNIQUE (collection_id, slug),
CONSTRAINT owner_id UNIQUE (owner_id, id),
CONSTRAINT privacy_id UNIQUE (privacy, id)
);
-- --------------------------------------------------------
--
-- Table structure for table remotefollows
--
CREATETABLEIF NOT EXISTS `remotefollows` (
collection_id INTEGERNOT NULL,
remote_user_id INTEGERNOT NULL,
created DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (collection_id,remote_user_id)
);
-- --------------------------------------------------------
--
-- Table structure for table remoteuserkeys
--
CREATETABLEIF NOT EXISTS `remoteuserkeys` (
id TEXTNOT NULL,
remote_user_id INTEGERNOT NULL,
public_key blob NOT NULL,
CONSTRAINT follower_id UNIQUE (remote_user_id)
);
-- --------------------------------------------------------
--
-- Table structure for table remoteusers
--
CREATETABLEIF NOT EXISTS `remoteusers` (
id INTEGERNOT NULLPRIMARY KEY AUTOINCREMENT,
actor_id TEXTNOT NULL,
inbox TEXTNOT NULL,
shared_inbox TEXTNOT NULL,
CONSTRAINT collection_id UNIQUE (actor_id)
);
-- --------------------------------------------------------
--
-- Table structure for table userattributes
--
CREATETABLEIF NOT EXISTS `userattributes` (
user_id INTEGERNOT NULL,
attribute TEXTNOT NULL,
value TEXTNOT NULL,
PRIMARY KEY (user_id, attribute)
);
-- --------------------------------------------------------
--
-- Table structure for table `userinvites`
--
CREATETABLE `userinvites` (
`id`TEXTNOT NULL,
`owner_id`INTEGERNOT NULL,
`max_uses`INTEGER DEFAULT NULL,
`created` DATETIME NOT NULL,
`expires` DATETIME DEFAULT NULL,
`inactive`INTEGERNOT NULL
);
-- --------------------------------------------------------
--
-- Table structure for table users
--
CREATETABLEIF NOT EXISTS `users` (
id INTEGERPRIMARY KEY AUTOINCREMENT,
username TEXTNOT NULL UNIQUE,
password TEXTNOT NULL,
email TEXT DEFAULT NULL,
created DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
-- --------------------------------------------------------
--
-- Table structure for table `usersinvited`
--
CREATETABLE `usersinvited` (
`invite_id`TEXTNOT NULL,
`user_id`INTEGERNOT NULL
);