Skip to content

Commit 4bf9163

Browse files
author
vikasrohit
authored
Merge pull request #283 from topcoder-platform/feature/project-templates-refactoring
Feature/project templates refactoring
2 parents 4610277 + 6e46212 commit 4bf9163

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+11044
-2159
lines changed

config/default.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,6 @@
5656
"inviteEmailSubject": "You are invited to Topcoder",
5757
"inviteEmailSectionTitle": "Project Invitation",
5858
"connectUrl":"https://connect.topcoder-dev.com",
59-
"accountsAppUrl": "https://accounts.topcoder-dev.com"
60-
59+
"accountsAppUrl": "https://accounts.topcoder-dev.com",
60+
"MAX_REVISION_NUMBER": 100
6161
}

config/test.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"AUTH_SECRET": "secret",
3+
"MAX_REVISION_NUMBER": 2,
34
"logLevel": "debug",
45
"captureLogs": "false",
56
"logentriesToken": "",
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
--
2+
-- form
3+
--
4+
5+
CREATE TABLE form (
6+
id bigint NOT NULL,
7+
"key" character varying(45) NOT NULL,
8+
"version" bigint DEFAULT 1 NOT NULL,
9+
"revision" bigint DEFAULT 1 NOT NULL,
10+
"scope" json DEFAULT '{}'::json NOT NULL,
11+
"deletedAt" timestamp with time zone,
12+
"createdAt" timestamp with time zone,
13+
"updatedAt" timestamp with time zone,
14+
"deletedBy" bigint,
15+
"createdBy" bigint NOT NULL,
16+
"updatedBy" bigint NOT NULL
17+
);
18+
19+
ALTER TABLE form
20+
ADD CONSTRAINT form_key_version_revision UNIQUE (key, version, revision);
21+
22+
CREATE SEQUENCE form_id_seq
23+
START WITH 1
24+
INCREMENT BY 1
25+
NO MINVALUE
26+
NO MAXVALUE
27+
CACHE 1;
28+
29+
ALTER SEQUENCE form_id_seq OWNED BY form.id;
30+
31+
--
32+
-- price_config
33+
--
34+
35+
CREATE TABLE price_config (
36+
id bigint NOT NULL,
37+
"key" character varying(45) NOT NULL,
38+
"version" bigint DEFAULT 1 NOT NULL,
39+
"revision" bigint DEFAULT 1 NOT NULL,
40+
"config" json DEFAULT '{}'::json NOT NULL,
41+
"deletedAt" timestamp with time zone,
42+
"createdAt" timestamp with time zone,
43+
"updatedAt" timestamp with time zone,
44+
"deletedBy" bigint,
45+
"createdBy" bigint NOT NULL,
46+
"updatedBy" bigint NOT NULL
47+
);
48+
49+
ALTER TABLE price_config
50+
ADD CONSTRAINT price_config_key_version_revision UNIQUE (key, version, revision);
51+
52+
CREATE SEQUENCE price_config_id_seq
53+
START WITH 1
54+
INCREMENT BY 1
55+
NO MINVALUE
56+
NO MAXVALUE
57+
CACHE 1;
58+
59+
ALTER SEQUENCE price_config_id_seq OWNED BY price_config.id;
60+
61+
--
62+
-- plan_config
63+
--
64+
65+
CREATE TABLE plan_config (
66+
id bigint NOT NULL,
67+
"key" character varying(45) NOT NULL,
68+
"version" bigint DEFAULT 1 NOT NULL,
69+
"revision" bigint DEFAULT 1 NOT NULL,
70+
"phases" json DEFAULT '{}'::json NOT NULL,
71+
"deletedAt" timestamp with time zone,
72+
"createdAt" timestamp with time zone,
73+
"updatedAt" timestamp with time zone,
74+
"deletedBy" bigint,
75+
"createdBy" bigint NOT NULL,
76+
"updatedBy" bigint NOT NULL
77+
);
78+
79+
ALTER TABLE plan_config
80+
ADD CONSTRAINT plan_config_key_version_revision UNIQUE (key, version, revision);
81+
82+
CREATE SEQUENCE plan_config_id_seq
83+
START WITH 1
84+
INCREMENT BY 1
85+
NO MINVALUE
86+
NO MAXVALUE
87+
CACHE 1;
88+
89+
ALTER SEQUENCE plan_config_id_seq OWNED BY plan_config.id;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
--
2+
-- project_templates
3+
--
4+
ALTER TABLE project_templates ALTER COLUMN "scope" DROP NOT NULL;
5+
ALTER TABLE project_templates ALTER COLUMN "phases" DROP NOT NULL;
6+
7+
ALTER TABLE project_templates ADD COLUMN "planConfig" json;
8+
ALTER TABLE project_templates ADD COLUMN "priceConfig" json;
9+
ALTER TABLE project_templates ADD COLUMN "form" json;

0 commit comments

Comments
 (0)