Skip to content

Commit 4f99473

Browse files
Merge pull request #10 from topcoder-platform/dev
Dev - dev-test-pg
2 parents 6389f71 + 4f801ed commit 4f99473

File tree

7 files changed

+423
-29
lines changed

7 files changed

+423
-29
lines changed

.circleci/config.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ build_steps: &build_steps
4141
command: |
4242
./awsconfiguration.sh ${DEPLOY_ENV}
4343
source awsenvconf
44-
45-
./buildenv.sh -e ${DEPLOY_ENV} -b ${LOGICAL_ENV}-${APP_NAME}-consumer-deployvar
46-
source buildenvvar
47-
./master_deploy.sh -d ECS -e ${DEPLOY_ENV} -t latest -s ${GLOBAL_ENV}-global-appvar,${LOGICAL_ENV}-${APP_NAME}-appvar -i postgres-ifx-processer
44+
45+
# ./buildenv.sh -e ${DEPLOY_ENV} -b ${LOGICAL_ENV}-${APP_NAME}-consumer-deployvar
46+
#source buildenvvar
47+
#./master_deploy.sh -d ECS -e ${DEPLOY_ENV} -t latest -s ${GLOBAL_ENV}-global-appvar,${LOGICAL_ENV}-${APP_NAME}-appvar -i postgres-ifx-processer
4848
4949
echo "Running Masterscript - deploy postgres-ifx-processer producer"
5050
if [ -e ${LOGICAL_ENV}-${APP_NAME}-consumer-deployvar.json ]; then sudo rm -vf ${LOGICAL_ENV}-${APP_NAME}-consumer-deployvar.json; fi
@@ -58,11 +58,11 @@ build_steps: &build_steps
5858
source buildenvvar
5959
./master_deploy.sh -d ECS -e ${DEPLOY_ENV} -t latest -s ${GLOBAL_ENV}-global-appvar,${LOGICAL_ENV}-${APP_NAME}-appvar -i postgres-ifx-processer
6060
61-
echo "Running Masterscript - deploy postgres-ifx-processer reconsiler1"
62-
if [ -e ${LOGICAL_ENV}-${APP_NAME}-reconsiler1-deployvar.json ]; then sudo rm -vf ${LOGICAL_ENV}-${APP_NAME}-reconsiler1-deployvar.json; fi
63-
./buildenv.sh -e ${DEPLOY_ENV} -b ${LOGICAL_ENV}-${APP_NAME}-reconsiler1-deployvar
64-
source buildenvvar
65-
./master_deploy.sh -d ECS -e ${DEPLOY_ENV} -t latest -s ${GLOBAL_ENV}-global-appvar,${LOGICAL_ENV}-${APP_NAME}-appvar -i postgres-ifx-processer
61+
#echo "Running Masterscript - deploy postgres-ifx-processer reconsiler1"
62+
#if [ -e ${LOGICAL_ENV}-${APP_NAME}-reconsiler1-deployvar.json ]; then sudo rm -vf ${LOGICAL_ENV}-${APP_NAME}-reconsiler1-deployvar.json; fi
63+
#./buildenv.sh -e ${DEPLOY_ENV} -b ${LOGICAL_ENV}-${APP_NAME}-reconsiler1-deployvar
64+
#source buildenvvar
65+
#./master_deploy.sh -d ECS -e ${DEPLOY_ENV} -t latest -s ${GLOBAL_ENV}-global-appvar,${LOGICAL_ENV}-${APP_NAME}-appvar -i postgres-ifx-processer
6666
6767
jobs:
6868
# Build & Deploy against development backend #

config/default.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ module.exports = {
5050
},
5151
DYNAMODB:
5252
{
53-
DYNAMODB_TABLE: process.env.DYNAMODB_TABLE || 'dev_pg_ifx_payload_sync'
54-
DD_ElapsedTime: process.env.DD_ElapsedTime || 600000
53+
DYNAMODB_TABLE: process.env.DYNAMODB_TABLE || 'dev_pg_ifx_payload_sync',
54+
DD_ElapsedTime: process.env.DD_ElapsedTime || 600000
5555
},
5656

5757
AUTH0_URL: process.env.AUTH0_URL ,

