Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ✨ initial commit for projects + tasks #22

Merged
merged 7 commits into from
Jan 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/api/drizzle.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ export default defineConfig({
schema: "./src/database/schema.ts",
dialect: "sqlite",
dbCredentials: {
url: "file:local.db",
url: "file:kaneo.db",
},
}) satisfies Config;
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ CREATE TABLE `project` (
`workspace_id` text NOT NULL,
`name` text NOT NULL,
`description` text,
`created_at` integer DEFAULT '"2025-01-18T14:59:51.091Z"' NOT NULL,
`created_at` integer DEFAULT '"2025-01-25T23:50:45.754Z"' NOT NULL,
FOREIGN KEY (`workspace_id`) REFERENCES `workspace`(`id`) ON UPDATE cascade ON DELETE cascade
);
--> statement-breakpoint
Expand All @@ -21,8 +21,9 @@ CREATE TABLE `task` (
`title` text NOT NULL,
`description` text,
`status` text DEFAULT 'to-do' NOT NULL,
`priority` text DEFAULT 'low',
`due_date` integer,
`created_at` integer DEFAULT '"2025-01-18T14:59:51.091Z"' NOT NULL,
`created_at` integer DEFAULT '"2025-01-25T23:50:45.754Z"' NOT NULL,
FOREIGN KEY (`project_id`) REFERENCES `project`(`id`) ON UPDATE cascade ON DELETE cascade,
FOREIGN KEY (`assignee_id`) REFERENCES `user`(`id`) ON UPDATE cascade ON DELETE cascade
);
Expand All @@ -32,7 +33,7 @@ CREATE TABLE `user` (
`name` text NOT NULL,
`password` text NOT NULL,
`email` text NOT NULL,
`created_at` integer DEFAULT '"2025-01-18T14:59:51.090Z"' NOT NULL
`created_at` integer DEFAULT '"2025-01-25T23:50:45.753Z"' NOT NULL
);
--> statement-breakpoint
CREATE UNIQUE INDEX `user_email_unique` ON `user` (`email`);--> statement-breakpoint
Expand All @@ -41,7 +42,7 @@ CREATE TABLE `workspace` (
`name` text NOT NULL,
`description` text,
`owner_id` text NOT NULL,
`created_at` integer DEFAULT '"2025-01-18T14:59:51.091Z"' NOT NULL,
`created_at` integer DEFAULT '"2025-01-25T23:50:45.754Z"' NOT NULL,
FOREIGN KEY (`owner_id`) REFERENCES `user`(`id`) ON UPDATE cascade ON DELETE cascade
);
--> statement-breakpoint
Expand All @@ -50,7 +51,7 @@ CREATE TABLE `workspace_member` (
`workspace_id` text NOT NULL,
`user_id` text NOT NULL,
`role` text,
`joined_at` integer DEFAULT '"2025-01-18T14:59:51.091Z"' NOT NULL,
`joined_at` integer DEFAULT '"2025-01-25T23:50:45.754Z"' NOT NULL,
FOREIGN KEY (`workspace_id`) REFERENCES `workspace`(`id`) ON UPDATE cascade ON DELETE cascade,
FOREIGN KEY (`user_id`) REFERENCES `user`(`id`) ON UPDATE cascade ON DELETE cascade
);
67 changes: 0 additions & 67 deletions apps/api/drizzle/0001_mean_ultimo.sql

This file was deleted.

20 changes: 14 additions & 6 deletions apps/api/drizzle/meta/0000_snapshot.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": "6",
"dialect": "sqlite",
"id": "c0af92e1-37ce-46b9-bd70-337eb6049763",
"id": "0bc2ad49-3384-4972-89cf-56af7f84a77f",
"prevId": "00000000-0000-0000-0000-000000000000",
"tables": {
"project": {
Expand Down Expand Up @@ -41,7 +41,7 @@
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "'\"2025-01-18T14:59:51.091Z\"'"
"default": "'\"2025-01-25T23:50:45.754Z\"'"
}
},
"indexes": {},
Expand Down Expand Up @@ -147,6 +147,14 @@
"autoincrement": false,
"default": "'to-do'"
},
"priority": {
"name": "priority",
"type": "text",
"primaryKey": false,
"notNull": false,
"autoincrement": false,
"default": "'low'"
},
"due_date": {
"name": "due_date",
"type": "integer",
Expand All @@ -160,7 +168,7 @@
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "'\"2025-01-18T14:59:51.091Z\"'"
"default": "'\"2025-01-25T23:50:45.754Z\"'"
}
},
"indexes": {},
Expand Down Expand Up @@ -225,7 +233,7 @@
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "'\"2025-01-18T14:59:51.090Z\"'"
"default": "'\"2025-01-25T23:50:45.753Z\"'"
}
},
"indexes": {
Expand Down Expand Up @@ -277,7 +285,7 @@
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "'\"2025-01-18T14:59:51.091Z\"'"
"default": "'\"2025-01-25T23:50:45.754Z\"'"
}
},
"indexes": {},
Expand Down Expand Up @@ -333,7 +341,7 @@
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "'\"2025-01-18T14:59:51.091Z\"'"
"default": "'\"2025-01-25T23:50:45.754Z\"'"
}
},
"indexes": {},
Expand Down
Loading