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

Commit5e44303

Browse files
committed
migrate existing templates
1 parentc5ecbf4 commit5e44303

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

‎coderd/database/migrations/000055_template_acl.up.sql

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,30 @@ CREATE TABLE group_members (
1919
UNIQUE(user_id, group_id)
2020
);
2121

22+
-- Insert a group for every organization (which should just be 1).
23+
INSERT INTO groups (
24+
id,
25+
name,
26+
organization_id
27+
)SELECT
28+
id,'allUsers'as name, id
29+
FROM
30+
organizations;
31+
32+
-- Insert allUsers groups into every existing template to avoid breaking
33+
-- existing deployments.
34+
UPDATE
35+
templates
36+
SET
37+
group_acl= (
38+
SELECT
39+
json_build_object(
40+
organizations.id, array_to_json('{"read"}'::text[])
41+
)
42+
FROM
43+
organizations
44+
WHERE
45+
templates.organization_id=organizations.id
46+
);
47+
2248
COMMIT;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp