mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
15 lines
319 B
SQL
15 lines
319 B
SQL
UPDATE
|
|
templates
|
|
SET
|
|
created_by = (
|
|
SELECT user_id FROM organization_members
|
|
WHERE organization_members.organization_id = templates.organization_id
|
|
ORDER BY created_at
|
|
LIMIT 1
|
|
)
|
|
WHERE
|
|
created_by IS NULL;
|
|
|
|
|
|
ALTER TABLE ONLY templates ALTER COLUMN created_by SET NOT NULL;
|