Skip to content

Commit 0cc7ef9

Browse files
chore: use 'timestamp with time zone' for all timestamp columns
Replaced all instances of 'timestamp without time zone' with 'timestamp with time zone' in `created_at`, `updated_at`, and similar columns to ensure consistent handling of time zones across the database schema.
1 parent 93988de commit 0cc7ef9

File tree

2 files changed

+62
-62
lines changed

2 files changed

+62
-62
lines changed

frontend/packages/db/schema/schema.sql

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ CREATE TABLE IF NOT EXISTS "public"."github_doc_file_paths" (
155155
"path" "text" NOT NULL,
156156
"is_review_enabled" boolean DEFAULT true NOT NULL,
157157
"project_id" "uuid" NOT NULL,
158-
"created_at" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
159-
"updated_at" timestamp(3) without time zone NOT NULL
158+
"created_at" timestamp(3) with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
159+
"updated_at" timestamp(3) with time zone NOT NULL
160160
);
161161

162162

@@ -167,8 +167,8 @@ CREATE TABLE IF NOT EXISTS "public"."github_schema_file_paths" (
167167
"id" "uuid" DEFAULT "gen_random_uuid"() NOT NULL,
168168
"path" "text" NOT NULL,
169169
"project_id" "uuid" NOT NULL,
170-
"created_at" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
171-
"updated_at" timestamp(3) without time zone NOT NULL,
170+
"created_at" timestamp(3) with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
171+
"updated_at" timestamp(3) with time zone NOT NULL,
172172
"format" "public"."schema_format_enum" NOT NULL
173173
);
174174

@@ -180,8 +180,8 @@ CREATE TABLE IF NOT EXISTS "public"."knowledge_suggestion_doc_mappings" (
180180
"id" "uuid" DEFAULT "gen_random_uuid"() NOT NULL,
181181
"knowledge_suggestion_id" "uuid" NOT NULL,
182182
"github_doc_file_path_id" "uuid" NOT NULL,
183-
"created_at" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
184-
"updated_at" timestamp(3) without time zone NOT NULL
183+
"created_at" timestamp(3) with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
184+
"updated_at" timestamp(3) with time zone NOT NULL
185185
);
186186

187187

@@ -196,9 +196,9 @@ CREATE TABLE IF NOT EXISTS "public"."knowledge_suggestions" (
196196
"content" "text" NOT NULL,
197197
"file_sha" "text",
198198
"project_id" "uuid" NOT NULL,
199-
"approved_at" timestamp(3) without time zone,
200-
"created_at" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
201-
"updated_at" timestamp(3) without time zone NOT NULL,
199+
"approved_at" timestamp(3) with time zone,
200+
"created_at" timestamp(3) with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
201+
"updated_at" timestamp(3) with time zone NOT NULL,
202202
"branch_name" "text" NOT NULL,
203203
"trace_id" "text",
204204
"reasoning" "text" DEFAULT ''::"text"
@@ -224,8 +224,8 @@ CREATE TABLE IF NOT EXISTS "public"."migrations" (
224224
"id" "uuid" DEFAULT "gen_random_uuid"() NOT NULL,
225225
"title" "text" NOT NULL,
226226
"pull_request_id" "uuid" NOT NULL,
227-
"created_at" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
228-
"updated_at" timestamp(3) without time zone NOT NULL
227+
"created_at" timestamp(3) with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
228+
"updated_at" timestamp(3) with time zone NOT NULL
229229
);
230230

231231

@@ -256,8 +256,8 @@ CREATE TABLE IF NOT EXISTS "public"."overall_review_knowledge_suggestion_mapping
256256
"id" "uuid" DEFAULT "gen_random_uuid"() NOT NULL,
257257
"overall_review_id" "uuid" NOT NULL,
258258
"knowledge_suggestion_id" "uuid" NOT NULL,
259-
"created_at" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
260-
"updated_at" timestamp(3) without time zone NOT NULL
259+
"created_at" timestamp(3) with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
260+
"updated_at" timestamp(3) with time zone NOT NULL
261261
);
262262

263263