informix-identity-trigger-proc.sql

Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
database common_oltp
2+
DROP PROCEDURE proc_user_update(varchar,decimal);
3+
DROP PROCEDURE proc_user_update;
4+
CREATE PROCEDURE informix.proc_user_update(
5+
new_handle varchar(50),
6+
user_id decimal(10,0))
7+
if (USER != 'ifxsyncuser') then
8+
UPDATE user SET handle_lower = lower(new_handle), modify_date = current WHERE user.user_id = user_id;
9+
End if;
10+
end procedure;
11+
create procedure "informix".proc_user_update(
12+
user_id DECIMAL(10,0),
13+
old_first_name VARCHAR(64),
14+
new_first_name VARCHAR(64),
15+
old_last_name VARCHAR(64),
16+
new_last_name VARCHAR(64),
17+
old_handle VARCHAR(50),
18+
new_handle VARCHAR(50),
19+
old_status VARCHAR(3),
20+
new_status VARCHAR(3),
21+
old_activation_code VARCHAR(32),
22+
new_activation_code VARCHAR(32),
23+
old_middle_name VARCHAR(64),
24+
new_middle_name VARCHAR(64),
25+
old_timezone_id decimal(5,0),
26+
new_timezone_id decimal(5,0)
27+
)
28+
29+
if ((old_first_name != new_first_name) or (old_last_name != new_last_name ) or (old_middle_name != new_middle_name )) then
30+
insert into audit_user (column_name, old_value, new_value,
31+
user_id)
32+
values ('NAME', NVL(old_first_name, '') || ' ' || NVL(old_middle_name, '') || ' ' || NVL(old_last_name, ''),
33+
NVL(new_first_name, '') || ' ' || NVL(new_middle_name,
34+
'') || ' ' || NVL(new_last_name, ''), user_id);
35+
End if;
36+
37+
if (old_handle != new_handle) then
38+
insert into audit_user (column_name, old_value, new_value,
39+
user_id)
40+
values ('HANDLE', old_handle, new_handle, user_id);
41+
End If;
42+
43+
if (old_status != new_status) then
44+
insert into audit_user (column_name, old_value, new_value,
45+
user_id)
46+
values ('STATUS', old_status, new_status, user_id);
47+
End If;
48+
49+
if (old_activation_code != new_activation_code) then
50+
insert into audit_user (column_name, old_value, new_value,
51+
user_id)
52+
values ('ACTIVATION_CODE', old_activation_code, new_activation_code, user_id);
53+
End If;
54+
55+
if (old_timezone_id != new_timezone_id) then
56+
insert into audit_user (column_name, old_value, new_value,
57+
user_id)
58+
values ('TIMEZONE_ID', old_timezone_id, new_timezone_id, user_id);
59+
End If;
60+
if (USER != 'ifxsyncuser') then
61+
UPDATE user SET handle_lower = lower(new_handle), modify_date = current WHERE user.user_id = user_id;
62+
End if;
63+
end procedure;
64+
65+
DROP PROCEDURE informix.proc_email_update;
66+
CREATE PROCEDURE informix.proc_email_update(
67+
email_id decimal(10,0),
68+
user_id DECIMAL(10,0),
69+
old_email_type_id DECIMAL(5,0),
70+
new_email_type_id DECIMAL(5,0),
71+
old_address VARCHAR(100),
72+
new_address VARCHAR(100),
73+
old_primary_ind DECIMAL(1,0),
74+
new_primary_ind DECIMAL(1,0),
75+
old_status_id DECIMAL(3,0),
76+
new_status_id DECIMAL(3,0)
77+
)
78+
79+
if (old_email_type_id != new_email_type_id) then
80+
insert into audit_user (column_name, old_value, new_value, user_id)
81+
values ('EMAIL_TYPE', old_email_type_id, new_email_type_id, user_id);
82+
End If;
83+
84+
if (old_status_id != new_status_id) then
85+
insert into audit_user (column_name, old_value, new_value, user_id)
86+
values ('EMAIL_STATUS', old_status_id, new_status_id, user_id);
87+
End If;
88+
89+
if (old_address != new_address) then
90+
insert into audit_user (column_name, old_value, new_value, user_id)
91+
values ('EMAIL_ADDRESS', old_address, new_address, user_id);
92+
End If;
93+
94+
if (old_primary_ind != new_primary_ind) then
95+
insert into audit_user (column_name, old_value, new_value, user_id)
96+
values ('EMAIL_PRIMARY_IND', old_primary_ind, new_primary_ind, user_id);
97+
End If;
98+
if (USER != 'ifxsyncuser') then
99+
update email set modify_date = current where email.email_id = email_id;
100+
End if;
101+
end procedure;
102+
103+
104+
database informixoltp
105+
DROP PROCEDURE informix.proc_coder_update;
106+
CREATE PROCEDURE informix.proc_coder_update(
107+
v_oldcoder_id decimal(10,0),
108+
v_oldquote varchar(255),v_newquote varchar (255),
109+
v_oldlanguage_id decimal(3,0), v_newlanguage_id decimal(3,0),
110+
v_oldcoder_type_id decimal(3,0), v_newcoder_type_id decimal(3,0),
111+
v_oldcomp_country_code varchar(3), v_newcomp_country_code varchar(3)
112+
)
113+
114+
if (v_oldquote != v_newquote) then
115+
insert into audit_coder (column_name, old_value, new_value, user_id)
116+
values ('QUOTE', v_oldquote , v_newquote, v_oldcoder_id);
117+
End if;
118+
119+
if (v_oldcoder_type_id != v_newcoder_type_id) then
120+
insert into audit_coder (column_name, old_value, new_value, user_id)
121+
values ('CODER_TYPE', v_oldcoder_type_id , v_newcoder_type_id, v_oldcoder_id);
122+
End if;
123+
124+
if (v_oldlanguage_id != v_newlanguage_id) then
125+
insert into audit_coder (column_name, old_value, new_value, user_id)
126+
values ('LANGUAGE', v_oldlanguage_id , v_newlanguage_id, v_oldcoder_id);
127+
End if;
128+
129+
if (v_oldcomp_country_code != v_newcomp_country_code) then
130+
insert into audit_coder (column_name, old_value, new_value, user_id)
131+
values ('COMP_COUNTRY', v_oldcomp_country_code , v_newcomp_country_code, v_oldcoder_id);
132+
End if;
133+
134+
if (USER != 'ifxsyncuser') then
135+
update coder set modify_date = current where coder_id = v_oldcoder_id;
136+
End if;
137+
138+
end procedure;
139+
140+
database tcs_catalog;
141+
DROP PROCEDURE proc_reliability_update;
142+
CREATE PROCEDURE informix.proc_reliability_update(
143+
p_user_id DECIMAL(10,0),
144+
p_phase_id decimal(3,0),
145+
old_rating decimal(5,4),
146+
new_rating decimal(5,4)
147+
)
148+
149+
if (USER != 'ifxsyncuser') then
150+
if (old_rating != new_rating) then
151+
insert into user_reliability_audit (column_name, old_value, new_value, user_id, phase_id)
152+
values ('RATING', old_rating, new_rating, p_user_id, p_phase_id);
153+
End If;
154+
155+
update user_reliability set modify_date = current where user_id = p_user_id and phase_id = p_phase_id;
156+
End if;
157+
end procedure;
158+
159+
DROP PROCEDURE proc_rating_update;
160+
CREATE PROCEDURE informix.proc_rating_update(
161+
p_user_id DECIMAL(10,0),
162+
p_phase_id decimal(3,0),
163+
old_rating decimal(10,0),
164+
new_rating decimal(10,0),
165+
old_vol decimal(10,0),
166+
new_vol decimal(10,0),
167+
old_num_ratings decimal(5,0),
168+
new_num_ratings decimal(5,0),
169+
old_last_rated_project_id decimal(12,0),
170+
new_last_rated_project_id decimal(12,0)
171+
)
172+
if (USER != 'ifxsyncuser') then
173+
if (old_rating != new_rating) then
174+
insert into user_rating_audit (column_name, old_value, new_value, user_id, phase_id)
175+
values ('RATING', old_rating, new_rating, p_user_id, p_phase_id);
176+
End If;
177+
178+
if (old_vol != new_vol) then
179+
insert into user_rating_audit (column_name, old_value, new_value, user_id, phase_id)
180+
values ('VOL', old_vol, new_vol, p_user_id, p_phase_id);
181+
End If;
182+
183+
if (old_num_ratings != new_num_ratings) then
184+
insert into user_rating_audit (column_name, old_value, new_value, user_id, phase_id)
185+
values ('NUM_RATINGS', old_num_ratings, new_num_ratings, p_user_id, p_phase_id);
186+
End If;
187+
188+
if (old_last_rated_project_id != new_last_rated_project_id) then
189+
insert into user_rating_audit (column_name, old_value, new_value, user_id, phase_id)
190+
values ('LAST_RATED_PROJECT_ID', old_last_rated_project_id, new_last_rated_project_id, p_user_id, p_phase_id);
191+
End If;
192+
193+
update user_rating set mod_date_time = current where user_id = p_user_id and phase_id = p_phase_id;
194+
End if;
195+
end procedure;
196+
197+
DROP PROCEDURE proc_contest_creation_update;
198+
CREATE PROCEDURE informix.proc_contest_creation_update (create_user VARCHAR(64), old_project_status_id INT, new_project_status_id INT)
199+
if (USER != 'ifxsyncuser') then
200+
if (old_project_status_id != new_project_status_id and new_project_status_id == 1) then
201+
insert into corona_event (corona_event_type_id,user_id) values (5, TO_NUMBER(create_user));
202+
end if;
203+
End if;
204+
end procedure;
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
database tcs_catalog;
2+
SET triggers informix.ifxpgsync_project_catalog_lu_insert disabled; SET triggers informix.ifxpgsync_project_catalog_lu_update disabled; SET triggers informix.ifxpgsync_project_catalog_lu_delete disabled;
3+
SET triggers informix.ifxpgsync_project_category_lu_insert disabled; SET triggers informix.ifxpgsync_project_category_lu_update disabled; SET triggers informix.ifxpgsync_project_category_lu_delete disabled;
4+
SET triggers informix.ifxpgsync_project_sub_category_lu_insert disabled; SET triggers informix.ifxpgsync_project_sub_category_lu_update disabled; SET triggers informix.ifxpgsync_project_sub_category_lu_delete disabled;
5+
SET triggers informix.ifxpgsync_project_type_lu_insert disabled; SET triggers informix.ifxpgsync_project_type_lu_update disabled; SET triggers informix.ifxpgsync_project_type_lu_delete disabled;
6+
7+
SET triggers informix.ifxpgsync_project_status_lu_insert disabled; SET triggers informix.ifxpgsync_project_status_lu_update disabled; SET triggers informix.ifxpgsync_project_status_lu_delete disabled;
8+
9+
SET triggers informix.ifxpgsync_project_studio_specification_insert disabled; SET triggers informix.ifxpgsync_project_studio_specification_update disabled; SET triggers informix.ifxpgsync_project_studio_specification_delete disabled;
10+
11+
SET triggers informix.ifxpgsync_project_mm_specification_insert disabled; SET triggers informix.ifxpgsync_project_mm_specification_update disabled; SET triggers informix.ifxpgsync_project_mm_specification_delete disabled;
12+
13+
SET triggers informix.ifxpgsync_project_spec_insert disabled; SET triggers informix.ifxpgsync_project_spec_update disabled; SET triggers informix.ifxpgsync_project_spec_delete disabled;
14+
SET triggers informix.ifxpgsync_copilot_contest_extra_info_insert disabled; SET triggers informix.ifxpgsync_copilot_contest_extra_info_update disabled; SET triggers informix.ifxpgsync_copilot_contest_extra_info_delete disabled;
15+
SET triggers informix.ifxpgsync_contest_sale_insert disabled; SET triggers informix.ifxpgsync_contest_sale_update disabled; SET triggers informix.ifxpgsync_contest_sale_delete disabled;
16+
SET triggers informix.ifxpgsync_contest_milestone_xref_insert disabled; SET triggers informix.ifxpgsync_contest_milestone_xref_update disabled; SET triggers informix.ifxpgsync_contest_milestone_xref_delete disabled;
17+
18+
SET triggers informix.ifxpgsync_project_copilot_type_insert disabled; SET triggers informix.ifxpgsync_project_copilot_type_update disabled; SET triggers informix.ifxpgsync_project_copilot_type_delete disabled;
19+
SET triggers informix.ifxpgsync_project_file_type_xref_insert disabled; SET triggers informix.ifxpgsync_project_file_type_xref_update disabled; SET triggers informix.ifxpgsync_project_file_type_xref_delete disabled;
20+
21+
SET triggers informix.ifxpgsync_project_info_insert disabled; SET triggers informix.ifxpgsync_project_info_update disabled; SET triggers informix.ifxpgsync_project_info_delete disabled;
22+
SET triggers informix.ifxpgsync_project_milestone_insert disabled; SET triggers informix.ifxpgsync_project_milestone_update disabled; SET triggers informix.ifxpgsync_project_milestone_delete disabled;
23+
SET triggers informix.ifxpgsync_project_milestone_owner_insert disabled; SET triggers informix.ifxpgsync_project_milestone_owner_update disabled; SET triggers informix.ifxpgsync_project_milestone_owner_delete disabled;
24+
25+
SET triggers informix.ifxpgsync_phase_criteria_insert disabled; SET triggers informix.ifxpgsync_phase_criteria_update disabled; SET triggers informix.ifxpgsync_phase_criteria_delete disabled;
26+
27+
SET triggers informix.ifxpgsync_phase_criteria_type_lu_insert disabled; SET triggers informix.ifxpgsync_phase_criteria_type_lu_update disabled; SET triggers informix.ifxpgsync_phase_criteria_type_lu_delete disabled;
28+
SET triggers informix.ifxpgsync_phase_dependency_insert disabled; SET triggers informix.ifxpgsync_phase_dependency_update disabled; SET triggers informix.ifxpgsync_phase_dependency_delete disabled;
29+
30+
SET triggers informix.ifxpgsync_prize_insert disabled; SET triggers informix.ifxpgsync_prize_update disabled; SET triggers informix.ifxpgsync_prize_delete disabled;
31+
SET triggers informix.ifxpgsync_project_platform_insert disabled; SET triggers informix.ifxpgsync_project_platform_update disabled; SET triggers informix.ifxpgsync_project_platform_delete disabled;
32+
33+
SET triggers informix.ifxpgsync_project_insert disabled; SET triggers informix.ifxpgsync_project_update disabled; SET triggers informix.ifxpgsync_project_delete disabled;
34+
SET triggers informix.ifxpgsync_project_phase_insert disabled; SET triggers informix.ifxpgsync_project_phase_update disabled; SET triggers informix.ifxpgsync_project_phase_delete disabled;
35+
SET triggers informix.ifxpgsync_project_user_audit_insert disabled; SET triggers informix.ifxpgsync_project_user_audit_update disabled; SET triggers informix.ifxpgsync_project_user_audit_delete disabled;
36+
37+
SET triggers informix.ifxpgsync_project_payment_adjustment_insert disabled; SET triggers informix.ifxpgsync_project_payment_adjustment_update disabled; SET triggers informix.ifxpgsync_project_payment_adjustment_delete disabled;
38+
SET triggers informix.ifxpgsync_project_reliability_insert disabled; SET triggers informix.ifxpgsync_project_reliability_update disabled; SET triggers informix.ifxpgsync_project_reliability_delete disabled;
39+
SET triggers informix.ifxpgsync_project_result_insert disabled; SET triggers informix.ifxpgsync_project_result_update disabled; SET triggers informix.ifxpgsync_project_result_delete disabled;
40+
41+
SET triggers informix.ifxpgsync_late_deliverable_insert disabled; SET triggers informix.ifxpgsync_late_deliverable_update disabled; SET triggers informix.ifxpgsync_late_deliverable_delete disabled;
42+
SET triggers informix.ifxpgsync_linked_project_xref_insert disabled; SET triggers informix.ifxpgsync_linked_project_xref_update disabled;
43+
SET triggers informix.ifxpgsync_linked_project_xref_delete disabled;
44+
45+
SET triggers informix.ifxpgsync_notification_insert disabled; SET triggers informix.ifxpgsync_notification_update disabled; SET triggers informix.ifxpgsync_notification_delete disabled;
46+
SET triggers informix.ifxpgsync_review_insert disabled; SET triggers informix.ifxpgsync_review_update disabled; SET triggers informix.ifxpgsync_review_delete disabled;
47+
SET triggers informix.ifxpgsync_reviewer_rating_insert disabled; SET triggers informix.ifxpgsync_reviewer_rating_update disabled; SET triggers informix.ifxpgsync_reviewer_rating_delete disabled;
48+
49+
50+
SET triggers informix.ifxpgsync_review_feedback_insert disabled; SET triggers informix.ifxpgsync_review_feedback_update disabled; SET triggers informix.ifxpgsync_review_feedback_delete disabled;
51+
52+
SET triggers informix.ifxpgsync_review_auction_insert disabled; SET triggers informix.ifxpgsync_review_auction_update disabled; SET triggers informix.ifxpgsync_review_auction_delete disabled;
53+
54+
SET triggers informix.ifxpgsync_resource_insert disabled; SET triggers informix.ifxpgsync_resource_update disabled; SET triggers informix.ifxpgsync_resource_delete disabled;
55+
SET triggers informix.ifxpgsync_software_competition_pipeline_info_insert disabled; SET triggers informix.ifxpgsync_software_competition_pipeline_info_update disabled; SET triggers informix.ifxpgsync_software_competition_pipeline_info_delete disabled;
56+
SET triggers informix.ifxpgsync_team_header_insert disabled; SET triggers informix.ifxpgsync_team_header_update disabled; SET triggers informix.ifxpgsync_team_header_delete disabled;
57+
SET triggers informix.ifxpgsync_upload_insert disabled; SET triggers informix.ifxpgsync_upload_update disabled; SET triggers informix.ifxpgsync_upload_delete disabled;

0 commit comments

Comments
 (0)