Skip to content

Commit 2fa49d1

Browse files
committed
fix
1 parent dcf1042 commit 2fa49d1

File tree

6 files changed

+51
-105
lines changed

6 files changed

+51
-105
lines changed
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
CREATE TABLE IF NOT EXISTS "tableName" (
1+
CREATE TABLE IF NOT EXISTS "questions" (
22
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
3-
CONSTRAINT "tableName_id_unique" UNIQUE("id")
3+
"title" varchar(255) NOT NULL,
4+
"difficulty" varchar(50) NOT NULL,
5+
"topic" varchar(255)[] NOT NULL,
6+
"description" text NOT NULL,
7+
"created_at" timestamp (6) with time zone DEFAULT now(),
8+
"updated_at" timestamp (6) with time zone DEFAULT now()
49
);

backend/question/drizzle/0001_new_questions_table.sql

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

backend/question/drizzle/meta/0000_snapshot.json

Lines changed: 42 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"id": "bfb0f47d-1ebe-47d4-b979-8fe9d6305cd4",
2+
"id": "36d01d6f-4eb8-4c12-a89f-89295da72dcc",
33
"prevId": "00000000-0000-0000-0000-000000000000",
44
"version": "7",
55
"dialect": "postgresql",
66
"tables": {
7-
"public.tableName": {
8-
"name": "tableName",
7+
"public.questions": {
8+
"name": "questions",
99
"schema": "",
1010
"columns": {
1111
"id": {
@@ -14,20 +14,50 @@
1414
"primaryKey": true,
1515
"notNull": true,
1616
"default": "gen_random_uuid()"
17+
},
18+
"title": {
19+
"name": "title",
20+
"type": "varchar(255)",
21+
"primaryKey": false,
22+
"notNull": true
23+
},
24+
"difficulty": {
25+
"name": "difficulty",
26+
"type": "varchar(50)",
27+
"primaryKey": false,
28+
"notNull": true
29+
},
30+
"topic": {
31+
"name": "topic",
32+
"type": "varchar(255)[]",
33+
"primaryKey": false,
34+
"notNull": true
35+
},
36+
"description": {
37+
"name": "description",
38+
"type": "text",
39+
"primaryKey": false,
40+
"notNull": true
41+
},
42+
"created_at": {
43+
"name": "created_at",
44+
"type": "timestamp (6) with time zone",
45+
"primaryKey": false,
46+
"notNull": false,
47+
"default": "now()"
48+
},
49+
"updated_at": {
50+
"name": "updated_at",
51+
"type": "timestamp (6) with time zone",
52+
"primaryKey": false,
53+
"notNull": false,
54+
"default": "now()"
1755
}
1856
},
1957
"indexes": {},
2058
"foreignKeys": {},
2159
"compositePrimaryKeys": {},
22-
"uniqueConstraints": {
23-
"tableName_id_unique": {
24-
"name": "tableName_id_unique",
25-
"nullsNotDistinct": false,
26-
"columns": [
27-
"id"
28-
]
29-
}
30-
}
60+
"uniqueConstraints": {}
3161
}
3262
},
3363
"enums": {},

backend/question/drizzle/meta/0001_snapshot.json

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

backend/question/drizzle/meta/_journal.json

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,9 @@
55
{
66
"idx": 0,
77
"version": "7",
8-
"when": 1726382290778,
8+
"when": 1727390805855,
99
"tag": "0000_initial_schema",
1010
"breakpoints": true
11-
},
12-
{
13-
"idx": 1,
14-
"version": "7",
15-
"when": 1727316962366,
16-
"tag": "0001_new_questions_table",
17-
"breakpoints": true
1811
}
1912
]
2013
}

backend/question/src/lib/db/schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export const questions = pgTable('questions', {
44
id: uuid('id').primaryKey().defaultRandom(),
55
title: varchar('title', { length: 255 }).notNull(),
66
difficulty: varchar('difficulty', { length: 50 }).notNull(),
7-
topic: varchar('topic', { length: 100 }).notNull(),
7+
topic: varchar('topic', { length: 255 }).array().notNull(),
88
description: text('description').notNull(),
99
createdAt: timestamp('created_at', { precision: 6, withTimezone: true }).defaultNow(),
1010
updatedAt: timestamp('updated_at', { precision: 6, withTimezone: true }).defaultNow(),

0 commit comments

Comments
 (0)