Skip to content

Commit 7e96bcb

Browse files
committed
adapt migration structure to support better-sqlite3 statements
1 parent fcc4fbd commit 7e96bcb

14 files changed

+163
-759
lines changed

drizzle/0000_create_activity_periods_table.sql

Lines changed: 0 additions & 7 deletions
This file was deleted.

drizzle/0000_panoramic_catseye.sql

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
DROP TABLE IF EXISTS `activity_periods`;
2+
--> statement-breakpoint
3+
DROP TABLE IF EXISTS `settings`;
4+
--> statement-breakpoint
5+
DROP TABLE IF EXISTS `window_activities`;
6+
--> statement-breakpoint
7+
DROP TABLE IF EXISTS `window_activities_new`;
8+
--> statement-breakpoint
9+
CREATE TABLE `activity_periods` (
10+
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
11+
`start` text NOT NULL,
12+
`end` text NOT NULL,
13+
`is_idle` integer NOT NULL,
14+
`created_at` text NOT NULL
15+
);
16+
--> statement-breakpoint
17+
CREATE TABLE `settings` (
18+
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
19+
`key` text NOT NULL,
20+
`value` text NOT NULL,
21+
`updated_at` text NOT NULL
22+
);
23+
--> statement-breakpoint
24+
CREATE UNIQUE INDEX `settings_key_unique` ON `settings` (`key`);
25+
--> statement-breakpoint
26+
CREATE TABLE `window_activities` (
27+
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
28+
`timestamp` text NOT NULL,
29+
`duration_seconds` integer NOT NULL,
30+
`app_name` text NOT NULL,
31+
`window_title` text NOT NULL,
32+
`url` text,
33+
`process_id` integer,
34+
`created_at` text NOT NULL
35+
);

drizzle/0001_add_settings_table.sql

Lines changed: 0 additions & 14 deletions
This file was deleted.

drizzle/0002_add_window_activities_table.sql

Lines changed: 0 additions & 17 deletions
This file was deleted.

drizzle/0003_add_duration_to_window_activities.sql

Lines changed: 0 additions & 6 deletions
This file was deleted.

drizzle/0004_remove_bundle_id.sql

Lines changed: 0 additions & 30 deletions
This file was deleted.

drizzle/meta/0000_snapshot.json

Lines changed: 113 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"version": "6",
33
"dialect": "sqlite",
4-
"id": "ff15e91e-a2a5-4ab4-94ee-2f1d1ae08f62",
4+
"id": "6731446e-8991-4043-a43d-fdbb43d5ca4d",
55
"prevId": "00000000-0000-0000-0000-000000000000",
66
"tables": {
77
"activity_periods": {
@@ -48,6 +48,118 @@
4848
"compositePrimaryKeys": {},
4949
"uniqueConstraints": {},
5050
"checkConstraints": {}
51+
},
52+
"settings": {
53+
"name": "settings",
54+
"columns": {
55+
"id": {
56+
"name": "id",
57+
"type": "integer",
58+
"primaryKey": true,
59+
"notNull": true,
60+
"autoincrement": true
61+
},
62+
"key": {
63+
"name": "key",
64+
"type": "text",
65+
"primaryKey": false,
66+
"notNull": true,
67+
"autoincrement": false
68+
},
69+
"value": {
70+
"name": "value",
71+
"type": "text",
72+
"primaryKey": false,
73+
"notNull": true,
74+
"autoincrement": false
75+
},
76+
"updated_at": {
77+
"name": "updated_at",
78+
"type": "text",
79+
"primaryKey": false,
80+
"notNull": true,
81+
"autoincrement": false
82+
}
83+
},
84+
"indexes": {
85+
"settings_key_unique": {
86+
"name": "settings_key_unique",
87+
"columns": [
88+
"key"
89+
],
90+
"isUnique": true
91+
}
92+
},
93+
"foreignKeys": {},
94+
"compositePrimaryKeys": {},
95+
"uniqueConstraints": {},
96+
"checkConstraints": {}
97+
},
98+
"window_activities": {
99+
"name": "window_activities",
100+
"columns": {
101+
"id": {
102+
"name": "id",
103+
"type": "integer",
104+
"primaryKey": true,
105+
"notNull": true,
106+
"autoincrement": true
107+
},
108+
"timestamp": {
109+
"name": "timestamp",
110+
"type": "text",
111+
"primaryKey": false,
112+
"notNull": true,
113+
"autoincrement": false
114+
},
115+
"duration_seconds": {
116+
"name": "duration_seconds",
117+
"type": "integer",
118+
"primaryKey": false,
119+
"notNull": true,
120+
"autoincrement": false
121+
},
122+
"app_name": {
123+
"name": "app_name",
124+
"type": "text",
125+
"primaryKey": false,
126+
"notNull": true,
127+
"autoincrement": false
128+
},
129+
"window_title": {
130+
"name": "window_title",
131+
"type": "text",
132+
"primaryKey": false,
133+
"notNull": true,
134+
"autoincrement": false
135+
},
136+
"url": {
137+
"name": "url",
138+
"type": "text",
139+
"primaryKey": false,
140+
"notNull": false,
141+
"autoincrement": false
142+
},
143+
"process_id": {
144+
"name": "process_id",
145+
"type": "integer",
146+
"primaryKey": false,
147+
"notNull": false,
148+
"autoincrement": false
149+
},
150+
"created_at": {
151+
"name": "created_at",
152+
"type": "text",
153+
"primaryKey": false,
154+
"notNull": true,
155+
"autoincrement": false
156+
}
157+
},
158+
"indexes": {},
159+
"foreignKeys": {},
160+
"compositePrimaryKeys": {},
161+
"uniqueConstraints": {},
162+
"checkConstraints": {}
51163
}
52164
},
53165
"views": {},

drizzle/meta/0001_snapshot.json

Lines changed: 0 additions & 107 deletions
This file was deleted.

0 commit comments

Comments
 (0)