Skip to content

Commit 931cba6

Browse files
committed
refactor: remove updated_at column from database schema
1 parent 7ca0762 commit 931cba6

File tree

4 files changed

+4
-43
lines changed

4 files changed

+4
-43
lines changed

drizzle/0000_sudden_doomsday.sql renamed to drizzle/0000_fantastic_kingpin.sql

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ CREATE TABLE `branches` (
33
`project_id` text NOT NULL,
44
`name` text NOT NULL,
55
`created_at` integer DEFAULT (strftime('%s','now') * 1000) NOT NULL,
6-
`updated_at` integer DEFAULT (strftime('%s','now') * 1000) NOT NULL,
76
FOREIGN KEY (`project_id`) REFERENCES `projects`(`id`) ON UPDATE no action ON DELETE no action
87
);
98
--> statement-breakpoint
@@ -13,16 +12,14 @@ CREATE TABLE `intents` (
1312
`status` text NOT NULL,
1413
`branch_id` text,
1514
`created_at` integer DEFAULT (strftime('%s','now') * 1000) NOT NULL,
16-
`updated_at` integer DEFAULT (strftime('%s','now') * 1000) NOT NULL,
1715
FOREIGN KEY (`branch_id`) REFERENCES `branches`(`id`) ON UPDATE no action ON DELETE no action
1816
);
1917
--> statement-breakpoint
2018
CREATE TABLE `projects` (
2119
`id` text PRIMARY KEY NOT NULL,
2220
`repo_path` text NOT NULL,
2321
`repo_name` text NOT NULL,
24-
`created_at` integer DEFAULT (strftime('%s','now') * 1000) NOT NULL,
25-
`updated_at` integer DEFAULT (strftime('%s','now') * 1000) NOT NULL
22+
`created_at` integer DEFAULT (strftime('%s','now') * 1000) NOT NULL
2623
);
2724
--> statement-breakpoint
2825
CREATE UNIQUE INDEX `projects_repo_path_unique` ON `projects` (`repo_path`);

drizzle/meta/0000_snapshot.json

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"version": "6",
33
"dialect": "sqlite",
4-
"id": "e47f2606-6bb2-4c81-a5fd-88be408a3905",
4+
"id": "17f4b149-4d49-4bf4-9144-4343ca84f92c",
55
"prevId": "00000000-0000-0000-0000-000000000000",
66
"tables": {
77
"branches": {
@@ -35,14 +35,6 @@
3535
"notNull": true,
3636
"autoincrement": false,
3737
"default": "(strftime('%s','now') * 1000)"
38-
},
39-
"updated_at": {
40-
"name": "updated_at",
41-
"type": "integer",
42-
"primaryKey": false,
43-
"notNull": true,
44-
"autoincrement": false,
45-
"default": "(strftime('%s','now') * 1000)"
4638
}
4739
},
4840
"indexes": {},
@@ -103,14 +95,6 @@
10395
"notNull": true,
10496
"autoincrement": false,
10597
"default": "(strftime('%s','now') * 1000)"
106-
},
107-
"updated_at": {
108-
"name": "updated_at",
109-
"type": "integer",
110-
"primaryKey": false,
111-
"notNull": true,
112-
"autoincrement": false,
113-
"default": "(strftime('%s','now') * 1000)"
11498
}
11599
},
116100
"indexes": {},
@@ -164,14 +148,6 @@
164148
"notNull": true,
165149
"autoincrement": false,
166150
"default": "(strftime('%s','now') * 1000)"
167-
},
168-
"updated_at": {
169-
"name": "updated_at",
170-
"type": "integer",
171-
"primaryKey": false,
172-
"notNull": true,
173-
"autoincrement": false,
174-
"default": "(strftime('%s','now') * 1000)"
175151
}
176152
},
177153
"indexes": {

drizzle/meta/_journal.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
{
66
"idx": 0,
77
"version": "6",
8-
"when": 1751817573145,
9-
"tag": "0000_sudden_doomsday",
8+
"when": 1751887740840,
9+
"tag": "0000_fantastic_kingpin",
1010
"breakpoints": true
1111
}
1212
]

src/core/db/schema.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ export const projects = sqliteTable("projects", {
1111
createdAt: integer("created_at", { mode: "timestamp_ms" })
1212
.notNull()
1313
.default(nowMs),
14-
updatedAt: integer("updated_at", { mode: "timestamp_ms" })
15-
.notNull()
16-
.default(nowMs)
17-
.$onUpdate(() => nowMs),
1814
});
1915

2016
export const branches = sqliteTable("branches", {
@@ -26,10 +22,6 @@ export const branches = sqliteTable("branches", {
2622
createdAt: integer("created_at", { mode: "timestamp_ms" })
2723
.notNull()
2824
.default(nowMs),
29-
updatedAt: integer("updated_at", { mode: "timestamp_ms" })
30-
.notNull()
31-
.default(nowMs)
32-
.$onUpdate(() => nowMs),
3325
});
3426

3527
export const intents = sqliteTable("intents", {
@@ -40,10 +32,6 @@ export const intents = sqliteTable("intents", {
4032
createdAt: integer("created_at", { mode: "timestamp_ms" })
4133
.notNull()
4234
.default(nowMs),
43-
updatedAt: integer("updated_at", { mode: "timestamp_ms" })
44-
.notNull()
45-
.default(nowMs)
46-
.$onUpdate(() => nowMs),
4735
});
4836

4937
export type Project = typeof projects.$inferSelect;

0 commit comments

Comments
 (0)