added liquibase for setup of databases and initial values

fixed some table names to be singular
migrated templates to separate repository
added seed data to initial version in liquibase migrations instead of property files (post targets, emotes etc) and created some default tables containing those default values
added separate artifacts to be used containing only the liquibase config
added shell script as a wrapper for ansible deployment, to handle an environment variable defining whether or not the deployment should be executed
added logback scan period
added licenses for ansible, liquibase, docker and docker-compose
This commit is contained in:
Sheldan
2020-07-01 20:44:21 +02:00
parent e8767429bf
commit 9374dfb912
965 changed files with 15775 additions and 2935 deletions

View File

@@ -12,6 +12,28 @@
<artifactId>scheduling-impl</artifactId>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
<descriptor>src/main/assembly/liquibase.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>dev.sheldan.abstracto.scheduling</groupId>

View File

@@ -0,0 +1,18 @@
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.1.0 http://maven.apache.org/xsd/assembly-2.1.0.xsd">
<id>liquibase</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<outputDirectory>.</outputDirectory>
<directory>${project.basedir}/src/main/resources/migrations</directory>
<includes>
<include>**/*</include>
</includes>
</fileSet>
</fileSets>
</assembly>

View File

@@ -1,20 +0,0 @@
package dev.sheldan.abstracto.scheduling.config;
import dev.sheldan.abstracto.scheduling.model.SchedulerJobProperties;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import java.util.HashMap;
/**
* Makes the job configuration in each of the property files accessible and usable. This causes the jobs to be automatically loaded and scheduled if they appear in a property file
*/
@Component
@Getter
@Setter
@ConfigurationProperties(prefix = "abstracto.scheduling")
public class JobConfigLoader {
private HashMap<String, SchedulerJobProperties> jobs = new HashMap<>();
}

View File

@@ -1,26 +0,0 @@
package dev.sheldan.abstracto.scheduling.factory;
import dev.sheldan.abstracto.scheduling.model.SchedulerJobProperties;
import dev.sheldan.abstracto.scheduling.model.database.SchedulerJob;
import org.springframework.stereotype.Component;
@Component
public class SchedulerJobConverter {
/**
* Converts a {@link SchedulerJobProperties} instance to a usable {@link SchedulerJob} instance
* @param properties The instance directly coming from a property file
* @return A instance eof {@link SchedulerJob} which represents an instance from the database
*/
public SchedulerJob fromJobProperties(SchedulerJobProperties properties) {
return SchedulerJob
.builder()
.name(properties.getName())
.groupName(properties.getGroup())
.active(properties.getActive())
.cronExpression(properties.getCronExpression())
.clazz(properties.getClazz())
.recovery(properties.getRecovery())
.build();
}
}

View File

@@ -1,39 +0,0 @@
package dev.sheldan.abstracto.scheduling.model;
import lombok.*;
/**
* The properties which are available to be configured via a property file
*/
@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SchedulerJobProperties {
/**
* The name of the job. Necessary to identify the job.
*/
private String name;
/**
* The group in which the job should reside. Necessary to identify the job.
*/
private String group;
/**
* If the job executes on a cron schedule, this should contain the cron expression for this. If it is a one-time job, this needs to be null.
*/
private String cronExpression;
/**
* The absolute class name of the job bean extending {@link org.springframework.scheduling.quartz.QuartzJobBean} which should be executed
*/
private String clazz;
/**
* Whether or not the job is active, and should be scheduled.
*/
private Boolean active;
/**
* Whether or not the job should be re-tried in an recovery of fail over situation.
*/
private Boolean recovery;
}

View File

