blob: 014d98ce12812a87d74922e9e403f2481f4b97f5 [file] [log] [blame]
Florina Muntenescu0d59e252017-09-13 14:42:03 +01001{
2 "formatVersion": 1,
3 "database": {
4 "version": 1,
Yigit Boyar9e828632018-02-05 18:36:08 -08005 "identityHash": "f78c9a055453bd6db377a3fcc3007e54",
Florina Muntenescu0d59e252017-09-13 14:42:03 +01006 "entities": [
7 {
8 "tableName": "Book",
Yigit Boyar3ea1d112017-12-18 09:53:26 -08009 "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`bookId` TEXT NOT NULL, `title` TEXT NOT NULL, `bookPublisherId` TEXT NOT NULL, `languages` INTEGER NOT NULL, `salesCnt` INTEGER NOT NULL, PRIMARY KEY(`bookId`), FOREIGN KEY(`bookPublisherId`) REFERENCES `Publisher`(`publisherId`) ON UPDATE NO ACTION ON DELETE NO ACTION DEFERRABLE INITIALLY DEFERRED)",
Florina Muntenescu0d59e252017-09-13 14:42:03 +010010 "fields": [
11 {
12 "fieldPath": "bookId",
13 "columnName": "bookId",
14 "affinity": "TEXT",
15 "notNull": true
16 },
17 {
18 "fieldPath": "title",
19 "columnName": "title",
20 "affinity": "TEXT",
21 "notNull": true
22 },
23 {
24 "fieldPath": "bookPublisherId",
25 "columnName": "bookPublisherId",
26 "affinity": "TEXT",
27 "notNull": true
Yigit Boyar2fb00f12017-12-15 13:18:33 -080028 },
29 {
30 "fieldPath": "languages",
31 "columnName": "languages",
32 "affinity": "INTEGER",
33 "notNull": true
Yigit Boyar3ea1d112017-12-18 09:53:26 -080034 },
35 {
36 "fieldPath": "salesCnt",
37 "columnName": "salesCnt",
38 "affinity": "INTEGER",
39 "notNull": true
Florina Muntenescu0d59e252017-09-13 14:42:03 +010040 }
41 ],
42 "primaryKey": {
43 "columnNames": [
44 "bookId"
45 ],
46 "autoGenerate": false
47 },
48 "indices": [],
49 "foreignKeys": [
50 {
51 "table": "Publisher",
52 "onDelete": "NO ACTION",
53 "onUpdate": "NO ACTION",
54 "columns": [
55 "bookPublisherId"
56 ],
57 "referencedColumns": [
58 "publisherId"
59 ]
60 }
61 ]
62 },
63 {
64 "tableName": "Author",
65 "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`authorId` TEXT NOT NULL, `name` TEXT NOT NULL, `dateOfBirth` INTEGER, `aList` TEXT, PRIMARY KEY(`authorId`))",
66 "fields": [
67 {
68 "fieldPath": "authorId",
69 "columnName": "authorId",
70 "affinity": "TEXT",
71 "notNull": true
72 },
73 {
74 "fieldPath": "name",
75 "columnName": "name",
76 "affinity": "TEXT",
77 "notNull": true
78 },
79 {
80 "fieldPath": "dateOfBirth",
81 "columnName": "dateOfBirth",
82 "affinity": "INTEGER",
83 "notNull": false
84 },
85 {
86 "fieldPath": "aList",
87 "columnName": "aList",
88 "affinity": "TEXT",
89 "notNull": false
90 }
91 ],
92 "primaryKey": {
93 "columnNames": [
94 "authorId"
95 ],
96 "autoGenerate": false
97 },
98 "indices": [],
99 "foreignKeys": []
100 },
101 {
102 "tableName": "Publisher",
103 "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`publisherId` TEXT NOT NULL, `name` TEXT NOT NULL, PRIMARY KEY(`publisherId`))",
104 "fields": [
105 {
106 "fieldPath": "publisherId",
107 "columnName": "publisherId",
108 "affinity": "TEXT",
109 "notNull": true
110 },
111 {
112 "fieldPath": "name",
113 "columnName": "name",
114 "affinity": "TEXT",
115 "notNull": true
116 }
117 ],
118 "primaryKey": {
119 "columnNames": [
120 "publisherId"
121 ],
122 "autoGenerate": false
123 },
124 "indices": [],
125 "foreignKeys": []
126 },
127 {
128 "tableName": "BookAuthor",
129 "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`bookId` TEXT NOT NULL, `authorId` TEXT NOT NULL, PRIMARY KEY(`bookId`, `authorId`), FOREIGN KEY(`bookId`) REFERENCES `Book`(`bookId`) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED, FOREIGN KEY(`authorId`) REFERENCES `Author`(`authorId`) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED)",
130 "fields": [
131 {
132 "fieldPath": "bookId",
133 "columnName": "bookId",
134 "affinity": "TEXT",
135 "notNull": true
136 },
137 {
138 "fieldPath": "authorId",
139 "columnName": "authorId",
140 "affinity": "TEXT",
141 "notNull": true
142 }
143 ],
144 "primaryKey": {
145 "columnNames": [
146 "bookId",
147 "authorId"
148 ],
149 "autoGenerate": false
150 },
151 "indices": [],
152 "foreignKeys": [
153 {
154 "table": "Book",
155 "onDelete": "CASCADE",
156 "onUpdate": "CASCADE",
157 "columns": [
158 "bookId"
159 ],
160 "referencedColumns": [
161 "bookId"
162 ]
163 },
164 {
165 "table": "Author",
166 "onDelete": "CASCADE",
167 "onUpdate": "CASCADE",
168 "columns": [
169 "authorId"
170 ],
171 "referencedColumns": [
172 "authorId"
173 ]
174 }
175 ]
Yigit Boyarb9ea7342017-10-04 15:59:39 -0700176 },
177 {
178 "tableName": "NoArgClass",
179 "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `class_name` TEXT NOT NULL, PRIMARY KEY(`id`))",
180 "fields": [
181 {
182 "fieldPath": "id",
183 "columnName": "id",
184 "affinity": "INTEGER",
185 "notNull": true
186 },
187 {
188 "fieldPath": "class_name",
189 "columnName": "class_name",
190 "affinity": "TEXT",
191 "notNull": true
192 }
193 ],
194 "primaryKey": {
195 "columnNames": [
196 "id"
197 ],
198 "autoGenerate": false
199 },
200 "indices": [],
201 "foreignKeys": []
Yigit Boyar9e828632018-02-05 18:36:08 -0800202 },
203 {
204 "tableName": "DataClassFromDependency",
205 "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `name` TEXT NOT NULL)",
206 "fields": [
207 {
208 "fieldPath": "id",
209 "columnName": "id",
210 "affinity": "INTEGER",
211 "notNull": true
212 },
213 {
214 "fieldPath": "name",
215 "columnName": "name",
216 "affinity": "TEXT",
217 "notNull": true
218 }
219 ],
220 "primaryKey": {
221 "columnNames": [
222 "id"
223 ],
224 "autoGenerate": true
225 },
226 "indices": [],
227 "foreignKeys": []
Florina Muntenescu0d59e252017-09-13 14:42:03 +0100228 }
229 ],
230 "setupQueries": [
231 "CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
Yigit Boyar9e828632018-02-05 18:36:08 -0800232 "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, \"f78c9a055453bd6db377a3fcc3007e54\")"
Florina Muntenescu0d59e252017-09-13 14:42:03 +0100233 ]
234 }
235}