Skip to content

Commit f882e75

Browse files
committed
Added schema
1 parent 840b8c2 commit f882e75

File tree

2 files changed

+138
-0
lines changed

2 files changed

+138
-0
lines changed

Android/app/build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ android {
2323
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
2424
targetSdk 35
2525
minSdk 22
26+
27+
ksp {
28+
arg('room.schemaLocation', "$projectDir/schemas")
29+
}
2630
}
2731

2832
buildTypes {
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
{
2+
"formatVersion": 1,
3+
"database": {
4+
"version": 1,
5+
"identityHash": "25a7e930da7420ab98666632fd3867f2",
6+
"entities": [
7+
{
8+
"tableName": "SkiingActivity",
9+
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`accuracy` REAL NOT NULL, `altitude` REAL NOT NULL, `altitude_accuracy` REAL, `latitude` REAL NOT NULL, `longitude` REAL NOT NULL, `speed` REAL NOT NULL, `speed_accuracy` REAL, `time` INTEGER NOT NULL, `skiing_date_id` INTEGER NOT NULL, PRIMARY KEY(`time`))",
10+
"fields": [
11+
{
12+
"fieldPath": "accuracy",
13+
"columnName": "accuracy",
14+
"affinity": "REAL",
15+
"notNull": true
16+
},
17+
{
18+
"fieldPath": "altitude",
19+
"columnName": "altitude",
20+
"affinity": "REAL",
21+
"notNull": true
22+
},
23+
{
24+
"fieldPath": "altitudeAccuracy",
25+
"columnName": "altitude_accuracy",
26+
"affinity": "REAL",
27+
"notNull": false
28+
},
29+
{
30+
"fieldPath": "latitude",
31+
"columnName": "latitude",
32+
"affinity": "REAL",
33+
"notNull": true
34+
},
35+
{
36+
"fieldPath": "longitude",
37+
"columnName": "longitude",
38+
"affinity": "REAL",
39+
"notNull": true
40+
},
41+
{
42+
"fieldPath": "speed",
43+
"columnName": "speed",
44+
"affinity": "REAL",
45+
"notNull": true
46+
},
47+
{
48+
"fieldPath": "speedAccuracy",
49+
"columnName": "speed_accuracy",
50+
"affinity": "REAL",
51+
"notNull": false
52+
},
53+
{
54+
"fieldPath": "time",
55+
"columnName": "time",
56+
"affinity": "INTEGER",
57+
"notNull": true
58+
},
59+
{
60+
"fieldPath": "skiingDateId",
61+
"columnName": "skiing_date_id",
62+
"affinity": "INTEGER",
63+
"notNull": true
64+
}
65+
],
66+
"primaryKey": {
67+
"autoGenerate": false,
68+
"columnNames": [
69+
"time"
70+
]
71+
},
72+
"indices": [
73+
{
74+
"name": "index_SkiingActivity_time",
75+
"unique": true,
76+
"columnNames": [
77+
"time"
78+
],
79+
"orders": [],
80+
"createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_SkiingActivity_time` ON `${TABLE_NAME}` (`time`)"
81+
}
82+
],
83+
"foreignKeys": []
84+
},
85+
{
86+
"tableName": "SkiingDate",
87+
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `longDate` TEXT NOT NULL, `shortDate` TEXT NOT NULL)",
88+
"fields": [
89+
{
90+
"fieldPath": "id",
91+
"columnName": "id",
92+
"affinity": "INTEGER",
93+
"notNull": true
94+
},
95+
{
96+
"fieldPath": "longDate",
97+
"columnName": "longDate",
98+
"affinity": "TEXT",
99+
"notNull": true
100+
},
101+
{
102+
"fieldPath": "shortDate",
103+
"columnName": "shortDate",
104+
"affinity": "TEXT",
105+
"notNull": true
106+
}
107+
],
108+
"primaryKey": {
109+
"autoGenerate": true,
110+
"columnNames": [
111+
"id"
112+
]
113+
},
114+
"indices": [
115+
{
116+
"name": "index_SkiingDate_shortDate",
117+
"unique": true,
118+
"columnNames": [
119+
"shortDate"
120+
],
121+
"orders": [],
122+
"createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_SkiingDate_shortDate` ON `${TABLE_NAME}` (`shortDate`)"
123+
}
124+
],
125+
"foreignKeys": []
126+
}
127+
],
128+
"views": [],
129+
"setupQueries": [
130+
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
131+
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '25a7e930da7420ab98666632fd3867f2')"
132+
]
133+
}
134+
}

0 commit comments

Comments
 (0)