@@ -1,8 +1,5 @@
package dev.sheldan.abstracto.scheduling.service;
import dev.sheldan.abstracto.scheduling.config.JobConfigLoader;
import dev.sheldan.abstracto.scheduling.factory.SchedulerJobConverter;
import dev.sheldan.abstracto.scheduling.model.database.SchedulerJob;
import dev.sheldan.abstracto.scheduling.service.management.SchedulerJobManagementServiceBean;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@@ -19,25 +16,18 @@ public class SchedulerStartupService {
@Autowired
private SchedulerService schedulerService;
@Autowired
private JobConfigLoader jobConfigLoader;
@Autowired
private SchedulerJobManagementServiceBean schedulerJobManagementServiceBean;
@Autowired
private SchedulerJobConverter schedulerJobConverter;
/**
* Loads the job definitions from the property file and schedules them, if the job does not exist yet.
* Loads the job definitions from the database and schedules them, if the job does not exist yet.
*/
@EventListener
@Transactional
public void handleContextRefreshEvent(ContextRefreshedEvent ctxStartEvt) {
jobConfigLoader.getJobs().forEach((s, schedulerJob) -> {
SchedulerJob job = schedulerJobConverter.fromJobProperties(schedulerJob);
if(!schedulerJobManagementServiceBean.doesJobExist(job) || !schedulerJobManagementServiceBean.isJobDefinitionTheSame(job)) {
schedulerJobManagementServiceBean.createOrUpdate(job);
schedulerJobManagementServiceBean.findAll().forEach((schedulerJob) -> {
if(!schedulerJobManagementServiceBean.doesJobExist(schedulerJob) || !schedulerJobManagementServiceBean.isJobDefinitionTheSame(schedulerJob)) {
schedulerJobManagementServiceBean.createOrUpdate(schedulerJob);
}
});
schedulerService.startScheduledJobs();

View File

@@ -0,0 +1,10 @@
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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" >
<include file="scheduling-tables/tables.xml" relativeToChangelogFile="true"/>
</databaseChangeLog>

View File

@@ -0,0 +1,27 @@
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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="Sheldan" id="qrtz_blob_triggers-table">
<createTable tableName="qrtz_blob_triggers">
<column name="sched_name" type="VARCHAR(120)">
<constraints nullable="false" primaryKey="true" primaryKeyName="qrtz_blob_triggers_pkey"/>
</column>
<column name="trigger_name" type="VARCHAR(200)">
<constraints nullable="false" primaryKey="true" primaryKeyName="qrtz_blob_triggers_pkey"/>
</column>
<column name="trigger_group" type="VARCHAR(200)">
<constraints nullable="false" primaryKey="true" primaryKeyName="qrtz_blob_triggers_pkey"/>
</column>
<column name="blob_data" type="BYTEA"/>
</createTable>
</changeSet>
<changeSet author="Sheldan" id="qrtz_blob_triggers-qrtz_blob_triggers_sched_name_trigger_name_trigger_group_fkey">
<addForeignKeyConstraint baseColumnNames="sched_name,trigger_name,trigger_group" baseTableName="qrtz_blob_triggers" constraintName="qrtz_blob_triggers_sched_name_trigger_name_trigger_group_fkey" deferrable="false" initiallyDeferred="false" onDelete="NO ACTION" onUpdate="NO ACTION" referencedColumnNames="sched_name,trigger_name,trigger_group" referencedTableName="qrtz_triggers" validate="true"/>
</changeSet>
</databaseChangeLog>

View File

@@ -0,0 +1,22 @@
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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="Sheldan" id="qrtz_calendars-table">
<createTable tableName="qrtz_calendars">
<column name="sched_name" type="VARCHAR(120)">
<constraints nullable="false" primaryKey="true" primaryKeyName="qrtz_calendars_pkey"/>
</column>
<column name="calendar_name" type="VARCHAR(200)">
<constraints nullable="false" primaryKey="true" primaryKeyName="qrtz_calendars_pkey"/>
</column>
<column name="calendar" type="BYTEA">
<constraints nullable="false"/>
</column>
</createTable>
</changeSet>
</databaseChangeLog>

View File

@@ -0,0 +1,29 @@
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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="Sheldan" id="qrtz_cron_triggers-table">
<createTable tableName="qrtz_cron_triggers">
<column name="sched_name" type="VARCHAR(120)">
<constraints nullable="false" primaryKey="true" primaryKeyName="qrtz_cron_triggers_pkey"/>
</column>
<column name="trigger_name" type="VARCHAR(200)">
<constraints nullable="false" primaryKey="true" primaryKeyName="qrtz_cron_triggers_pkey"/>
</column>
<column name="trigger_group" type="VARCHAR(200)">
<constraints nullable="false" primaryKey="true" primaryKeyName="qrtz_cron_triggers_pkey"/>
</column>
<column name="cron_expression" type="VARCHAR(120)">
<constraints nullable="false"/>
</column>
<column name="time_zone_id" type="VARCHAR(80)"/>
</createTable>
</changeSet>
<changeSet author="Sheldan" id="qrtz_cron_triggers-qrtz_cron_triggers_sched_name_trigger_name_trigger_group_fkey">
<addForeignKeyConstraint baseColumnNames="sched_name,trigger_name,trigger_group" baseTableName="qrtz_cron_triggers" constraintName="qrtz_cron_triggers_sched_name_trigger_name_trigger_group_fkey" deferrable="false" initiallyDeferred="false" onDelete="NO ACTION" onUpdate="NO ACTION" referencedColumnNames="sched_name,trigger_name,trigger_group" referencedTableName="qrtz_triggers" validate="true"/>
</changeSet>
</databaseChangeLog>

View File

@@ -0,0 +1,85 @@
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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="Sheldan" id="qrtz_fired_triggers-table">
<createTable tableName="qrtz_fired_triggers">
<column name="sched_name" type="VARCHAR(120)">
<constraints nullable="false" primaryKey="true" primaryKeyName="qrtz_fired_triggers_pkey"/>
</column>
<column name="entry_id" type="VARCHAR(95)">
<constraints nullable="false" primaryKey="true" primaryKeyName="qrtz_fired_triggers_pkey"/>
</column>
<column name="trigger_name" type="VARCHAR(200)">
<constraints nullable="false"/>
</column>
<column name="trigger_group" type="VARCHAR(200)">
<constraints nullable="false"/>
</column>
<column name="instance_name" type="VARCHAR(200)">
<constraints nullable="false"/>
</column>
<column name="fired_time" type="BIGINT">
<constraints nullable="false"/>
</column>
<column name="sched_time" type="BIGINT">
<constraints nullable="false"/>
</column>
<column name="priority" type="INTEGER">
<constraints nullable="false"/>
</column>
<column name="state" type="VARCHAR(16)">
<constraints nullable="false"/>
</column>
<column name="job_name" type="VARCHAR(200)"/>
<column name="job_group" type="VARCHAR(200)"/>
<column name="is_nonconcurrent" type="BOOLEAN"/>
<column name="requests_recovery" type="BOOLEAN"/>
</createTable>
</changeSet>
<changeSet author="Sheldan" id="qrtz_fired_triggers-index1">
<createIndex indexName="idx_qrtz_ft_inst_job_req_rcvry" tableName="qrtz_fired_triggers">
<column name="sched_name"/>
<column name="instance_name"/>
<column name="requests_recovery"/>
</createIndex>
</changeSet>
<changeSet author="Sheldan" id="qrtz_fired_triggers-index2">
<createIndex indexName="idx_qrtz_ft_j_g" tableName="qrtz_fired_triggers">
<column name="sched_name"/>
<column name="job_name"/>
<column name="job_group"/>
</createIndex>
</changeSet>
<changeSet author="Sheldan" id="qrtz_fired_triggers-index3">
<createIndex indexName="idx_qrtz_ft_jg" tableName="qrtz_fired_triggers">
<column name="sched_name"/>
<column name="job_group"/>
</createIndex>
</changeSet>
<changeSet author="Sheldan" id="qrtz_fired_triggers-index4">
<createIndex indexName="idx_qrtz_ft_t_g" tableName="qrtz_fired_triggers">
<column name="sched_name"/>
<column name="trigger_name"/>
<column name="trigger_group"/>
</createIndex>
</changeSet>
<changeSet author="Sheldan" id="qrtz_fired_triggers-index5">
<createIndex indexName="idx_qrtz_ft_tg" tableName="qrtz_fired_triggers">
<column name="sched_name"/>
<column name="trigger_group"/>
</createIndex>
</changeSet>
<changeSet author="Sheldan" id="qrtz_fired_triggers-index6">
<createIndex indexName="idx_qrtz_ft_trig_inst_name" tableName="qrtz_fired_triggers">
<column name="sched_name"/>
<column name="instance_name"/>
</createIndex>
</changeSet>
</databaseChangeLog>

View File

@@ -0,0 +1,52 @@
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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="Sheldan" id="qrtz_job_details-table">
<createTable tableName="qrtz_job_details">
<column name="sched_name" type="VARCHAR(120)">
<constraints nullable="false" primaryKey="true" primaryKeyName="qrtz_job_details_pkey"/>
</column>
<column name="job_name" type="VARCHAR(200)">
<constraints nullable="false" primaryKey="true" primaryKeyName="qrtz_job_details_pkey"/>
</column>
<column name="job_group" type="VARCHAR(200)">
<constraints nullable="false" primaryKey="true" primaryKeyName="qrtz_job_details_pkey"/>
</column>
<column name="description" type="VARCHAR(250)"/>
<column name="job_class_name" type="VARCHAR(250)">
<constraints nullable="false"/>
</column>
<column name="is_durable" type="BOOLEAN">
<constraints nullable="false"/>
</column>
<column name="is_nonconcurrent" type="BOOLEAN">
<constraints nullable="false"/>
</column>
<column name="is_update_data" type="BOOLEAN">
<constraints nullable="false"/>
</column>
<column name="requests_recovery" type="BOOLEAN">
<constraints nullable="false"/>
</column>
<column name="job_data" type="BYTEA"/>
</createTable>
</changeSet>
<changeSet author="Sheldan" id="qrtz_job_details-index1">
<createIndex indexName="idx_qrtz_j_grp" tableName="qrtz_job_details">
<column name="sched_name"/>
<column name="job_group"/>
</createIndex>
</changeSet>
<changeSet author="Sheldan" id="qrtz_job_details-index2">
<createIndex indexName="idx_qrtz_j_req_recovery" tableName="qrtz_job_details">
<column name="sched_name"/>
<column name="requests_recovery"/>
</createIndex>
</changeSet>
</databaseChangeLog>

View File

@@ -0,0 +1,19 @@
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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="Sheldan" id="qrtz_locks-table">
<createTable tableName="qrtz_locks">
<column name="sched_name" type="VARCHAR(120)">
<constraints nullable="false" primaryKey="true" primaryKeyName="qrtz_locks_pkey"/>
</column>
<column name="lock_name" type="VARCHAR(40)">
<constraints nullable="false" primaryKey="true" primaryKeyName="qrtz_locks_pkey"/>
</column>
</createTable>
</changeSet>
</databaseChangeLog>

View File

@@ -0,0 +1,19 @@
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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="Sheldan" id="qrtz_paused_trigger_grps-table">
<createTable tableName="qrtz_paused_trigger_grps">
<column name="sched_name" type="VARCHAR(120)">
<constraints nullable="false" primaryKey="true" primaryKeyName="qrtz_paused_trigger_grps_pkey"/>
</column>
<column name="trigger_group" type="VARCHAR(200)">
<constraints nullable="false" primaryKey="true" primaryKeyName="qrtz_paused_trigger_grps_pkey"/>
</column>
</createTable>
</changeSet>
</databaseChangeLog>

View File

@@ -0,0 +1,25 @@
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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="Sheldan" id="qrtz_scheduler_state-table">
<createTable tableName="qrtz_scheduler_state">
<column name="sched_name" type="VARCHAR(120)">
<constraints nullable="false" primaryKey="true" primaryKeyName="qrtz_scheduler_state_pkey"/>
</column>
<column name="instance_name" type="VARCHAR(200)">
<constraints nullable="false" primaryKey="true" primaryKeyName="qrtz_scheduler_state_pkey"/>
</column>
<column name="last_checkin_time" type="BIGINT">
<constraints nullable="false"/>
</column>
<column name="checkin_interval" type="BIGINT">
<constraints nullable="false"/>
</column>
</createTable>
</changeSet>
</databaseChangeLog>

View File

@@ -0,0 +1,36 @@
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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="Sheldan" id="qrtz_simple_triggers-table">
<createTable tableName="qrtz_simple_triggers">
<column name="sched_name" type="VARCHAR(120)">
<constraints nullable="false" primaryKey="true" primaryKeyName="qrtz_simple_triggers_pkey"/>
</column>
<column name="trigger_name" type="VARCHAR(200)">
<constraints nullable="false" primaryKey="true" primaryKeyName="qrtz_simple_triggers_pkey"/>
</column>
<column name="trigger_group" type="VARCHAR(200)">
<constraints nullable="false" primaryKey="true" primaryKeyName="qrtz_simple_triggers_pkey"/>
</column>
<column name="repeat_count" type="BIGINT">
<constraints nullable="false"/>
</column>
<column name="repeat_interval" type="BIGINT">
<constraints nullable="false"/>
</column>
<column name="times_triggered" type="BIGINT">
<constraints nullable="false"/>
</column>
</createTable>
</changeSet>
<changeSet author="Sheldan" id="qrtz_simple_triggers-qrtz_simple_triggers_sched_name_trigger_name_trigger_group_fkey">
<addForeignKeyConstraint baseColumnNames="sched_name,trigger_name,trigger_group" baseTableName="qrtz_simple_triggers" constraintName="qrtz_simple_triggers_sched_name_trigger_name_trigger_group_fkey" deferrable="false" initiallyDeferred="false" onDelete="NO ACTION" onUpdate="NO ACTION" referencedColumnNames="sched_name,trigger_name,trigger_group" referencedTableName="qrtz_triggers" validate="true"/>
</changeSet>
</databaseChangeLog>

View File

@@ -0,0 +1,38 @@
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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="Sheldan" id="qrtz_simprop_triggers-table">
<createTable tableName="qrtz_simprop_triggers">
<column name="sched_name" type="VARCHAR(120)">
<constraints nullable="false" primaryKey="true" primaryKeyName="qrtz_simprop_triggers_pkey"/>
</column>
<column name="trigger_name" type="VARCHAR(200)">
<constraints nullable="false" primaryKey="true" primaryKeyName="qrtz_simprop_triggers_pkey"/>
</column>
<column name="trigger_group" type="VARCHAR(200)">
<constraints nullable="false" primaryKey="true" primaryKeyName="qrtz_simprop_triggers_pkey"/>
</column>
<column name="str_prop_1" type="VARCHAR(512)"/>
<column name="str_prop_2" type="VARCHAR(512)"/>
<column name="str_prop_3" type="VARCHAR(512)"/>
<column name="int_prop_1" type="INTEGER"/>
<column name="int_prop_2" type="INTEGER"/>
<column name="long_prop_1" type="BIGINT"/>
<column name="long_prop_2" type="BIGINT"/>
<column name="dec_prop_1" type="numeric(13, 4)"/>
<column name="dec_prop_2" type="numeric(13, 4)"/>
<column name="bool_prop_1" type="BOOLEAN"/>
<column name="bool_prop_2" type="BOOLEAN"/>
</createTable>
</changeSet>
<changeSet author="Sheldan" id="qrtz_simprop_triggers-qrtz_simprop_triggers_sched_name_trigger_name_trigger_grou_fkey">
<addForeignKeyConstraint baseColumnNames="sched_name,trigger_name,trigger_group" baseTableName="qrtz_simprop_triggers" constraintName="qrtz_simprop_triggers_sched_name_trigger_name_trigger_grou_fkey" deferrable="false" initiallyDeferred="false" onDelete="NO ACTION" onUpdate="NO ACTION" referencedColumnNames="sched_name,trigger_name,trigger_group" referencedTableName="qrtz_triggers" validate="true"/>
</changeSet>
</databaseChangeLog>

View File

@@ -0,0 +1,133 @@
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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="Sheldan" id="qrtz_triggers-table">
<createTable tableName="qrtz_triggers">
<column name="sched_name" type="VARCHAR(120)">
<constraints nullable="false" primaryKey="true" primaryKeyName="qrtz_triggers_pkey"/>
</column>
<column name="trigger_name" type="VARCHAR(200)">
<constraints nullable="false" primaryKey="true" primaryKeyName="qrtz_triggers_pkey"/>
</column>
<column name="trigger_group" type="VARCHAR(200)">
<constraints nullable="false" primaryKey="true" primaryKeyName="qrtz_triggers_pkey"/>
</column>
<column name="job_name" type="VARCHAR(200)">
<constraints nullable="false"/>
</column>
<column name="job_group" type="VARCHAR(200)">
<constraints nullable="false"/>
</column>
<column name="description" type="VARCHAR(250)"/>
<column name="next_fire_time" type="BIGINT"/>
<column name="prev_fire_time" type="BIGINT"/>
<column name="priority" type="INTEGER"/>
<column name="trigger_state" type="VARCHAR(16)">
<constraints nullable="false"/>
</column>
<column name="trigger_type" type="VARCHAR(8)">
<constraints nullable="false"/>
</column>
<column name="start_time" type="BIGINT">
<constraints nullable="false"/>
</column>
<column name="end_time" type="BIGINT"/>
<column name="calendar_name" type="VARCHAR(200)"/>
<column name="misfire_instr" type="SMALLINT"/>
<column name="job_data" type="BYTEA"/>
</createTable>
</changeSet>
<changeSet author="Sheldan" id="qrtz_triggers-qrtz_triggers_sched_name_job_name_job_group_fkey">
<addForeignKeyConstraint baseColumnNames="sched_name,job_name,job_group" baseTableName="qrtz_triggers" constraintName="qrtz_triggers_sched_name_job_name_job_group_fkey" deferrable="false" initiallyDeferred="false" onDelete="NO ACTION" onUpdate="NO ACTION" referencedColumnNames="sched_name,job_name,job_group" referencedTableName="qrtz_job_details" validate="true"/>
</changeSet>
<changeSet author="Sheldan" id="qrtz_triggers-index1">
<createIndex indexName="idx_qrtz_t_c" tableName="qrtz_triggers">
<column name="sched_name"/>
<column name="calendar_name"/>
</createIndex>
</changeSet>
<changeSet author="Sheldan" id="qrtz_triggers-index2">
<createIndex indexName="idx_qrtz_t_g" tableName="qrtz_triggers">
<column name="sched_name"/>
<column name="trigger_group"/>
</createIndex>
</changeSet>
<changeSet author="Sheldan" id="qrtz_triggers-index3">
<createIndex indexName="idx_qrtz_t_j" tableName="qrtz_triggers">
<column name="sched_name"/>
<column name="job_name"/>
<column name="job_group"/>
</createIndex>
</changeSet>
<changeSet author="Sheldan" id="qrtz_triggers-index4">
<createIndex indexName="idx_qrtz_t_jg" tableName="qrtz_triggers">
<column name="sched_name"/>
<column name="job_group"/>
</createIndex>
</changeSet>
<changeSet author="Sheldan" id="qrtz_triggers-index5">
<createIndex indexName="idx_qrtz_t_n_g_state" tableName="qrtz_triggers">
<column name="sched_name"/>
<column name="trigger_group"/>
<column name="trigger_state"/>
</createIndex>
</changeSet>
<changeSet author="Sheldan" id="qrtz_triggers-index6">
<createIndex indexName="idx_qrtz_t_n_state" tableName="qrtz_triggers">
<column name="sched_name"/>
<column name="trigger_name"/>
<column name="trigger_group"/>
<column name="trigger_state"/>
</createIndex>
</changeSet>
<changeSet author="Sheldan" id="qrtz_triggers-index7">
<createIndex indexName="idx_qrtz_t_next_fire_time" tableName="qrtz_triggers">
<column name="sched_name"/>
<column name="next_fire_time"/>
</createIndex>
</changeSet>
<changeSet author="Sheldan" id="qrtz_triggers-index8">
<createIndex indexName="idx_qrtz_t_nft_misfire" tableName="qrtz_triggers">
<column name="sched_name"/>
<column name="misfire_instr"/>
<column name="next_fire_time"/>
</createIndex>
</changeSet>
<changeSet author="Sheldan" id="qrtz_triggers-index9">
<createIndex indexName="idx_qrtz_t_nft_st" tableName="qrtz_triggers">
<column name="sched_name"/>
<column name="trigger_state"/>
<column name="next_fire_time"/>
</createIndex>
</changeSet>
<changeSet author="Sheldan" id="qrtz_triggers-index10">
<createIndex indexName="idx_qrtz_t_nft_st_misfire" tableName="qrtz_triggers">
<column name="sched_name"/>
<column name="misfire_instr"/>
<column name="next_fire_time"/>
<column name="trigger_state"/>
</createIndex>
</changeSet>
<changeSet author="Sheldan" id="qrtz_triggers-index11">
<createIndex indexName="idx_qrtz_t_nft_st_misfire_grp" tableName="qrtz_triggers">
<column name="sched_name"/>
<column name="misfire_instr"/>
<column name="next_fire_time"/>
<column name="trigger_group"/>
<column name="trigger_state"/>
</createIndex>
</changeSet>
<changeSet author="Sheldan" id="qrtz_triggers-index12">
<createIndex indexName="idx_qrtz_t_state" tableName="qrtz_triggers">
<column name="sched_name"/>
<column name="trigger_state"/>
</createIndex>
</changeSet>
</databaseChangeLog>

View File

@@ -0,0 +1,26 @@
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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="Sheldan" id="scheduler_job-table">
<createTable tableName="scheduler_job">
<column autoIncrement="true" name="id" type="BIGINT">
<constraints nullable="false" primaryKey="true" primaryKeyName="scheduler_job_pkey"/>
</column>
<column name="active" type="BOOLEAN">
<constraints nullable="false"/>
</column>
<column name="clazz" type="VARCHAR(255)"/>
<column name="cron_expression" type="VARCHAR(255)"/>
<column name="group_name" type="VARCHAR(255)"/>
<column name="name" type="VARCHAR(255)"/>
<column name="recovery" type="BOOLEAN">
<constraints nullable="false"/>
</column>
</createTable>
</changeSet>
</databaseChangeLog>

View File

@@ -0,0 +1,21 @@
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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" >
<include file="qrtz_job_details.xml" relativeToChangelogFile="true"/>
<include file="qrtz_triggers.xml" relativeToChangelogFile="true"/>
<include file="qrtz_blob_triggers.xml" relativeToChangelogFile="true"/>
<include file="qrtz_calendars.xml" relativeToChangelogFile="true"/>
<include file="qrtz_cron_triggers.xml" relativeToChangelogFile="true"/>
<include file="qrtz_fired_triggers.xml" relativeToChangelogFile="true"/>
<include file="qrtz_locks.xml" relativeToChangelogFile="true"/>
<include file="qrtz_paused_trigger_grps.xml" relativeToChangelogFile="true"/>
<include file="qrtz_scheduler_state.xml" relativeToChangelogFile="true"/>
<include file="qrtz_simple_triggers.xml" relativeToChangelogFile="true"/>
<include file="qrtz_simprop_triggers.xml" relativeToChangelogFile="true"/>
<include file="scheduler_job.xml" relativeToChangelogFile="true"/>
</databaseChangeLog>

View File

@@ -0,0 +1,10 @@
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xmlns:pro="http://www.liquibase.org/xml/ns/pro"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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" >
<include file="1.0-scheduling/collection.xml" relativeToChangelogFile="true"/>
</databaseChangeLog>