@@ -269,9 +269,9 @@ CREATE TABLE IF NOT EXISTS "public"."overall_reviews" (
269269
"project_id" "uuid",
270270
"pull_request_id" "uuid" NOT NULL,
271271
"review_comment" "text",
272-
"reviewed_at" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
273-
"created_at" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
274-
"updated_at" timestamp(3) without time zone NOT NULL,
272+
"reviewed_at" timestamp(3) with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
273+
"created_at" timestamp(3) with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
274+
"updated_at" timestamp(3) with time zone NOT NULL,
275275
"branch_name" "text" NOT NULL,
276276
"trace_id" "text"
277277
);
@@ -284,8 +284,8 @@ CREATE TABLE IF NOT EXISTS "public"."project_repository_mappings" (
284284
"id" "uuid" DEFAULT "gen_random_uuid"() NOT NULL,
285285
"project_id" "uuid" NOT NULL,
286286
"repository_id" "uuid" NOT NULL,
287-
"created_at" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
288-
"updated_at" timestamp(3) without time zone NOT NULL
287+
"created_at" timestamp(3) with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
288+
"updated_at" timestamp(3) with time zone NOT NULL
289289
);
290290

291291

@@ -295,8 +295,8 @@ ALTER TABLE "public"."project_repository_mappings" OWNER TO "postgres";
295295
CREATE TABLE IF NOT EXISTS "public"."projects" (
296296
"id" "uuid" DEFAULT "gen_random_uuid"() NOT NULL,
297297
"name" "text" NOT NULL,
298-
"created_at" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
299-
"updated_at" timestamp(3) without time zone NOT NULL,
298+
"created_at" timestamp(3) with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
299+
"updated_at" timestamp(3) with time zone NOT NULL,
300300
"organization_id" "uuid"
301301
);
302302

@@ -308,8 +308,8 @@ CREATE TABLE IF NOT EXISTS "public"."pull_requests" (
308308
"id" "uuid" DEFAULT "gen_random_uuid"() NOT NULL,
309309
"pull_number" bigint NOT NULL,
310310
"comment_id" bigint,
311-
"created_at" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
312-
"updated_at" timestamp(3) without time zone NOT NULL,
311+
"created_at" timestamp(3) with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
312+
"updated_at" timestamp(3) with time zone NOT NULL,
313313
"repository_id" "uuid" NOT NULL
314314
);
315315

@@ -323,8 +323,8 @@ CREATE TABLE IF NOT EXISTS "public"."repositories" (
323323
"owner" "text" NOT NULL,
324324
"installation_id" integer NOT NULL,
325325
"is_active" boolean DEFAULT true NOT NULL,
326-
"created_at" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
327-
"updated_at" timestamp(3) without time zone NOT NULL
326+
"created_at" timestamp(3) with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
327+
"updated_at" timestamp(3) with time zone NOT NULL
328328
);
329329

330330

@@ -336,8 +336,8 @@ CREATE TABLE IF NOT EXISTS "public"."review_feedback_comments" (
336336
"review_feedback_id" "uuid" NOT NULL,
337337
"user_id" "uuid" NOT NULL,
338338
"content" "text" NOT NULL,
339-
"created_at" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
340-
"updated_at" timestamp(3) without time zone NOT NULL
339+
"created_at" timestamp(3) with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
340+
"updated_at" timestamp(3) with time zone NOT NULL
341341
);
342342

343343

@@ -350,10 +350,10 @@ CREATE TABLE IF NOT EXISTS "public"."review_feedbacks" (
350350
"category" "public"."category_enum" NOT NULL,
351351
"severity" "public"."severity_enum" NOT NULL,
352352
"description" "text" NOT NULL,
353-
"created_at" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
354-
"updated_at" timestamp(3) without time zone NOT NULL,
353+
"created_at" timestamp(3) with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
354+
"updated_at" timestamp(3) with time zone NOT NULL,
355355
"suggestion" "text" NOT NULL,
356-
"resolved_at" timestamp(3) without time zone,
356+
"resolved_at" timestamp(3) with time zone,
357357
"resolution_comment" "text"
358358
);
359359

@@ -366,8 +366,8 @@ CREATE TABLE IF NOT EXISTS "public"."review_suggestion_snippets" (
366366
"review_feedback_id" "uuid" NOT NULL,
367367
"filename" "text" NOT NULL,
368368
"snippet" "text" NOT NULL,
369-
"created_at" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
370-
"updated_at" timestamp(3) without time zone NOT NULL
369+
"created_at" timestamp(3) with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
370+
"updated_at" timestamp(3) with time zone NOT NULL
371371
);
372372

