Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 95193b7

Browse files
committed
SQL migrations
1 parent dcab873 commit 95193b7

File tree

5 files changed

+148
-22
lines changed

5 files changed

+148
-22
lines changed

coderd/database/dump.sql

Lines changed: 56 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DROP TABLE template_version_parameters;
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
CREATE TABLE template_version_parameters (
2+
template_version_id uuid not null references template_versions (id) on delete cascade,
3+
name text not null,
4+
description text not null,
5+
type text not null,
6+
mutable boolean not null,
7+
default_value text not null,
8+
icon text not null,
9+
options jsonb not null default '[]'::jsonb,
10+
validation_regex text not null,
11+
validation_min integer not null,
12+
validation_max integer not null,
13+
unique (template_version_id, name)
14+
);
15+
16+
COMMENT ON COLUMN template_version_parameters.name IS 'Parameter name';
17+
COMMENT ON COLUMN template_version_parameters.description IS 'Parameter description';
18+
COMMENT ON COLUMN template_version_parameters.type IS 'Parameter type';
19+
COMMENT ON COLUMN template_version_parameters.mutable IS 'Is parameter mutable?';
20+
COMMENT ON COLUMN template_version_parameters.default_value IS 'Default value';
21+
COMMENT ON COLUMN template_version_parameters.icon IS 'Icon';
22+
COMMENT ON COLUMN template_version_parameters.options IS 'Additional options';
23+
COMMENT ON COLUMN template_version_parameters.validation_regex IS 'Validation: regex pattern';
24+
COMMENT ON COLUMN template_version_parameters.validation_min IS 'Validation: minimum length of value';
25+
COMMENT ON COLUMN template_version_parameters.validation_max IS 'Validation: maximum length of value';
26+
27+
CREATE TABLE workspace_build_parameters (
28+
workspace_build_id uuid not null references workspace_builds (id) on delete cascade,
29+
name text not null,
30+
value text not null,
31+
unique (workspace_build_id, name)
32+
);
33+
34+
COMMENT ON COLUMN workspace_build_parameters.name IS 'Parameter name';
35+
COMMENT ON COLUMN workspace_build_parameters.value IS 'Parameter value';

coderd/database/models.go

Lines changed: 32 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/unique_constraint.go

Lines changed: 24 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)