@@ -28,5 +28,67 @@ ALTER TABLE externalmessage
2828ALTER TABLE externalmessage
2929 ADD COLUMN IF NOT EXISTS additionalDataJson JSONB;
3030
31+
32+ -- system configuration for surveys
33+
34+ DO
35+ $$ DECLARE
36+ general_category_id bigint ;
37+
38+ BEGIN
39+ -- Get GENERAL category id
40+ -- General category should always exist
41+ SELECT id
42+ INTO general_category_id
43+ FROM systemconfigurationcategory
44+ WHERE name = ' GENERAL_CATEGORY' ;
45+
46+ INSERT INTO systemconfigurationvalue(config_key, config_value, value_description, category_id, value_optional, value_pattern,
47+ value_encrypt, data_provider, validation_message, changedate, creationdate, id,
48+ uuid)
49+ VALUES (' NG_SUVEY_BASE_URI' , null , ' i18n/infoSystemConfigurationValueDescriptionNgSurveyBaseURI' , general_category_id, true,
50+ ' ' , false, null ,
51+ ' i18n/systemConfigurationValueInvalidValue' , now(), now(), nextval(' entity_seq' ), generate_base32_uuid());
52+
53+
54+ INSERT INTO systemconfigurationvalue(config_key, config_value, value_description, category_id, value_optional, value_pattern,
55+ value_encrypt, data_provider, validation_message, changedate, creationdate, id,
56+ uuid)
57+ VALUES (' NG_SUVEY_CRYPTED_TOKEN' , null , ' i18n/infoSystemConfigurationValueDescriptionNgSurveyCryptedToken' , general_category_id, true,
58+ ' ' , true, null ,
59+ ' i18n/systemConfigurationValueInvalidValue' , now(), now(), nextval(' entity_seq' ), generate_base32_uuid());
60+
61+ INSERT INTO systemconfigurationvalue(config_key, config_value, value_description, category_id, value_optional, value_pattern,
62+ value_encrypt, data_provider, validation_message, changedate, creationdate, id,
63+ uuid)
64+ VALUES (' NG_SUVEY_FIELD_PREFIX' , ' _so' , ' i18n/infoSystemConfigurationValueDescriptionNgSurveyFieldPrefix' , general_category_id, true,
65+ ' ' , true, null ,
66+ ' i18n/systemConfigurationValueInvalidValue' , now(), now(), nextval(' entity_seq' ), generate_base32_uuid());
67+
68+ INSERT INTO systemconfigurationvalue(config_key, config_value, value_description, category_id, value_optional, value_pattern,
69+ value_encrypt, data_provider, validation_message, changedate, creationdate, id,
70+ uuid)
71+ VALUES (' SURVEY_AS_EXTERNAL_MESSAGE_ADAPTER_JNDI_KEY' , ' java:global/sormas-esante-adapter/SurveyExternalMessageAdapterFacadeEjb' , ' i18n/infoSystemConfigurationValueDescriptionSurveyJDNI' , general_category_id, true,
72+ ' ' , true, null ,
73+ ' i18n/systemConfigurationValueInvalidValue' , now(), now(), nextval(' entity_seq' ), generate_base32_uuid());
74+
75+
76+
77+ INSERT INTO systemconfigurationvalue(config_key, config_value, value_description, category_id, value_optional, value_pattern,
78+ value_encrypt, data_provider, validation_message, changedate, creationdate, id,
79+ uuid)
80+ VALUES (' SURVEY_PERIOD_INTERVAL_DAYS' , ' 4' , ' i18n/infoSystemConfigurationValueDescriptionSurveyPeriodIntervalDays' , general_category_id, true,
81+ ' ' , true, null ,
82+ ' i18n/systemConfigurationValueInvalidValue' , now(), now(), nextval(' entity_seq' ), generate_base32_uuid());
83+
84+
85+
86+ END $$
87+ LANGUAGE plpgsql;
88+
89+ -- index to avoid full table scan when checking for survey duplicates
90+ CREATE INDEX idx_externalmessage_report_id
91+ ON externalmessage (reportid);
92+
3193INSERT INTO schema_version (version_number, comment)
3294VALUES (609 , ' #13832 - External Survey facade' );
0 commit comments