373373

frontend/packages/db/supabase/migrations/20250416105745_initial_squash.sql

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ CREATE TABLE IF NOT EXISTS "public"."github_doc_file_paths" (
153153
"path" "text" NOT NULL,
154154
"is_review_enabled" boolean DEFAULT true NOT NULL,
155155
"project_id" uuid NOT NULL,
156-
"created_at" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
157-
"updated_at" timestamp(3) without time zone NOT NULL
156+
"created_at" timestamp(3) with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
157+
"updated_at" timestamp(3) with time zone NOT NULL
158158
);
159159

160160

@@ -172,8 +172,8 @@ CREATE TABLE IF NOT EXISTS "public"."github_schema_file_paths" (
172172
"id" uuid NOT NULL DEFAULT gen_random_uuid(),
173173
"path" "text" NOT NULL,
174174
"project_id" uuid NOT NULL,
175-
"created_at" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
176-
"updated_at" timestamp(3) without time zone NOT NULL,
175+
"created_at" timestamp(3) with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
176+
"updated_at" timestamp(3) with time zone NOT NULL,
177177
"format" "public"."schema_format_enum" NOT NULL
178178
);
179179

@@ -196,9 +196,9 @@ CREATE TABLE IF NOT EXISTS "public"."knowledge_suggestions" (
196196
"content" "text" NOT NULL,
197197
"file_sha" "text",
198198
"project_id" uuid NOT NULL,
199-
"approved_at" timestamp(3) without time zone,
200-
"created_at" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
201-
"updated_at" timestamp(3) without time zone NOT NULL,
199+
"approved_at" timestamp(3) with time zone,
200+
"created_at" timestamp(3) with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
201+
"updated_at" timestamp(3) with time zone NOT NULL,
202202
"branch_name" "text" NOT NULL,
203203
"trace_id" "text",
204204
"reasoning" "text" DEFAULT ''::"text"
@@ -212,8 +212,8 @@ CREATE TABLE IF NOT EXISTS "public"."knowledge_suggestion_doc_mappings" (
212212
"id" uuid NOT NULL DEFAULT gen_random_uuid(),
213213
"knowledge_suggestion_id" uuid NOT NULL,
214214
"github_doc_file_path_id" uuid NOT NULL,
215-
"created_at" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
216-
"updated_at" timestamp(3) without time zone NOT NULL
215+
"created_at" timestamp(3) with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
216+
"updated_at" timestamp(3) with time zone NOT NULL
217217
);
218218

219219

@@ -250,8 +250,8 @@ CREATE TABLE IF NOT EXISTS "public"."migrations" (
250250
"id" uuid NOT NULL DEFAULT gen_random_uuid(),
251251
"title" "text" NOT NULL,
252252
"pull_request_id" uuid NOT NULL,
253-
"created_at" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
254-
"updated_at" timestamp(3) without time zone NOT NULL
253+
"created_at" timestamp(3) with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
254+
"updated_at" timestamp(3) with time zone NOT NULL
255255
);
256256

257257

@@ -292,9 +292,9 @@ CREATE TABLE IF NOT EXISTS "public"."overall_reviews" (
292292
"project_id" uuid,
293293
"pull_request_id" uuid NOT NULL,
294294
"review_comment" "text",
295-
"reviewed_at" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
296-
"created_at" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
297-
"updated_at" timestamp(3) without time zone NOT NULL,
295+
"reviewed_at" timestamp(3) with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
296+
"created_at" timestamp(3) with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
297+
"updated_at" timestamp(3) with time zone NOT NULL,
298298
"branch_name" "text" NOT NULL,
299299
"trace_id" "text"
300300
);
@@ -307,8 +307,8 @@ CREATE TABLE IF NOT EXISTS "public"."overall_review_knowledge_suggestion_mapping
307307
"id" uuid NOT NULL DEFAULT gen_random_uuid(),
308308
"overall_review_id" uuid NOT NULL,
309309
"knowledge_suggestion_id" uuid NOT NULL,
310-
"created_at" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
311-
"updated_at" timestamp(3) without time zone NOT NULL
310+
"created_at" timestamp(3) with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
311+
"updated_at" timestamp(3) with time zone NOT NULL
312312
);
313313

