-
Notifications
You must be signed in to change notification settings - Fork 0
/
migrations.toml
211 lines (180 loc) · 6.48 KB
/
migrations.toml
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
# This file is auto-generated by Turbosql.
# It is used to create and apply automatic schema migrations.
# It should be checked into source control.
# Modifying it by hand may be dangerous; see the docs.
migrations_append_only = [
"CREATE TABLE setting (rowid INTEGER PRIMARY KEY) STRICT",
"ALTER TABLE setting ADD COLUMN key TEXT NOT NULL DEFAULT ''",
"ALTER TABLE setting ADD COLUMN value TEXT NOT NULL DEFAULT ''",
"CREATE TABLE card (rowid INTEGER PRIMARY KEY) STRICT",
"ALTER TABLE card ADD COLUMN deleted INTEGER NOT NULL DEFAULT false",
"ALTER TABLE card ADD COLUMN title TEXT NOT NULL DEFAULT ''",
"ALTER TABLE card ADD COLUMN question TEXT NOT NULL DEFAULT ''",
"ALTER TABLE card ADD COLUMN answer TEXT NOT NULL DEFAULT ''",
"ALTER TABLE card ADD COLUMN last_question_viewed_ms INTEGER NOT NULL DEFAULT 0",
"ALTER TABLE card ADD COLUMN last_answer_viewed_ms INTEGER NOT NULL DEFAULT 0",
"CREATE TABLE cardlog (rowid INTEGER PRIMARY KEY) STRICT",
"ALTER TABLE cardlog ADD COLUMN card_id INTEGER NOT NULL DEFAULT 0",
"ALTER TABLE cardlog ADD COLUMN time_ms INTEGER NOT NULL DEFAULT 0",
"ALTER TABLE cardlog ADD COLUMN action TEXT NOT NULL DEFAULT ''",
"CREATE TABLE sampledata (rowid INTEGER PRIMARY KEY) STRICT",
"ALTER TABLE sampledata ADD COLUMN record_ms INTEGER NOT NULL DEFAULT 0",
"ALTER TABLE sampledata ADD COLUMN sample_data BLOB NOT NULL DEFAULT ''",
"CREATE TABLE prompt (rowid INTEGER PRIMARY KEY) STRICT",
"ALTER TABLE prompt ADD COLUMN time_ms INTEGER NOT NULL DEFAULT 0",
"ALTER TABLE prompt ADD COLUMN prompt TEXT NOT NULL DEFAULT ''",
"CREATE TABLE document (rowid INTEGER PRIMARY KEY) STRICT",
"ALTER TABLE document ADD COLUMN title TEXT NOT NULL DEFAULT ''",
"ALTER TABLE document ADD COLUMN content TEXT NOT NULL DEFAULT ''",
"ALTER TABLE document ADD COLUMN timestamp_ms INTEGER NOT NULL DEFAULT 0",
]
output_generated_schema_for_your_information_do_not_edit = """
CREATE TABLE _turbosql_migrations (
rowid INTEGER PRIMARY KEY,
migration TEXT NOT NULL
) STRICT
CREATE TABLE card (
rowid INTEGER PRIMARY KEY,
deleted INTEGER NOT NULL DEFAULT false,
title TEXT NOT NULL DEFAULT '',
question TEXT NOT NULL DEFAULT '',
answer TEXT NOT NULL DEFAULT '',
last_question_viewed_ms INTEGER NOT NULL DEFAULT 0,
last_answer_viewed_ms INTEGER NOT NULL DEFAULT 0
) STRICT
CREATE TABLE cardlog (
rowid INTEGER PRIMARY KEY,
card_id INTEGER NOT NULL DEFAULT 0,
time_ms INTEGER NOT NULL DEFAULT 0,
action TEXT NOT NULL DEFAULT ''
) STRICT
CREATE TABLE document (
rowid INTEGER PRIMARY KEY,
title TEXT NOT NULL DEFAULT '',
content TEXT NOT NULL DEFAULT '',
timestamp_ms INTEGER NOT NULL DEFAULT 0
) STRICT
CREATE TABLE prompt (
rowid INTEGER PRIMARY KEY,
time_ms INTEGER NOT NULL DEFAULT 0,
prompt TEXT NOT NULL DEFAULT ''
) STRICT
CREATE TABLE sampledata (
rowid INTEGER PRIMARY KEY,
record_ms INTEGER NOT NULL DEFAULT 0,
sample_data BLOB NOT NULL DEFAULT ''
) STRICT
CREATE TABLE setting (
rowid INTEGER PRIMARY KEY,
key TEXT NOT NULL DEFAULT '',
value TEXT NOT NULL DEFAULT ''
) STRICT
"""
[output_generated_tables_do_not_edit.card]
name = "card"
[[output_generated_tables_do_not_edit.card.columns]]
name = "rowid"
rust_type = "Option < i64 >"
sql_type = "INTEGER PRIMARY KEY"
[[output_generated_tables_do_not_edit.card.columns]]
name = "deleted"
rust_type = "bool"
sql_type = "INTEGER NOT NULL"
[[output_generated_tables_do_not_edit.card.columns]]
name = "title"
rust_type = "String"
sql_type = "TEXT NOT NULL"
[[output_generated_tables_do_not_edit.card.columns]]
name = "question"
rust_type = "String"
sql_type = "TEXT NOT NULL"
[[output_generated_tables_do_not_edit.card.columns]]
name = "answer"
rust_type = "String"
sql_type = "TEXT NOT NULL"
[[output_generated_tables_do_not_edit.card.columns]]
name = "last_question_viewed_ms"
rust_type = "i64"
sql_type = "INTEGER NOT NULL"
[[output_generated_tables_do_not_edit.card.columns]]
name = "last_answer_viewed_ms"
rust_type = "i64"
sql_type = "INTEGER NOT NULL"
[output_generated_tables_do_not_edit.cardlog]
name = "cardlog"
[[output_generated_tables_do_not_edit.cardlog.columns]]
name = "rowid"
rust_type = "Option < i64 >"
sql_type = "INTEGER PRIMARY KEY"
[[output_generated_tables_do_not_edit.cardlog.columns]]
name = "card_id"
rust_type = "i64"
sql_type = "INTEGER NOT NULL"
[[output_generated_tables_do_not_edit.cardlog.columns]]
name = "time_ms"
rust_type = "i64"
sql_type = "INTEGER NOT NULL"
[[output_generated_tables_do_not_edit.cardlog.columns]]
name = "action"
rust_type = "Action"
sql_type = "TEXT NOT NULL"
[output_generated_tables_do_not_edit.document]
name = "document"
[[output_generated_tables_do_not_edit.document.columns]]
name = "rowid"
rust_type = "Option < i64 >"
sql_type = "INTEGER PRIMARY KEY"
[[output_generated_tables_do_not_edit.document.columns]]
name = "title"
rust_type = "String"
sql_type = "TEXT NOT NULL"
[[output_generated_tables_do_not_edit.document.columns]]
name = "content"
rust_type = "String"
sql_type = "TEXT NOT NULL"
[[output_generated_tables_do_not_edit.document.columns]]
name = "timestamp_ms"
rust_type = "i64"
sql_type = "INTEGER NOT NULL"
[output_generated_tables_do_not_edit.prompt]
name = "prompt"
[[output_generated_tables_do_not_edit.prompt.columns]]
name = "rowid"
rust_type = "Option < i64 >"
sql_type = "INTEGER PRIMARY KEY"
[[output_generated_tables_do_not_edit.prompt.columns]]
name = "time_ms"
rust_type = "i64"
sql_type = "INTEGER NOT NULL"
[[output_generated_tables_do_not_edit.prompt.columns]]
name = "prompt"
rust_type = "String"
sql_type = "TEXT NOT NULL"
[output_generated_tables_do_not_edit.sampledata]
name = "sampledata"
[[output_generated_tables_do_not_edit.sampledata.columns]]
name = "rowid"
rust_type = "Option < i64 >"
sql_type = "INTEGER PRIMARY KEY"
[[output_generated_tables_do_not_edit.sampledata.columns]]
name = "record_ms"
rust_type = "i64"
sql_type = "INTEGER NOT NULL"
[[output_generated_tables_do_not_edit.sampledata.columns]]
name = "sample_data"
rust_type = "Blob"
sql_type = "BLOB NOT NULL"
[output_generated_tables_do_not_edit.setting]
name = "setting"
[[output_generated_tables_do_not_edit.setting.columns]]
name = "rowid"
rust_type = "Option < i64 >"
sql_type = "INTEGER PRIMARY KEY"
[[output_generated_tables_do_not_edit.setting.columns]]
name = "key"
rust_type = "String"
sql_type = "TEXT NOT NULL"
[[output_generated_tables_do_not_edit.setting.columns]]
name = "value"
rust_type = "String"
sql_type = "TEXT NOT NULL"