Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
bmorrisondev committed Aug 13, 2024
2 parents 3247d8f + 887232e commit 8926688
Show file tree
Hide file tree
Showing 5 changed files with 110 additions and 3 deletions.
1 change: 1 addition & 0 deletions drizzle/0001_loose_mojo.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE "tasks" ADD COLUMN "description" text;
97 changes: 97 additions & 0 deletions drizzle/meta/0001_snapshot.json
Original file line number Diff line number Diff line change
@@ -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": {}
}
}
7 changes: 7 additions & 0 deletions drizzle/meta/_journal.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@
"when": 1723516334993,
"tag": "0000_skinny_magma",
"breakpoints": true
},
{
"idx": 1,
"version": "7",
"when": 1723516412852,
"tag": "0001_loose_mojo",
"breakpoints": true
}
]
}
5 changes: 3 additions & 2 deletions src/app/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion src/db/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', {
Expand Down

0 comments on commit 8926688

Please sign in to comment.