diff --git a/drizzle/0001_loose_mojo.sql b/drizzle/0001_loose_mojo.sql new file mode 100644 index 0000000..8e09c0c --- /dev/null +++ b/drizzle/0001_loose_mojo.sql @@ -0,0 +1 @@ +ALTER TABLE "tasks" ADD COLUMN "description" text; \ No newline at end of file diff --git a/drizzle/meta/0001_snapshot.json b/drizzle/meta/0001_snapshot.json new file mode 100644 index 0000000..70b8f04 --- /dev/null +++ b/drizzle/meta/0001_snapshot.json @@ -0,0 +1,97 @@ +{ + "id": "5c7421c6-afad-4f83-9795-8d11a0c4175f", + "prevId": "aed8b706-2b02-4a0d-adb6-98dda79f56e5", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.orgs": { + "name": "orgs", + "schema": "", + "columns": { + "org_id": { + "name": "org_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "stripe_customer_id": { + "name": "stripe_customer_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "license_count": { + "name": "license_count", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + }, + "public.tasks": { + "name": "tasks", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "is_done": { + "name": "is_done", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "owner_id": { + "name": "owner_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_on": { + "name": "created_on", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "created_by_id": { + "name": "created_by_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {} + } + }, + "enums": {}, + "schemas": {}, + "sequences": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/drizzle/meta/_journal.json b/drizzle/meta/_journal.json index c3ef918..45069e0 100644 --- a/drizzle/meta/_journal.json +++ b/drizzle/meta/_journal.json @@ -8,6 +8,13 @@ "when": 1723516334993, "tag": "0000_skinny_magma", "breakpoints": true + }, + { + "idx": 1, + "version": "7", + "when": 1723516412852, + "tag": "0001_loose_mojo", + "breakpoints": true } ] } \ No newline at end of file diff --git a/src/app/actions.ts b/src/app/actions.ts index 5ea1e13..1b8a56b 100644 --- a/src/app/actions.ts +++ b/src/app/actions.ts @@ -44,12 +44,13 @@ export async function setTaskState(taskId: number, isDone: boolean) { )).execute() } -export async function updateTask(taskId: number, name: string) { +export async function updateTask(taskId: number, name: string, description: string) { const { ownerId } = getUserInfo(); const db = await getDb() await db.update(tasks).set({ - name: name + name: name, + description: description }).where(and( eq(tasks.id, taskId), eq(tasks.owner_id, ownerId) diff --git a/src/db/schema.ts b/src/db/schema.ts index beb458f..f713080 100644 --- a/src/db/schema.ts +++ b/src/db/schema.ts @@ -6,7 +6,8 @@ export const tasks = pgTable('tasks', { is_done: boolean('is_done'), owner_id: text('owner_id'), created_in: timestamp('created_on'), - created_by_id: text('created_by_id') + created_by_id: text('created_by_id'), + description: text('description') }); export const orgs = pgTable('orgs', {