314314

@@ -332,8 +332,8 @@ ALTER TABLE "public"."overall_review_knowledge_suggestion_mappings" OWNER TO "po
332332
CREATE TABLE IF NOT EXISTS "public"."projects" (
333333
"id" uuid NOT NULL DEFAULT gen_random_uuid(),
334334
"name" "text" NOT NULL,
335-
"created_at" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
336-
"updated_at" timestamp(3) without time zone NOT NULL,
335+
"created_at" timestamp(3) with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
336+
"updated_at" timestamp(3) with time zone NOT NULL,
337337
"organization_id" uuid );
338338

339339

@@ -344,8 +344,8 @@ CREATE TABLE IF NOT EXISTS "public"."project_repository_mappings" (
344344
"id" uuid NOT NULL DEFAULT gen_random_uuid(),
345345
"project_id" uuid NOT NULL,
346346
"repository_id" uuid NOT NULL,
347-
"created_at" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
348-
"updated_at" timestamp(3) without time zone NOT NULL
347+
"created_at" timestamp(3) with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
348+
"updated_at" timestamp(3) with time zone NOT NULL
349349
);
350350

351351

@@ -370,8 +370,8 @@ CREATE TABLE IF NOT EXISTS "public"."pull_requests" (
370370
"id" uuid NOT NULL DEFAULT gen_random_uuid(),
371371
"pull_number" bigint NOT NULL,
372372
"comment_id" bigint,
373-
"created_at" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
374-
"updated_at" timestamp(3) without time zone NOT NULL,
373+
"created_at" timestamp(3) with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
374+
"updated_at" timestamp(3) with time zone NOT NULL,
375375
"repository_id" uuid NOT NULL
376376
);
377377

@@ -392,8 +392,8 @@ CREATE TABLE IF NOT EXISTS "public"."repositories" (
392392
"owner" "text" NOT NULL,
393393
"installation_id" integer NOT NULL,
394394
"is_active" boolean DEFAULT true NOT NULL,
395-
"created_at" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
396-
"updated_at" timestamp(3) without time zone NOT NULL
395+
"created_at" timestamp(3) with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
396+
"updated_at" timestamp(3) with time zone NOT NULL
397397
);
398398

399399

@@ -413,10 +413,10 @@ CREATE TABLE IF NOT EXISTS "public"."review_feedbacks" (
413413
"category" "public"."category_enum" NOT NULL,
414414
"severity" "public"."severity_enum" NOT NULL,
415415
"description" "text" NOT NULL,
416-
"created_at" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
417-
"updated_at" timestamp(3) without time zone NOT NULL,
416+
"created_at" timestamp(3) with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
417+
"updated_at" timestamp(3) with time zone NOT NULL,
418418
"suggestion" "text" NOT NULL,
419-
"resolved_at" timestamp(3) without time zone,
419+
"resolved_at" timestamp(3) with time zone,
420420
"resolution_comment" "text"
421421
);
422422

@@ -433,8 +433,8 @@ CREATE TABLE IF NOT EXISTS "public"."review_feedback_comments" (
433433
"review_feedback_id" uuid NOT NULL,
434434
"user_id" "uuid" NOT NULL,
435435
"content" "text" NOT NULL,
436-
"created_at" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
437-
"updated_at" timestamp(3) without time zone NOT NULL
436+
"created_at" timestamp(3) with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
437+
"updated_at" timestamp(3) with time zone NOT NULL
438438
);
439439

440440

@@ -457,8 +457,8 @@ CREATE TABLE IF NOT EXISTS "public"."review_suggestion_snippets" (
457457
"review_feedback_id" uuid NOT NULL,
458458
"filename" "text" NOT NULL,
459459
"snippet" "text" NOT NULL,
460-
"created_at" timestamp(3) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
461-
"updated_at" timestamp(3) without time zone NOT NULL
460+
"created_at" timestamp(3) with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
461+
"updated_at" timestamp(3) with time zone NOT NULL
462462
);
463463

464464

0 commit comments

Comments
 (0)