Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4cd0ada

Browse files
chore(coderd/database): add tasks data model (#19749)
Part ofcoder/internal#948Adds the initial part of the tasks data model as per the RFC.
1 parent4bf63b4 commit4cd0ada

File tree

7 files changed

+116
-0
lines changed

7 files changed

+116
-0
lines changed

‎coderd/database/dump.sql‎

Lines changed: 47 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎coderd/database/foreign_key_constraint.go‎

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
DROPTABLE task_workspace_apps;
2+
DROPTABLE tasks;
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
CREATETABLEtasks (
2+
id UUIDNOT NULLPRIMARY KEY,
3+
organization_id UUIDNOT NULLREFERENCES organizations (id)ON DELETE CASCADE,
4+
owner_id UUIDNOT NULLREFERENCES users (id)ON DELETE CASCADE,
5+
nameTEXTNOT NULL,
6+
workspace_id UUIDREFERENCES workspaces (id)ON DELETE CASCADE,
7+
template_version_id UUIDNOT NULLREFERENCES template_versions (id)ON DELETE CASCADE,
8+
template_parameters JSONBNOT NULL DEFAULT'{}'::JSONB,
9+
promptTEXTNOT NULL,
10+
created_atTIMESTAMPTZNOT NULL,
11+
deleted_atTIMESTAMPTZ
12+
);
13+
14+
CREATETABLEtask_workspace_apps (
15+
task_id UUIDNOT NULLREFERENCES tasks (id)ON DELETE CASCADE,
16+
workspace_build_id UUIDNOT NULLREFERENCES workspace_builds (id)ON DELETE CASCADE,
17+
workspace_agent_id UUIDNOT NULLREFERENCES workspace_agents (id)ON DELETE CASCADE,
18+
workspace_app_id UUIDNOT NULLREFERENCES workspace_apps (id)ON DELETE CASCADE
19+
);
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
INSERT INTOpublic.tasksVALUES (
2+
'f5a1c3e4-8b2d-4f6a-9d7e-2a8b5c9e1f3d',-- id
3+
'bb640d07-ca8a-4869-b6bc-ae61ebb2fda1',-- organization_id
4+
'30095c71-380b-457a-8995-97b8ee6e5307',-- owner_id
5+
'Test Task 1',-- name
6+
'3a9a1feb-e89d-457c-9d53-ac751b198ebe',-- workspace_id
7+
'920baba5-4c64-4686-8b7d-d1bef5683eae',-- template_version_id
8+
'{}'::JSONB,-- template_parameters
9+
'Create a React component for tasks',-- prompt
10+
'2024-11-02 13:10:00.000000+02',-- created_at
11+
NULL-- deleted_at
12+
)ON CONFLICT DO NOTHING;
13+
14+
INSERT INTOpublic.task_workspace_appsVALUES (
15+
'f5a1c3e4-8b2d-4f6a-9d7e-2a8b5c9e1f3d',-- task_id
16+
'a8c0b8c5-c9a8-4f33-93a4-8142e6858244',-- workspace_build_id
17+
'8fa17bbd-c48c-44c7-91ae-d4acbc755fad',-- workspace_agent_id
18+
'a47965a2-0a25-4810-8cc9-d283c86ab34c'-- workspace_app_id
19+
)ON CONFLICT DO NOTHING;

‎coderd/database/models.go‎

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎coderd/database/unique_constraint.go‎

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp