Skip to content

Dev - dev-test-pg #10

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 15 commits into from
May 11, 2020
18 changes: 9 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ build_steps: &build_steps
command: |
./awsconfiguration.sh ${DEPLOY_ENV}
source awsenvconf
./buildenv.sh -e ${DEPLOY_ENV} -b ${LOGICAL_ENV}-${APP_NAME}-consumer-deployvar
source buildenvvar
./master_deploy.sh -d ECS -e ${DEPLOY_ENV} -t latest -s ${GLOBAL_ENV}-global-appvar,${LOGICAL_ENV}-${APP_NAME}-appvar -i postgres-ifx-processer

# ./buildenv.sh -e ${DEPLOY_ENV} -b ${LOGICAL_ENV}-${APP_NAME}-consumer-deployvar
#source buildenvvar
#./master_deploy.sh -d ECS -e ${DEPLOY_ENV} -t latest -s ${GLOBAL_ENV}-global-appvar,${LOGICAL_ENV}-${APP_NAME}-appvar -i postgres-ifx-processer

echo "Running Masterscript - deploy postgres-ifx-processer producer"
if [ -e ${LOGICAL_ENV}-${APP_NAME}-consumer-deployvar.json ]; then sudo rm -vf ${LOGICAL_ENV}-${APP_NAME}-consumer-deployvar.json; fi
Expand All @@ -58,11 +58,11 @@ build_steps: &build_steps
source buildenvvar
./master_deploy.sh -d ECS -e ${DEPLOY_ENV} -t latest -s ${GLOBAL_ENV}-global-appvar,${LOGICAL_ENV}-${APP_NAME}-appvar -i postgres-ifx-processer

echo "Running Masterscript - deploy postgres-ifx-processer reconsiler1"
if [ -e ${LOGICAL_ENV}-${APP_NAME}-reconsiler1-deployvar.json ]; then sudo rm -vf ${LOGICAL_ENV}-${APP_NAME}-reconsiler1-deployvar.json; fi
./buildenv.sh -e ${DEPLOY_ENV} -b ${LOGICAL_ENV}-${APP_NAME}-reconsiler1-deployvar
source buildenvvar
./master_deploy.sh -d ECS -e ${DEPLOY_ENV} -t latest -s ${GLOBAL_ENV}-global-appvar,${LOGICAL_ENV}-${APP_NAME}-appvar -i postgres-ifx-processer
#echo "Running Masterscript - deploy postgres-ifx-processer reconsiler1"
#if [ -e ${LOGICAL_ENV}-${APP_NAME}-reconsiler1-deployvar.json ]; then sudo rm -vf ${LOGICAL_ENV}-${APP_NAME}-reconsiler1-deployvar.json; fi
#./buildenv.sh -e ${DEPLOY_ENV} -b ${LOGICAL_ENV}-${APP_NAME}-reconsiler1-deployvar
#source buildenvvar
#./master_deploy.sh -d ECS -e ${DEPLOY_ENV} -t latest -s ${GLOBAL_ENV}-global-appvar,${LOGICAL_ENV}-${APP_NAME}-appvar -i postgres-ifx-processer

jobs:
# Build & Deploy against development backend #
Expand Down
4 changes: 2 additions & 2 deletions config/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ module.exports = {
},
DYNAMODB:
{
DYNAMODB_TABLE: process.env.DYNAMODB_TABLE || 'dev_pg_ifx_payload_sync'
DD_ElapsedTime: process.env.DD_ElapsedTime || 600000
DYNAMODB_TABLE: process.env.DYNAMODB_TABLE || 'dev_pg_ifx_payload_sync',
DD_ElapsedTime: process.env.DD_ElapsedTime || 600000
},

AUTH0_URL: process.env.AUTH0_URL ,
Expand Down
204 changes: 204 additions & 0 deletions informix-identity-trigger-proc.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
database common_oltp
DROP PROCEDURE proc_user_update(varchar,decimal);
DROP PROCEDURE proc_user_update;
CREATE PROCEDURE informix.proc_user_update(
new_handle varchar(50),
user_id decimal(10,0))
if (USER != 'ifxsyncuser') then
UPDATE user SET handle_lower = lower(new_handle), modify_date = current WHERE user.user_id = user_id;
End if;
end procedure;
create procedure "informix".proc_user_update(
user_id DECIMAL(10,0),
old_first_name VARCHAR(64),
new_first_name VARCHAR(64),
old_last_name VARCHAR(64),
new_last_name VARCHAR(64),
old_handle VARCHAR(50),
new_handle VARCHAR(50),
old_status VARCHAR(3),
new_status VARCHAR(3),
old_activation_code VARCHAR(32),
new_activation_code VARCHAR(32),
old_middle_name VARCHAR(64),
new_middle_name VARCHAR(64),
old_timezone_id decimal(5,0),
new_timezone_id decimal(5,0)
)

if ((old_first_name != new_first_name) or (old_last_name != new_last_name ) or (old_middle_name != new_middle_name )) then
insert into audit_user (column_name, old_value, new_value,
user_id)
values ('NAME', NVL(old_first_name, '') || ' ' || NVL(old_middle_name, '') || ' ' || NVL(old_last_name, ''),
NVL(new_first_name, '') || ' ' || NVL(new_middle_name,
'') || ' ' || NVL(new_last_name, ''), user_id);
End if;

if (old_handle != new_handle) then
insert into audit_user (column_name, old_value, new_value,
user_id)
values ('HANDLE', old_handle, new_handle, user_id);
End If;

if (old_status != new_status) then
insert into audit_user (column_name, old_value, new_value,
user_id)
values ('STATUS', old_status, new_status, user_id);
End If;

if (old_activation_code != new_activation_code) then
insert into audit_user (column_name, old_value, new_value,
user_id)
values ('ACTIVATION_CODE', old_activation_code, new_activation_code, user_id);
End If;

if (old_timezone_id != new_timezone_id) then
insert into audit_user (column_name, old_value, new_value,
user_id)
values ('TIMEZONE_ID', old_timezone_id, new_timezone_id, user_id);
End If;
if (USER != 'ifxsyncuser') then
UPDATE user SET handle_lower = lower(new_handle), modify_date = current WHERE user.user_id = user_id;
End if;
end procedure;

DROP PROCEDURE informix.proc_email_update;
CREATE PROCEDURE informix.proc_email_update(
email_id decimal(10,0),
user_id DECIMAL(10,0),
old_email_type_id DECIMAL(5,0),
new_email_type_id DECIMAL(5,0),
old_address VARCHAR(100),
new_address VARCHAR(100),
old_primary_ind DECIMAL(1,0),
new_primary_ind DECIMAL(1,0),
old_status_id DECIMAL(3,0),
new_status_id DECIMAL(3,0)
)

if (old_email_type_id != new_email_type_id) then
insert into audit_user (column_name, old_value, new_value, user_id)
values ('EMAIL_TYPE', old_email_type_id, new_email_type_id, user_id);
End If;

if (old_status_id != new_status_id) then
insert into audit_user (column_name, old_value, new_value, user_id)
values ('EMAIL_STATUS', old_status_id, new_status_id, user_id);
End If;

if (old_address != new_address) then
insert into audit_user (column_name, old_value, new_value, user_id)
values ('EMAIL_ADDRESS', old_address, new_address, user_id);
End If;

if (old_primary_ind != new_primary_ind) then
insert into audit_user (column_name, old_value, new_value, user_id)
values ('EMAIL_PRIMARY_IND', old_primary_ind, new_primary_ind, user_id);
End If;
if (USER != 'ifxsyncuser') then
update email set modify_date = current where email.email_id = email_id;
End if;
end procedure;


database informixoltp
DROP PROCEDURE informix.proc_coder_update;
CREATE PROCEDURE informix.proc_coder_update(
v_oldcoder_id decimal(10,0),
v_oldquote varchar(255),v_newquote varchar (255),
v_oldlanguage_id decimal(3,0), v_newlanguage_id decimal(3,0),
v_oldcoder_type_id decimal(3,0), v_newcoder_type_id decimal(3,0),
v_oldcomp_country_code varchar(3), v_newcomp_country_code varchar(3)
)

if (v_oldquote != v_newquote) then
insert into audit_coder (column_name, old_value, new_value, user_id)
values ('QUOTE', v_oldquote , v_newquote, v_oldcoder_id);
End if;

