feat: add template version creator (#2991)

This commit is contained in:
Abhineet Jain
2022-07-14 13:44:33 -07:00
committed by GitHub
parent 6ef8a625d5
commit aea3b3b83e
14 changed files with 106 additions and 16 deletions

View File

@ -247,7 +247,8 @@ CREATE TABLE template_versions (
updated_at timestamp with time zone NOT NULL,
name character varying(64) NOT NULL,
readme character varying(1048576) NOT NULL,
job_id uuid NOT NULL
job_id uuid NOT NULL,
created_by uuid NOT NULL
);
CREATE TABLE templates (
@ -486,6 +487,9 @@ ALTER TABLE ONLY provisioner_job_logs
ALTER TABLE ONLY provisioner_jobs
ADD CONSTRAINT provisioner_jobs_organization_id_fkey FOREIGN KEY (organization_id) REFERENCES organizations(id) ON DELETE CASCADE;
ALTER TABLE ONLY template_versions
ADD CONSTRAINT template_versions_created_by_fkey FOREIGN KEY (created_by) REFERENCES users(id) ON DELETE RESTRICT;
ALTER TABLE ONLY template_versions
ADD CONSTRAINT template_versions_organization_id_fkey FOREIGN KEY (organization_id) REFERENCES organizations(id) ON DELETE CASCADE;