[AB-132] fixing experience job not creating user experience records in the database

fixing setup command not being considered templated
changing column name for counters
fixing liquibase configuration for creating postgres functions
fixing duration format expcetion model not available in the template
enabling builds for hotfix/bugfix branches
This commit is contained in:
Sheldan
2020-09-27 00:36:07 +02:00
parent 5081c3174f
commit 0f9a0dc143
19 changed files with 376 additions and 268 deletions

View File

@@ -58,11 +58,12 @@ public class Setup extends AbstractConditionableCommand {
public CommandConfiguration getConfiguration() {
Parameter newPrefixParameter = Parameter.builder().name("feature").type(String.class).build();
List<Parameter> parameters = Arrays.asList(newPrefixParameter);
HelpInfo helpInfo = HelpInfo.builder().build();
HelpInfo helpInfo = HelpInfo.builder().templated(true).build();
return CommandConfiguration.builder()
.name("setup")
.module(ConfigModuleInterface.CONFIG)
.parameters(parameters)
.templated(true)
.async(true)
.supportsEmbedException(true)
.help(helpInfo)

View File

@@ -6,9 +6,9 @@
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog ../../dbchangelog-3.8.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext ../../dbchangelog-3.8.xsd
http://www.liquibase.org/xml/ns/pro ../../dbchangelog-3.8.xsd" >
<changeSet author="me" id="counter_function" dbms="postgres">
<changeSet author="Sheldan" id="counter_function" dbms="postgresql">
<sqlFile encoding="utf8" path="sql/counter_function.sql"
relativeToChangelogFile="true"
stripComments="false"/>
splitStatements="false"/>
</changeSet>
</databaseChangeLog>

View File

@@ -6,23 +6,23 @@ BEGIN
SELECT count(1)
FROM COUNTER
INTO v_exists
WHERE server_reference = p_server_id
WHERE server_id = p_server_id
AND counter_key = p_counter_key;
IF v_exists >= 1 THEN
SELECT MAX(counter) + 1
INTO v_next_count
FROM counter
WHERE server_reference = p_server_id
WHERE server_id = p_server_id
AND counter_key = p_counter_key;
UPDATE counter
SET counter = v_next_count
WHERE server_reference = p_server_id
WHERE server_id = p_server_id
AND counter_key = p_counter_key;
ELSE
v_next_count := 1;
INSERT INTO counter (counter_key, server_reference, counter)
INSERT INTO counter (counter_key, server_id, counter)
VALUES (p_counter_key, p_server_id, v_next_count);
END IF;
RETURN v_next_count;