Skip to content

Production release for Connect 2.4.15 #385

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 151 commits into from
Oct 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
151 commits
Select commit Hold shift + click to select a range
9251ef3
winning submission from the challenge 30093850 - Topcoder Project Ser…
maxceem Jul 1, 2019
84b3564
fix list workstreams for project endpoint
maxceem Jul 1, 2019
9e58ae0
Github issue#2970, Scope Change Workflow
Jul 5, 2019
289cf2b
Made the feature branch deployable temporarily
Jul 8, 2019
4360d89
Updated the status which should freeze the scope for updates
Jul 10, 2019
e507dfa
added checks for user already member of the team
romitrivigo Jul 11, 2019
2afb1a0
index ProjectPhases and PhaseProducts in ES when we use work and work…
maxceem Jul 11, 2019
de57f00
review changes, added test cases
romitrivigo Jul 12, 2019
bd56944
added failed object check and removed test disable block
romitrivigo Jul 15, 2019
941086a
Merge branch 'dev' into feature/workstreams
maxceem Jul 17, 2019
a965c22
implementation of general methods to check permissions: matchPermissi…
maxceem Jul 17, 2019
b590fb0
Merge branch 'feature/util-has-permission' into feature/workstreams-r…
maxceem Jul 17, 2019
1d56b6b
refactored workManagementForTemplate permission middleware to reuse g…
maxceem Jul 17, 2019
9fe3327
fix lint
maxceem Jul 17, 2019
5a2070d
refactored copilotAndAbove permission "middleware" to use general uti…
maxceem Jul 17, 2019
4b9ef4f
review changes
romitrivigo Jul 18, 2019
bd005ba
Merge pull request #341 from romitgit/cf18
maxceem Jul 18, 2019
752b21f
Merge branch 'dev' into cf18
maxceem Jul 18, 2019
9a17c1b
fix member invitation tests after merging with updated DEV branch
maxceem Jul 18, 2019
5eaf7b8
Merge branch 'cf18' into dev-next
maxceem Jul 18, 2019
d5d69da
Merge pull request #347 from topcoder-platform/dev-next
Jul 18, 2019
4eb6e47
added constant with estimation types ESTIMATION_TYPE
maxceem Jul 18, 2019
82994ca
implement scope change request workflow
vignesh-at-alation Jul 18, 2019
702d8f1
refactor workManagementPermission model to use unified permission for…
maxceem Jul 19, 2019
ae06542
renamed files to follow standard practice in our repo
maxceem Jul 19, 2019
34bec46
renamed model WorkManagementPemirrions to singular WorkManagementPemi…
maxceem Jul 19, 2019
3372cd9
- Fix populating products from db.
gets0ul Jul 23, 2019
40b6190
66-FF-1 Workstreams - Project Service
mfikria Jul 23, 2019
e88e61c
Merge pull request #349 from gets0ul/populate_products
maxceem Jul 23, 2019
3d0752b
fix testing status 'active' for phases and works
mfikria Jul 23, 2019
9c45395
Scope change review fixes
vignesh-at-alation Jul 23, 2019
39fa4da
fix review issues in scope change workflow
vignesh-at-alation Jul 23, 2019
cc0ca8f
Merge pull request #350 from tc-mfikria/feature/workstreams
maxceem Jul 24, 2019
997cfe4
Merge pull request #342 from topcoder-platform/feature/workstreams
Jul 24, 2019
da72459
update elastic search index on activation of scope change request
vignesh-at-alation Jul 24, 2019
66d10cd
updated seedMetadata script to also copy new metadata objects: forms,…
maxceem Jul 25, 2019
f8bd565
create phases using planConfig during project creation if project use…
maxceem Jul 25, 2019
74ae64c
in case of server error during Direct project creation, show short er…
maxceem Jul 25, 2019
f2c5752
fix review issues in scope change request
vignesh-at-alation Jul 26, 2019
3f52303
Merge pull request #348 from vigneshTheDev/feature/scope_change_workflow
Jul 26, 2019
45f0d0b
fix project model to have many 'workStreams' instead of 'works'
maxceem Jul 27, 2019
5bebbac
create WorkStreams based on project data and workstream config which …
maxceem Jul 27, 2019
fe5d2f7
TEMPORARY let all the Topcoder managers to do all the work management…
maxceem Jul 27, 2019
0a8fa0f
set flag for the project with workstreams
maxceem Jul 28, 2019
0709d03
added new fields to the ProjectPhase model: "description" and "requir…
maxceem Jul 29, 2019
52e31bb
Merge pull request #353 from maxceem/feature/phase-description-requir…
Jul 29, 2019
86db685
Merge branch 'dev' into feature/scope_change_workflow
Jul 29, 2019
10d44aa
Removed feature branch from deployable branch list.
Jul 29, 2019
b78f3bf
Merge pull request #354 from topcoder-platform/feature/scope_change_w…
Jul 29, 2019
f6af2e9
Add migration scripts
vignesh-at-alation Jul 29, 2019
9548712
refactor migration scripts
vignesh-at-alation Jul 29, 2019
c41c237
Merge pull request #355 from vigneshTheDev/feature/scope_change_workflow
Jul 29, 2019
797714d
Merge pull request #356 from topcoder-platform/feature/scope_change_w…
Jul 29, 2019
7554964
Commented logging of the full sequelize object to check if this is ca…
Jul 29, 2019
9549d42
Added done callback to explicitly let mocha know about `before` and `…
Jul 29, 2019
711f99d
Lint fix
Jul 29, 2019
3e85a22
changing kafka topic name
Jul 29, 2019
c5d870d
adding project prefix before timwline to uniform the topic name
Aug 1, 2019
ced8984
Fix appirio-tech/connect-app/issues/3230 - merge array fields properl…
vignesh-at-alation Aug 1, 2019
3178d08
Merge pull request #361 from vigneshTheDev/dev
Aug 2, 2019
236d031
allow creating timelines with reference=work
maxceem Aug 2, 2019
1d61da2
Merge branch 'dev' of github.com:topcoder-platform/tc-project-service…
maxceem Aug 2, 2019
b560364
Initial commit for reporting support
Aug 5, 2019
11adf6a
Updated package lock
Aug 5, 2019
43ec71c
Postman collection update
Aug 5, 2019
641bd90
Deployable feature branch
Aug 5, 2019
2c12891
lint fix
Aug 5, 2019
c285563
Empty default config
Aug 5, 2019
eac3602
Included mock file (by renaming to .js instead of .json) in the build
Aug 5, 2019
ae6a598
Trying to fix the inclusion of mock son
Aug 5, 2019
41202f5
Merge pull request #360 from topcoder-platform/feature/kafka-topic-na…
Aug 6, 2019
ca54df2
Merge pull request #363 from topcoder-platform/feature/looker-api-int…
Aug 6, 2019
f778c99
Trying to read Boolean variable correctly via config module
Aug 6, 2019
fa8e33e
Adding new projectBudget report type.
mishacucicea Aug 6, 2019
66c6a07
hardcode maximum number of workItems per work as 100
maxceem Aug 8, 2019
63a610d
restrict budget view to manager roles.
mishacucicea Aug 11, 2019
1422da8
Revert cross-env changes and fix bool value.
mishacucicea Aug 11, 2019
24bea07
Adjust IDs to cover what's populated on dev.
mishacucicea Aug 11, 2019
67d0fe2
Merge branch 'dev' into feature/looker-api-integration
maxceem Aug 12, 2019
011398a
Merge pull request #364 from topcoder-platform/feature/looker-api-int…
Aug 12, 2019
c219547
fix 'enableFileUpload' flag on in DEV environment
maxceem Aug 12, 2019
6276265
Merge branch 'dev' of github.com:topcoder-platform/tc-project-service…
maxceem Aug 12, 2019
bd8bd02
added debug logging for getFileDownloadUrl
maxceem Aug 12, 2019
1464d04
fix 'enableFileUpload' flag on in DEV environment, part 2
maxceem Aug 12, 2019
95074c7
winning submission from challenge 30096338
maxceem Aug 12, 2019
94473a3
Fixed the logic for determining the manager and admin users
Aug 12, 2019
647ee72
fix “GET /projects/{id}/estimations/{id}/items” endpoint
maxceem Aug 12, 2019
8f190e9
Merge branch 'dev' of https://github.com/topcoder-platform/tc-project…
Aug 12, 2019
e00e321
Fetching the connect project id as well in the result
Aug 12, 2019
69177ff
Lint fix
Aug 12, 2019
be0bfae
Using connect project id instead of direct project id for topcoder di…
Aug 13, 2019
b82d0dd
Fixing mock data for every project
Aug 13, 2019
9894c14
lint fix
Aug 13, 2019
d6dffb7
Using non ES6 syntax, not sure why it is failing in the build
Aug 13, 2019
e177b7e
Fixed syntax typo
Aug 13, 2019
607f655
lint fix
Aug 13, 2019
9b4ca10
Real fix for lint :)
Aug 13, 2019
df06bf3
winning submission from the challenge 30096337
maxceem Aug 14, 2019
1dda122
reset changes in config files
maxceem Aug 14, 2019
74ca82b
More permissions update
Aug 14, 2019
2946084
fixed issues found during review, improved code quality, improved uni…
maxceem Aug 15, 2019
8669f97
Merge branch 'dev' into feature/price-estimation-items/project-settings
maxceem Aug 15, 2019
57aae7a
small fixes to postman
maxceem Aug 15, 2019
f30367e
fix swagger
maxceem Aug 15, 2019
f1dc776
re-save postman file in versions 2.1 for easier merging
maxceem Aug 15, 2019
0db1130
Merge branch 'feature/price-estimation-items/building-blocks' into fe…
maxceem Aug 15, 2019
eda13da
make logic of filtering Project Estimation Items more general. Cleane…
maxceem Aug 15, 2019
02bc7b0
use the solution from the second place submitter to take care about p…
maxceem Aug 15, 2019
4438074
clean up of extra logging
Aug 16, 2019
6fbebfb
Merge pull request #367 from topcoder-platform/hotfix/log-error-detai…
Aug 16, 2019
3301693
Update topics for works
phoenix303 Aug 16, 2019
4374dcb
Merge pull request #368 from phoenix303/update-work-topics
maxceem Aug 16, 2019
60dc97c
fixed comments and method naming after f2f challenge for create new t…
maxceem Aug 16, 2019
c96fec1
Permission endpoints
phoenix303 Aug 18, 2019
23e9442
fix: unit test failed due to not restoring RabbitMQ mock after we nee…
maxceem Aug 18, 2019
6e1219d
fix: some unit tests quite randomly fail most likely because of mocki…
maxceem Aug 19, 2019
214f2d3
fix: added rabbitmq image to circle config for "test" job
maxceem Aug 19, 2019
3ba8c3b
Merge pull request #369 from topcoder-platform/feature/topics-for-works
Aug 19, 2019
cb0fd93
fix: attempt to fix floating test failed on CircleCI
maxceem Aug 22, 2019
7a858cb
Revert "fix: attempt to fix floating test failed on CircleCI"
maxceem Aug 22, 2019
5b3e816
Merge pull request #370 from phoenix303/permission-endpoints
maxceem Aug 22, 2019
f74d2f5
refactor: improve performance of get project permissions endpoint
maxceem Aug 22, 2019
cf0c088
Merge pull request #374 from topcoder-platform/feature/permission-end…
Aug 23, 2019
f67092b
fix: more realistic condition for demo/test building block
maxceem Aug 23, 2019
1a23721
fix: remove unnecessary ESTIMATION_TYPE.REFERENCE_PROGRAM
maxceem Aug 23, 2019
eaaaef0
refactor: correct name for model creating method defineProjectEstimat…
maxceem Aug 23, 2019
adec0ce
refactor: enhance unit test description
maxceem Aug 23, 2019
a8b24c4
Merge branch 'dev' into feature/price-estimation-items/merged
maxceem Aug 23, 2019
70d70d8
fix: lint
maxceem Aug 23, 2019
9df0aca
Merge pull request #373 from topcoder-platform/feature/price-estimati…
Aug 23, 2019
4ee34bf
feat: make milestone texts optional
maxceem Aug 27, 2019
0995456
fix: remove unit tests which are no need anymore
maxceem Aug 27, 2019
e54c7ba
feat: remove validation of timeline.startDate when creating a new mil…
maxceem Aug 28, 2019
0b9afe7
Disabled the scope change work flow for the immediate release of quer…
Aug 28, 2019
2d0a85b
Merge pull request #377 from maxceem/feature/milestones-optional-texts
Aug 29, 2019
3253e74
feat: create project with phases if "workstreamsConfig" is not provided
maxceem Aug 30, 2019
1bb5c08
Github issue#376, Timeline is not updated in ES
Sep 4, 2019
19460ed
Fixed lin
Sep 4, 2019
1f82fd0
fix: updating timeline in ES index on milestone updates
maxceem Sep 10, 2019
9518fe4
Merge pull request #380 from topcoder-platform/feature/update_timelin…
Sep 10, 2019
5f74173
feat: let project bookmarks have created/updated At/By fields
maxceem Sep 21, 2019
89c6d38
fix: typo
maxceem Sep 21, 2019
fc4b82a
implement new roles
mfikria Sep 21, 2019
dd7a3bf
remove console
mfikria Sep 22, 2019
4b7336f
Merge pull request #383 from fikzzzy/feature/new-roles
Sep 26, 2019
fc272ce
add roles that can join as manager
mfikria Oct 1, 2019
d7279f2
add program manager, project manager, and solution architect roles to…
mfikria Oct 1, 2019
f95a249
MEMBER_JOINED_EVENT event should be sent when user has any manager ro…
mfikria Oct 1, 2019
f4c756c
Merge pull request #386 from fikzzzy/feature/new-roles
maxceem Oct 1, 2019
49de528
Merge branch 'master' into dev
Oct 1, 2019
e2ad1f7
Merge pull request #387 from topcoder-platform/feature/new-roles
Oct 1, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:
- POSTGRES_USER: circle_test
- POSTGRES_DB: circle_test
- image: elasticsearch:2.3
- image: rabbitmq:3-management
environment:
DB_MASTER_URL: postgres://circle_test:@127.0.0.1:5432/circle_test
AUTH_SECRET: secret
Expand Down Expand Up @@ -96,7 +97,7 @@ workflows:
- test
filters:
branches:
only: ['dev', 'dev-sts']
only: ['dev', 'dev-sts', 'feature/looker-api-integration']
- deployProd:
context : org-global
requires:
Expand Down
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"mocha": true
},
"rules": {
"import/no-extraneous-dependencies": ["error", {"devDependencies": ["**/*.test.js", "**/*.spec.js", "**/serviceMocks.js"]}],
"import/no-extraneous-dependencies": ["error", {"devDependencies": ["**/*.test.js", "**/*.spec.js", "src/tests/*.js"]}],
"max-len": ["error", { "ignoreComments": true, "code": 120 }],
"valid-jsdoc": ["error", {
"requireReturn": true,
Expand Down
13 changes: 12 additions & 1 deletion config/custom-environment-variables.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,16 @@
"accountsAppUrl": "ACCOUNTS_APP_URL",
"inviteEmailSubject": "INVITE_EMAIL_SUBJECT",
"inviteEmailSectionTitle": "INVITE_EMAIL_SECTION_TITLE",
"SSO_REFCODES": "SSO_REFCODES"
"SSO_REFCODES": "SSO_REFCODES",
"lookerConfig": {
"BASE_URL": "LOOKER_API_BASE_URL",
"CLIENT_ID": "LOOKER_API_CLIENT_ID",
"CLIENT_SECRET": "LOOKER_API_CLIENT_SECRET",
"TOKEN": "TOKEN",
"USE_MOCK": "LOOKER_API_ENABLE_MOCK",
"QUERIES": {
"REG_STATS": "LOOKER_API_REG_STATS_QUERY_ID",
"BUDGET": "LOOKER_API_BUDGET_QUERY_ID"
}
}
}
13 changes: 12 additions & 1 deletion config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,16 @@
"MAX_REVISION_NUMBER": 100,
"UNIQUE_GMAIL_VALIDATION": false,
"SSO_REFCODES": "[]",
"VALID_STATUSES_BEFORE_PAUSED": "[\"active\"]"
"VALID_STATUSES_BEFORE_PAUSED": "[\"active\"]",
"lookerConfig": {
"BASE_URL": "",
"CLIENT_ID": "",
"CLIENT_SECRET": "",
"TOKEN": "TOKEN",
"USE_MOCK": "true",
"QUERIES": {
"REG_STATS": 1234,
"BUDGET": 123
}
}
}
40 changes: 39 additions & 1 deletion local/seed/seedMetadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,45 @@ module.exports = (targetUrl, token) => {
'Authorization': 'Bearer ' + token
}

let promises = _(data.result.content.projectTypes).map(pt=>{
let promises

promises = _(data.result.content.forms).orderBy(['key', 'asc'], ['version', 'asc']).map(pt=>{
const param = _.omit(pt, ['id', 'version', 'revision', 'key']);
return axios
.post(destUrl + `metadata/form/${pt.key}/versions`,{param}, {headers:headers})
.catch((err) => {
const errMessage = _.get(err, 'response.data.result.content.message', '');
console.log(`Failed to create form with key=${pt.key} version=${pt.version}.`, errMessage)
})
});

await Promise.all(promises);

promises = _(data.result.content.planConfigs).orderBy(['key', 'asc'], ['version', 'asc']).map(pt=>{
const param = _.omit(pt, ['id', 'version', 'revision', 'key']);
return axios
.post(destUrl + `metadata/planConfig/${pt.key}/versions`,{param}, {headers:headers})
.catch((err) => {
const errMessage = _.get(err, 'response.data.result.content.message', '');
console.log(`Failed to create planConfig with key=${pt.key} version=${pt.version}.`, errMessage)
})
});

await Promise.all(promises);

promises = _(data.result.content.priceConfigs).orderBy(['key', 'asc'], ['version', 'asc']).map(pt=>{
const param = _.omit(pt, ['id', 'version', 'revision', 'key']);
return axios
.post(destUrl + `metadata/priceConfig/${pt.key}/versions`,{param}, {headers:headers})
.catch((err) => {
const errMessage = _.get(err, 'response.data.result.content.message', '');
console.log(`Failed to create priceConfig with key=${pt.key} version=${pt.version}.`, errMessage)
})
});

await Promise.all(promises);

promises = _(data.result.content.projectTypes).map(pt=>{
return axios
.post(destUrl+'metadata/projectTypes',{param:pt}, {headers:headers})
.catch((err) => {
Expand Down
17 changes: 16 additions & 1 deletion local/seed/seedProjects.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import util from '../../src/tests/util';
import models from '../../src/models';

const axios = require('axios');
const Promise = require('bluebird');
Expand Down Expand Up @@ -54,6 +55,21 @@ module.exports = (targetUrl, token) => {
});
}

await models.ProjectEstimation.create({
projectId,
buildingBlockKey: 'BLOCK_KEY',
conditions: '( HAS_DEV_DELIVERABLE && ONLY_ONE_OS_MOBILE && CA_NEEDED )',
price: 6500.50,
quantity: 10,
minTime: 35,
maxTime: 35,
metadata: {
deliverable: 'dev-qa',
},
createdBy: 1,
updatedBy: 1,
});

// creating invitations
if (Array.isArray(invites)) {
let promises = []
Expand Down Expand Up @@ -134,4 +150,3 @@ function updateProjectMemberInvite(projectId, params, targetUrl, headers) {
console.log(`Failed to update project member invites ${projectId}: ${err.message}`);
})
}

82 changes: 82 additions & 0 deletions migrations/20190624_workStream.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
--
-- CREATE NEW TABLE:
-- work_streams
--
CREATE TABLE work_streams (
id bigint NOT NULL,
"name" character varying(255) NOT NULL,
"type" character varying(45) NOT NULL,
"status" character varying(255) NOT NULL,
"projectId" bigint NOT NULL,
"deletedAt" timestamp with time zone,
"createdAt" timestamp with time zone,
"updatedAt" timestamp with time zone,
"deletedBy" bigint,
"createdBy" bigint NOT NULL,
"updatedBy" bigint NOT NULL
);

CREATE SEQUENCE work_streams_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;

ALTER SEQUENCE work_streams_id_seq OWNED BY work_streams.id;

ALTER TABLE work_streams
ALTER COLUMN id SET DEFAULT nextval('work_streams_id_seq');

ALTER TABLE ONLY work_streams
ADD CONSTRAINT "work_streams_pkey" PRIMARY KEY (id);

ALTER TABLE ONLY work_streams
ADD CONSTRAINT "work_streams_projectId_fkey" FOREIGN KEY ("projectId") REFERENCES projects(id) ON UPDATE CASCADE ON DELETE SET NULL;

--
-- CREATE NEW TABLE:
-- work_management_permissions
--
CREATE TABLE work_management_permissions (
id bigint NOT NULL,
"policy" character varying(255) NOT NULL,
"permission" json NOT NULL,
"projectTemplateId" bigint NOT NULL,
"deletedAt" timestamp with time zone,
"createdAt" timestamp with time zone,
"updatedAt" timestamp with time zone,
"deletedBy" bigint,
"createdBy" bigint NOT NULL,
"updatedBy" bigint NOT NULL
);

CREATE SEQUENCE work_management_permissions_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;

ALTER SEQUENCE work_management_permissions_id_seq OWNED BY work_management_permissions.id;

ALTER TABLE work_management_permissions
ALTER COLUMN id SET DEFAULT nextval('work_management_permissions_id_seq');

--
-- CREATE NEW TABLE:
-- phase_work_streams
--
CREATE TABLE phase_work_streams (
"workStreamId" bigint NOT NULL,
"phaseId" bigint NOT NULL
);

ALTER TABLE ONLY phase_work_streams
ADD CONSTRAINT "phase_work_streams_pkey" PRIMARY KEY ("workStreamId", "phaseId");

ALTER TABLE ONLY phase_work_streams
ADD CONSTRAINT "phase_work_streams_phaseId_fkey" FOREIGN KEY ("phaseId") REFERENCES project_phases(id) ON UPDATE CASCADE ON DELETE CASCADE;

ALTER TABLE ONLY phase_work_streams
ADD CONSTRAINT "phase_work_streams_workStreamId_fkey" FOREIGN KEY ("workStreamId") REFERENCES work_streams(id) ON UPDATE CASCADE ON DELETE CASCADE;
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
-- CREATE NEW TABLES:
-- project_settings
-- project_estimation_items
--

--
-- project_settings
--

CREATE TABLE project_settings (
id bigint NOT NULL,
key character varying(255),
value character varying(255),
"valueType" character varying(255),
"projectId" bigint NOT NULL,
metadata json NOT NULL DEFAULT '{}'::json,
"readPermission" json NOT NULL DEFAULT '{}'::json,
"writePermission" json NOT NULL DEFAULT '{}'::json,
"deletedAt" timestamp with time zone,
"createdAt" timestamp with time zone,
"updatedAt" timestamp with time zone,
"deletedBy" bigint,
"createdBy" bigint NOT NULL,
"updatedBy" bigint NOT NULL,
CONSTRAINT project_settings_pkey PRIMARY KEY (id)
);

CREATE SEQUENCE project_settings_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;

ALTER SEQUENCE project_settings_id_seq OWNED BY project_settings.id;

ALTER TABLE project_settings
ALTER COLUMN id SET DEFAULT nextval('project_settings_id_seq');

ALTER TABLE project_settings
ADD CONSTRAINT project_settings_key_project_id UNIQUE (key, "projectId");

--
-- project_estimation_items
--

CREATE TABLE project_estimation_items (
id bigint NOT NULL,
"projectEstimationId" bigint NOT NULL,
price double precision NOT NULL,
type character varying(255) NOT NULL,
"markupUsedReference" character varying(255) NOT NULL,
"markupUsedReferenceId" bigint NOT NULL,
metadata json NOT NULL DEFAULT '{}'::json,
"deletedAt" timestamp with time zone,
"createdAt" timestamp with time zone,
"updatedAt" timestamp with time zone,
"deletedBy" bigint,
"createdBy" bigint NOT NULL,
"updatedBy" bigint NOT NULL,
CONSTRAINT project_estimation_items_pkey PRIMARY KEY (id)
);

CREATE SEQUENCE project_estimation_items_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;

ALTER SEQUENCE project_estimation_items_id_seq OWNED BY form.id;

ALTER TABLE project_estimation_items
ALTER COLUMN id SET DEFAULT nextval('project_estimation_items_id_seq');
35 changes: 35 additions & 0 deletions migrations/20190720_project_building_block.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
--
-- CREATE NEW TABLE:
-- building_blocks
--
CREATE TABLE building_blocks (
id bigint NOT NULL,
"key" character varying(255) NOT NULL,
"config" json NOT NULL DEFAULT '{}'::json,
"privateConfig" json NOT NULL DEFAULT '{}'::json,
"deletedAt" timestamp with time zone,
"createdAt" timestamp with time zone,
"updatedAt" timestamp with time zone,
"deletedBy" bigint,
"createdBy" bigint NOT NULL,
"updatedBy" bigint NOT NULL
);

ALTER TABLE building_blocks
ADD CONSTRAINT building_blocks_key_uniq UNIQUE (key);

CREATE SEQUENCE building_blocks_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;

ALTER SEQUENCE building_blocks_id_seq OWNED BY building_blocks.id;

ALTER TABLE building_blocks
ALTER COLUMN id SET DEFAULT nextval('building_blocks_id_seq');

ALTER TABLE ONLY building_blocks
ADD CONSTRAINT building_blocks_pkey PRIMARY KEY (id);

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
--
-- UPDATE EXISTING TABLES:
-- project_phases
-- description column: added
-- requirements column: added

ALTER TABLE project_phases ADD COLUMN "description" character varying(255);
ALTER TABLE project_phases ADD COLUMN "requirements" text;
42 changes: 42 additions & 0 deletions migrations/20190729_scope_change_requests.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
--
-- CREATE NEW TABLE:
-- scope_change_requests
--

CREATE TABLE scope_change_requests
(
id bigint NOT NULL,
"projectId" bigint NOT NULL,
"oldScope" json NOT NULL,
"newScope" json NOT NULL,
status character varying(45) NOT NULL,
"deletedAt" timestamp with time zone,
"createdAt" timestamp with time zone,
"updatedAt" timestamp with time zone,
"approvedAt" timestamp with time zone,
"deletedBy" integer,
"createdBy" integer NOT NULL,
"updatedBy" integer NOT NULL,
"approvedBy" integer
);


CREATE SEQUENCE scope_change_requests_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;


ALTER SEQUENCE scope_change_requests_id_seq OWNED BY scope_change_requests.id;

ALTER TABLE scope_change_requests
ALTER COLUMN id SET DEFAULT nextval('scope_change_requests_id_seq');

ALTER TABLE ONLY scope_change_requests
ADD CONSTRAINT scope_change_requests_pkey PRIMARY KEY (id);

ALTER TABLE ONLY scope_change_requests
ADD CONSTRAINT "scope_change_requests_projectId_fkey" FOREIGN KEY ("projectId")
REFERENCES projects(id) MATCH SIMPLE ON UPDATE CASCADE ON DELETE CASCADE;
8 changes: 8 additions & 0 deletions migrations/20190927_milestone_texts_not_required.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
--
-- UPDATE EXISTING TABLES:
-- milestones

ALTER TABLE milestones ALTER COLUMN "plannedText" DROP NOT NULL;
ALTER TABLE milestones ALTER COLUMN "activeText" DROP NOT NULL;
ALTER TABLE milestones ALTER COLUMN "completedText" DROP NOT NULL;
ALTER TABLE milestones ALTER COLUMN "blockedText" DROP NOT NULL;
Loading