mirror of
https://github.com/coder/coder.git
synced 2025-07-21 01:28:49 +00:00
This reverts commit aea3b3b83e
.
This commit is contained in:
@ -1 +0,0 @@
|
||||
ALTER TABLE ONLY template_versions DROP COLUMN IF EXISTS created_by;
|
@ -1,14 +0,0 @@
|
||||
ALTER TABLE ONLY template_versions ADD COLUMN IF NOT EXISTS created_by uuid REFERENCES users (id) ON DELETE RESTRICT;
|
||||
|
||||
UPDATE
|
||||
template_versions
|
||||
SET
|
||||
created_by = (
|
||||
SELECT created_by FROM templates
|
||||
WHERE template_versions.template_id = templates.id
|
||||
LIMIT 1
|
||||
)
|
||||
WHERE
|
||||
created_by IS NULL;
|
||||
|
||||
ALTER TABLE ONLY template_versions ALTER COLUMN created_by SET NOT NULL;
|
Reference in New Issue
Block a user