Skip to content

Commit ce9f16a

Browse files
committed
remove attempted column from question db
1 parent b76969f commit ce9f16a

File tree

5 files changed

+80
-3
lines changed

5 files changed

+80
-3
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ALTER TABLE "questions" DROP COLUMN IF EXISTS "attempted";
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
{
2+
"id": "9ad800fd-5b56-4936-aaf7-94b6243549ce",
3+
"prevId": "9fdd4b9a-8576-4be3-bfbc-c2d682d60b45",
4+
"version": "7",
5+
"dialect": "postgresql",
6+
"tables": {
7+
"public.questions": {
8+
"name": "questions",
9+
"schema": "",
10+
"columns": {
11+
"id": {
12+
"name": "id",
13+
"type": "uuid",
14+
"primaryKey": true,
15+
"notNull": true,
16+
"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()"
55+
}
56+
},
57+
"indexes": {},
58+
"foreignKeys": {},
59+
"compositePrimaryKeys": {},
60+
"uniqueConstraints": {}
61+
}
62+
},
63+
"enums": {},
64+
"schemas": {},
65+
"sequences": {},
66+
"_meta": {
67+
"columns": {},
68+
"schemas": {},
69+
"tables": {}
70+
}
71+
}

backend/question/drizzle/meta/_journal.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@
1515
"when": 1727504673110,
1616
"tag": "0001_neat_skullbuster",
1717
"breakpoints": true
18+
},
19+
{
20+
"idx": 2,
21+
"version": "7",
22+
"when": 1727510874424,
23+
"tag": "0002_glorious_onslaught",
24+
"breakpoints": true
1825
}
1926
]
2027
}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
import { pgTable, uuid, varchar, text, timestamp, boolean } from 'drizzle-orm/pg-core';
1+
import { pgTable, uuid, varchar, text, timestamp } from 'drizzle-orm/pg-core';
22

33
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(),
77
topic: varchar('topic', { length: 255 }).array().notNull(),
88
description: text('description').notNull(),
9-
attempted: boolean('attempted').notNull().default(false),
109
createdAt: timestamp('created_at', { precision: 6, withTimezone: true }).defaultNow(),
1110
updatedAt: timestamp('updated_at', { precision: 6, withTimezone: true }).defaultNow(),
1211
});

backend/question/src/services/get/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ export const searchQuestionsByTitleService = async (
1515
title: questions.title,
1616
difficulty: questions.difficulty,
1717
topic: questions.topic,
18-
attempted: questions.attempted,
1918
})
2019
.from(questions)
2120
.where(sql`${questions.title} ILIKE ${searchPattern}`); // Use ILIKE for case-insensitive matching

0 commit comments

Comments
 (0)