if (v_oldcoder_type_id != v_newcoder_type_id) then
insert into audit_coder (column_name, old_value, new_value, user_id)
values ('CODER_TYPE', v_oldcoder_type_id , v_newcoder_type_id, v_oldcoder_id);
End if;

if (v_oldlanguage_id != v_newlanguage_id) then
insert into audit_coder (column_name, old_value, new_value, user_id)
values ('LANGUAGE', v_oldlanguage_id , v_newlanguage_id, v_oldcoder_id);
End if;

if (v_oldcomp_country_code != v_newcomp_country_code) then
insert into audit_coder (column_name, old_value, new_value, user_id)
values ('COMP_COUNTRY', v_oldcomp_country_code , v_newcomp_country_code, v_oldcoder_id);
End if;

if (USER != 'ifxsyncuser') then
update coder set modify_date = current where coder_id = v_oldcoder_id;
End if;

end procedure;

database tcs_catalog;
DROP PROCEDURE proc_reliability_update;
CREATE PROCEDURE informix.proc_reliability_update(
p_user_id DECIMAL(10,0),
p_phase_id decimal(3,0),
old_rating decimal(5,4),
new_rating decimal(5,4)
)

if (USER != 'ifxsyncuser') then
if (old_rating != new_rating) then
insert into user_reliability_audit (column_name, old_value, new_value, user_id, phase_id)
values ('RATING', old_rating, new_rating, p_user_id, p_phase_id);
End If;

update user_reliability set modify_date = current where user_id = p_user_id and phase_id = p_phase_id;
End if;
end procedure;

DROP PROCEDURE proc_rating_update;
CREATE PROCEDURE informix.proc_rating_update(
p_user_id DECIMAL(10,0),
p_phase_id decimal(3,0),
old_rating decimal(10,0),
new_rating decimal(10,0),
old_vol decimal(10,0),
new_vol decimal(10,0),
old_num_ratings decimal(5,0),
new_num_ratings decimal(5,0),
old_last_rated_project_id decimal(12,0),
new_last_rated_project_id decimal(12,0)
)
if (USER != 'ifxsyncuser') then
if (old_rating != new_rating) then
insert into user_rating_audit (column_name, old_value, new_value, user_id, phase_id)
values ('RATING', old_rating, new_rating, p_user_id, p_phase_id);
End If;

if (old_vol != new_vol) then
insert into user_rating_audit (column_name, old_value, new_value, user_id, phase_id)
values ('VOL', old_vol, new_vol, p_user_id, p_phase_id);
End If;

if (old_num_ratings != new_num_ratings) then
insert into user_rating_audit (column_name, old_value, new_value, user_id, phase_id)
values ('NUM_RATINGS', old_num_ratings, new_num_ratings, p_user_id, p_phase_id);
End If;

if (old_last_rated_project_id != new_last_rated_project_id) then
insert into user_rating_audit (column_name, old_value, new_value, user_id, phase_id)
values ('LAST_RATED_PROJECT_ID', old_last_rated_project_id, new_last_rated_project_id, p_user_id, p_phase_id);
End If;

update user_rating set mod_date_time = current where user_id = p_user_id and phase_id = p_phase_id;
End if;
end procedure;

DROP PROCEDURE proc_contest_creation_update;
CREATE PROCEDURE informix.proc_contest_creation_update (create_user VARCHAR(64), old_project_status_id INT, new_project_status_id INT)
if (USER != 'ifxsyncuser') then
if (old_project_status_id != new_project_status_id and new_project_status_id == 1) then
insert into corona_event (corona_event_type_id,user_id) values (5, TO_NUMBER(create_user));
end if;
End if;
end procedure;
57 changes: 57 additions & 0 deletions informix_triggers/tcs_catalog/01_project_tables_disables.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
database tcs_catalog;
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;
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;
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;
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;

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;

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;

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;

SET triggers informix.ifxpgsync_project_spec_insert disabled; SET triggers informix.ifxpgsync_project_spec_update disabled; SET triggers informix.ifxpgsync_project_spec_delete disabled;
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;
SET triggers informix.ifxpgsync_contest_sale_insert disabled; SET triggers informix.ifxpgsync_contest_sale_update disabled; SET triggers informix.ifxpgsync_contest_sale_delete disabled;
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;

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;
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;

SET triggers informix.ifxpgsync_project_info_insert disabled; SET triggers informix.ifxpgsync_project_info_update disabled; SET triggers informix.ifxpgsync_project_info_delete disabled;
SET triggers informix.ifxpgsync_project_milestone_insert disabled; SET triggers informix.ifxpgsync_project_milestone_update disabled; SET triggers informix.ifxpgsync_project_milestone_delete disabled;
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;

SET triggers informix.ifxpgsync_phase_criteria_insert disabled; SET triggers informix.ifxpgsync_phase_criteria_update disabled; SET triggers informix.ifxpgsync_phase_criteria_delete disabled;

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;
SET triggers informix.ifxpgsync_phase_dependency_insert disabled; SET triggers informix.ifxpgsync_phase_dependency_update disabled; SET triggers informix.ifxpgsync_phase_dependency_delete disabled;

SET triggers informix.ifxpgsync_prize_insert disabled; SET triggers informix.ifxpgsync_prize_update disabled; SET triggers informix.ifxpgsync_prize_delete disabled;
SET triggers informix.ifxpgsync_project_platform_insert disabled; SET triggers informix.ifxpgsync_project_platform_update disabled; SET triggers informix.ifxpgsync_project_platform_delete disabled;

SET triggers informix.ifxpgsync_project_insert disabled; SET triggers informix.ifxpgsync_project_update disabled; SET triggers informix.ifxpgsync_project_delete disabled;
SET triggers informix.ifxpgsync_project_phase_insert disabled; SET triggers informix.ifxpgsync_project_phase_update disabled; SET triggers informix.ifxpgsync_project_phase_delete disabled;
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;

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;
SET triggers informix.ifxpgsync_project_reliability_insert disabled; SET triggers informix.ifxpgsync_project_reliability_update disabled; SET triggers informix.ifxpgsync_project_reliability_delete disabled;
SET triggers informix.ifxpgsync_project_result_insert disabled; SET triggers informix.ifxpgsync_project_result_update disabled; SET triggers informix.ifxpgsync_project_result_delete disabled;

SET triggers informix.ifxpgsync_late_deliverable_insert disabled; SET triggers informix.ifxpgsync_late_deliverable_update disabled; SET triggers informix.ifxpgsync_late_deliverable_delete disabled;
SET triggers informix.ifxpgsync_linked_project_xref_insert disabled; SET triggers informix.ifxpgsync_linked_project_xref_update disabled;
SET triggers informix.ifxpgsync_linked_project_xref_delete disabled;

SET triggers informix.ifxpgsync_notification_insert disabled; SET triggers informix.ifxpgsync_notification_update disabled; SET triggers informix.ifxpgsync_notification_delete disabled;
SET triggers informix.ifxpgsync_review_insert disabled; SET triggers informix.ifxpgsync_review_update disabled; SET triggers informix.ifxpgsync_review_delete disabled;
SET triggers informix.ifxpgsync_reviewer_rating_insert disabled; SET triggers informix.ifxpgsync_reviewer_rating_update disabled; SET triggers informix.ifxpgsync_reviewer_rating_delete disabled;


SET triggers informix.ifxpgsync_review_feedback_insert disabled; SET triggers informix.ifxpgsync_review_feedback_update disabled; SET triggers informix.ifxpgsync_review_feedback_delete disabled;

SET triggers informix.ifxpgsync_review_auction_insert disabled; SET triggers informix.ifxpgsync_review_auction_update disabled; SET triggers informix.ifxpgsync_review_auction_delete disabled;

SET triggers informix.ifxpgsync_resource_insert disabled; SET triggers informix.ifxpgsync_resource_update disabled; SET triggers informix.ifxpgsync_resource_delete disabled;
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;
SET triggers informix.ifxpgsync_team_header_insert disabled; SET triggers informix.ifxpgsync_team_header_update disabled; SET triggers informix.ifxpgsync_team_header_delete disabled;
SET triggers informix.ifxpgsync_upload_insert disabled; SET triggers informix.ifxpgsync_upload_update disabled; SET triggers informix.ifxpgsync_upload_delete disabled;
Loading