feat: Add dry run for provisioners (#178)

* refactor: Rename ProjectParameter to ProjectVersionParameter

This was confusing with ParameterValue before. It still is a bit,
but this should help distinguish scope.

* Add project version resources table

* Allow project parameters to optionally have user and workspace

* Add dry run for provisioners

* Add resource detection on project import
This commit is contained in:
Kyle Carberry
2022-02-07 19:35:18 -06:00
committed by GitHub
parent 427fdc6c64
commit 795bba2af4
20 changed files with 764 additions and 325 deletions
+1 -2
View File
@@ -63,7 +63,6 @@ CREATE TYPE userstatus AS ENUM (
);
CREATE TYPE workspace_transition AS ENUM (
'create',
'start',
'stop',
'delete'
@@ -334,7 +333,7 @@ ALTER TABLE ONLY workspace_resource
ADD CONSTRAINT workspace_resource_workspace_agent_token_key UNIQUE (workspace_agent_token);
ALTER TABLE ONLY workspace_resource
ADD CONSTRAINT workspace_resource_workspace_history_id_name_key UNIQUE (workspace_history_id, name);
ADD CONSTRAINT workspace_resource_workspace_history_id_type_name_key UNIQUE (workspace_history_id, type, name);
ALTER TABLE ONLY project_version_parameter
ADD CONSTRAINT project_version_parameter_project_version_id_fkey FOREIGN KEY (project_version_id) REFERENCES project_version(id) ON DELETE CASCADE;
+1 -3
View File
@@ -9,7 +9,6 @@ CREATE TABLE workspace (
);
CREATE TYPE workspace_transition AS ENUM (
'create',
'start',
'stop',
'delete'
@@ -50,8 +49,7 @@ CREATE TABLE workspace_resource (
-- If an agent has been conencted for this resource,
-- the agent table is not null.
workspace_agent_id uuid,
UNIQUE(workspace_history_id, name)
UNIQUE(workspace_history_id, type, name)
);
CREATE TABLE workspace_agent (
-1
View File
@@ -230,7 +230,6 @@ func (e *UserStatus) Scan(src interface{}) error {
type WorkspaceTransition string
const (
WorkspaceTransitionCreate WorkspaceTransition = "create"
WorkspaceTransitionStart WorkspaceTransition = "start"
WorkspaceTransitionStop WorkspaceTransition = "stop"
WorkspaceTransitionDelete WorkspaceTransition = "delete"