This is an automated email from the ASF dual-hosted git repository. jstastnycz pushed a commit to branch sync-20250907 in repository https://gitbox.apache.org/repos/asf/incubator-kie-kogito-apps.git
commit 117ed1abc9cea7012fd09e6623c89de5b3aee5bc Author: Deepak Joseph <[email protected]> AuthorDate: Tue Sep 2 14:11:38 2025 +0530 [main][DBACLD-191480] Copied flyway scripts from jobs-service-storage-jpa to kogito-addons-common-embedded-jobs-jpa (#32) --- .../main/resources/META-INF/kie-flyway.properties | 6 ++-- ...3.0.3__create_jobservice_sqlserver_bamoe920.sql | 28 +++++++++++++++++ .../V3.0.3__create_jobservice_oracle_bamoe921.sql | 35 ++++++++++++++++++++++ 3 files changed, 67 insertions(+), 2 deletions(-) diff --git a/jobs/kogito-addons-embedded-jobs-jpa/kogito-addons-common-embedded-jobs-jpa/src/main/resources/META-INF/kie-flyway.properties b/jobs/kogito-addons-embedded-jobs-jpa/kogito-addons-common-embedded-jobs-jpa/src/main/resources/META-INF/kie-flyway.properties index 8f5d1809a..f667115de 100644 --- a/jobs/kogito-addons-embedded-jobs-jpa/kogito-addons-common-embedded-jobs-jpa/src/main/resources/META-INF/kie-flyway.properties +++ b/jobs/kogito-addons-embedded-jobs-jpa/kogito-addons-common-embedded-jobs-jpa/src/main/resources/META-INF/kie-flyway.properties @@ -17,7 +17,9 @@ # under the License. # -module.name=JOBS_SERVICE +module.name=jobs-service module.locations.default=classpath:kie-flyway/db/jobs/ansi -module.locations.postgresql=classpath:kie-flyway/db/jobs/postgresql \ No newline at end of file +module.locations.postgresql=classpath:kie-flyway/db/jobs/postgresql +module.locations.microsoft-sql-server=classpath:kie-flyway/db/jobs/microsoft-sql-server +module.locations.oracle=classpath:kie-flyway/db/jobs/oracle diff --git a/jobs/kogito-addons-embedded-jobs-jpa/kogito-addons-common-embedded-jobs-jpa/src/main/resources/kie-flyway/db/jobs/microsoft-sql-server/V3.0.3__create_jobservice_sqlserver_bamoe920.sql b/jobs/kogito-addons-embedded-jobs-jpa/kogito-addons-common-embedded-jobs-jpa/src/main/resources/kie-flyway/db/jobs/microsoft-sql-server/V3.0.3__create_jobservice_sqlserver_bamoe920.sql new file mode 100644 index 000000000..5f1efe0f0 --- /dev/null +++ b/jobs/kogito-addons-embedded-jobs-jpa/kogito-addons-common-embedded-jobs-jpa/src/main/resources/kie-flyway/db/jobs/microsoft-sql-server/V3.0.3__create_jobservice_sqlserver_bamoe920.sql @@ -0,0 +1,28 @@ +CREATE TABLE job_details ( + id character varying(50) NOT NULL, -- the unique id internally on the job service + correlation_id character varying(50), -- the job id on the runtimes, + status character varying(40), -- the job status: 'ERROR' or 'EXECUTED' or 'SCHEDULED' or 'RETRY' or 'CANCELED' + last_update datetimeoffset, + retries integer, + execution_counter integer, -- number of times the job was executed + scheduled_id character varying(40), -- the execution control on the scheduler (id on vertx.setTimer, quartzId...) + priority integer, + recipient nvarchar(MAX), -- http callback, event topic + job_trigger nvarchar(MAX),-- when/how it should be executed + fire_time datetimeoffset, + execution_timeout bigint, + execution_timeout_unit character varying(40), + created datetimeoffset, + CONSTRAINT job_details_pkey1 PRIMARY KEY (id), + INDEX job_details_created_idx (created) +); + +CREATE TABLE job_service_management ( + id character varying(40) NOT NULL, + last_heartbeat datetimeoffset, + token character varying(40), + CONSTRAINT job_service_management_pkey PRIMARY KEY (id), + CONSTRAINT job_service_management_token_key UNIQUE (token) +); + +CREATE INDEX job_details_fire_time_idx ON job_details (fire_time); \ No newline at end of file diff --git a/jobs/kogito-addons-embedded-jobs-jpa/kogito-addons-common-embedded-jobs-jpa/src/main/resources/kie-flyway/db/jobs/oracle/V3.0.3__create_jobservice_oracle_bamoe921.sql b/jobs/kogito-addons-embedded-jobs-jpa/kogito-addons-common-embedded-jobs-jpa/src/main/resources/kie-flyway/db/jobs/oracle/V3.0.3__create_jobservice_oracle_bamoe921.sql new file mode 100644 index 000000000..17dbc5b32 --- /dev/null +++ b/jobs/kogito-addons-embedded-jobs-jpa/kogito-addons-common-embedded-jobs-jpa/src/main/resources/kie-flyway/db/jobs/oracle/V3.0.3__create_jobservice_oracle_bamoe921.sql @@ -0,0 +1,35 @@ +-- +-- It contains all the required Tables to correctly manage and persist Job Instances +-- + +-- TABLE job_details: Represents a Job Instance on the Job Service with its details +CREATE TABLE job_details ( + id VARCHAR2(50) NOT NULL, -- the unique id internally on the job service + correlation_id VARCHAR2(50), -- the job id on the runtimes, + status VARCHAR2(40), -- the job status: 'ERROR' or 'EXECUTED' or 'SCHEDULED' or 'RETRY' or 'CANCELED' + last_update timestamp with time zone, + retries integer, + execution_counter integer, -- number of times the job was executed + scheduled_id VARCHAR2(40), -- the execution control on the scheduler (id on vertx.setTimer, quartzId...) + priority integer, + recipient CLOB, -- http callback, event topic + job_trigger CLOB, -- when/how it should be executed + fire_time timestamp with time zone, + execution_timeout NUMBER(19), + execution_timeout_unit VARCHAR2(40), + created timestamp with time zone, + CONSTRAINT job_details_pkey1 PRIMARY KEY (id) +); + +-- TABLE job_service_management: used for clustering and to check lead instance +CREATE TABLE job_service_management ( + id VARCHAR2(40) NOT NULL, + last_heartbeat timestamp with time zone, + token VARCHAR2(40), + CONSTRAINT job_service_management_pkey PRIMARY KEY (id), + CONSTRAINT job_service_management_token_key UNIQUE (token) +); + +CREATE INDEX job_details_created_idx ON job_details (created); + +CREATE INDEX job_details_fire_time_idx ON job_details (fire_time); --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
