mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: Rename Projects to Templates (#880)
Customer feedback indicated projects was a confusing name.
After querying the team internally, it seemed unanimous
that it is indeed a confusing name.
Here's for a lil less confusion @ashmeer7 🥂
This commit is contained in:
@@ -1,56 +0,0 @@
|
||||
-- name: GetProjectVersionsByProjectID :many
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
project_versions
|
||||
WHERE
|
||||
project_id = $1 :: uuid;
|
||||
|
||||
-- name: GetProjectVersionByJobID :one
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
project_versions
|
||||
WHERE
|
||||
job_id = $1;
|
||||
|
||||
-- name: GetProjectVersionByProjectIDAndName :one
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
project_versions
|
||||
WHERE
|
||||
project_id = $1
|
||||
AND "name" = $2;
|
||||
|
||||
-- name: GetProjectVersionByID :one
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
project_versions
|
||||
WHERE
|
||||
id = $1;
|
||||
|
||||
-- name: InsertProjectVersion :one
|
||||
INSERT INTO
|
||||
project_versions (
|
||||
id,
|
||||
project_id,
|
||||
organization_id,
|
||||
created_at,
|
||||
updated_at,
|
||||
"name",
|
||||
description,
|
||||
job_id
|
||||
)
|
||||
VALUES
|
||||
($1, $2, $3, $4, $5, $6, $7, $8) RETURNING *;
|
||||
|
||||
-- name: UpdateProjectVersionByID :exec
|
||||
UPDATE
|
||||
project_versions
|
||||
SET
|
||||
project_id = $2,
|
||||
updated_at = $3
|
||||
WHERE
|
||||
id = $1;
|
||||
@@ -1,26 +1,26 @@
|
||||
-- name: GetProjectByID :one
|
||||
-- name: GetTemplateByID :one
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
projects
|
||||
templates
|
||||
WHERE
|
||||
id = $1
|
||||
LIMIT
|
||||
1;
|
||||
|
||||
-- name: GetProjectsByIDs :many
|
||||
-- name: GetTemplatesByIDs :many
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
projects
|
||||
templates
|
||||
WHERE
|
||||
id = ANY(@ids :: uuid [ ]);
|
||||
|
||||
-- name: GetProjectByOrganizationAndName :one
|
||||
-- name: GetTemplateByOrganizationAndName :one
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
projects
|
||||
templates
|
||||
WHERE
|
||||
organization_id = @organization_id
|
||||
AND deleted = @deleted
|
||||
@@ -28,18 +28,18 @@ WHERE
|
||||
LIMIT
|
||||
1;
|
||||
|
||||
-- name: GetProjectsByOrganization :many
|
||||
-- name: GetTemplatesByOrganization :many
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
projects
|
||||
templates
|
||||
WHERE
|
||||
organization_id = $1
|
||||
AND deleted = $2;
|
||||
|
||||
-- name: InsertProject :one
|
||||
-- name: InsertTemplate :one
|
||||
INSERT INTO
|
||||
projects (
|
||||
templates (
|
||||
id,
|
||||
created_at,
|
||||
updated_at,
|
||||
@@ -51,17 +51,17 @@ INSERT INTO
|
||||
VALUES
|
||||
($1, $2, $3, $4, $5, $6, $7) RETURNING *;
|
||||
|
||||
-- name: UpdateProjectActiveVersionByID :exec
|
||||
-- name: UpdateTemplateActiveVersionByID :exec
|
||||
UPDATE
|
||||
projects
|
||||
templates
|
||||
SET
|
||||
active_version_id = $2
|
||||
WHERE
|
||||
id = $1;
|
||||
|
||||
-- name: UpdateProjectDeletedByID :exec
|
||||
-- name: UpdateTemplateDeletedByID :exec
|
||||
UPDATE
|
||||
projects
|
||||
templates
|
||||
SET
|
||||
deleted = $2
|
||||
WHERE
|
||||
@@ -0,0 +1,56 @@
|
||||
-- name: GetTemplateVersionsByTemplateID :many
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
template_versions
|
||||
WHERE
|
||||
template_id = $1 :: uuid;
|
||||
|
||||
-- name: GetTemplateVersionByJobID :one
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
template_versions
|
||||
WHERE
|
||||
job_id = $1;
|
||||
|
||||
-- name: GetTemplateVersionByTemplateIDAndName :one
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
template_versions
|
||||
WHERE
|
||||
template_id = $1
|
||||
AND "name" = $2;
|
||||
|
||||
-- name: GetTemplateVersionByID :one
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
template_versions
|
||||
WHERE
|
||||
id = $1;
|
||||
|
||||
-- name: InsertTemplateVersion :one
|
||||
INSERT INTO
|
||||
template_versions (
|
||||
id,
|
||||
template_id,
|
||||
organization_id,
|
||||
created_at,
|
||||
updated_at,
|
||||
"name",
|
||||
description,
|
||||
job_id
|
||||
)
|
||||
VALUES
|
||||
($1, $2, $3, $4, $5, $6, $7, $8) RETURNING *;
|
||||
|
||||
-- name: UpdateTemplateVersionByID :exec
|
||||
UPDATE
|
||||
template_versions
|
||||
SET
|
||||
template_id = $2,
|
||||
updated_at = $3
|
||||
WHERE
|
||||
id = $1;
|
||||
@@ -62,7 +62,7 @@ INSERT INTO
|
||||
created_at,
|
||||
updated_at,
|
||||
workspace_id,
|
||||
project_version_id,
|
||||
template_version_id,
|
||||
before_id,
|
||||
"name",
|
||||
transition,
|
||||
|
||||
@@ -8,13 +8,13 @@ WHERE
|
||||
LIMIT
|
||||
1;
|
||||
|
||||
-- name: GetWorkspacesByProjectID :many
|
||||
-- name: GetWorkspacesByTemplateID :many
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
workspaces
|
||||
WHERE
|
||||
project_id = $1
|
||||
template_id = $1
|
||||
AND deleted = $2;
|
||||
|
||||
-- name: GetWorkspacesByUserID :many
|
||||
@@ -36,16 +36,16 @@ WHERE
|
||||
AND deleted = @deleted
|
||||
AND LOWER("name") = LOWER(@name);
|
||||
|
||||
-- name: GetWorkspaceOwnerCountsByProjectIDs :many
|
||||
-- name: GetWorkspaceOwnerCountsByTemplateIDs :many
|
||||
SELECT
|
||||
project_id,
|
||||
template_id,
|
||||
COUNT(DISTINCT owner_id)
|
||||
FROM
|
||||
workspaces
|
||||
WHERE
|
||||
project_id = ANY(@ids :: uuid [ ])
|
||||
template_id = ANY(@ids :: uuid [ ])
|
||||
GROUP BY
|
||||
project_id,
|
||||
template_id,
|
||||
owner_id;
|
||||
|
||||
-- name: InsertWorkspace :one
|
||||
@@ -55,7 +55,7 @@ INSERT INTO
|
||||
created_at,
|
||||
updated_at,
|
||||
owner_id,
|
||||
project_id,
|
||||
template_id,
|
||||
name
|
||||
)
|
||||
VALUES
|
||||
|
||||
Reference in New Issue
Block a user