-
Notifications
You must be signed in to change notification settings - Fork 80
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
[Issue#1785]-Create Data Index(DI)/ Jobs Service(JS) Database(DB) migration image #1791
Closed
Closed
Changes from 11 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
1308719
Initial add for kogito-postgres-db-migration-image
rhkp 24fb2d5
Make build work for incubator-kie-kogito-postgres-db-migration
rhkp 36061d2
Initial test for DB migration image
rhkp 18dd3fe
Further change to the DB Migration Image test
rhkp dd96e7a
Update to flyway 10.160.0
rhkp 32f96e4
Minor changes including removal of unwanted files
rhkp 7475600
Update the test for Postgres db migration image
rhkp 07aa695
Add to RELEASE_NOTES.md
rhkp b96d244
Address review comments - pass 1
rhkp d38991b
Address review comments - pass 1.1
rhkp 26472d2
Update flyway URL to maven repo and bump version to 10.17
rhkp 1e0e549
Address review comments - pass 2
rhkp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
# | ||
name: "docker.io/apache/incubator-kie-kogito-postgres-db-migration" | ||
version: "999-SNAPSHOT" | ||
from: registry.access.redhat.com/ubi8/openjdk-17-runtime:1.19 | ||
description: Flyway image for DI/JS database migration | ||
|
||
labels: | ||
- name: "org.kie.kogito.version" | ||
value: "999-SNAPSHOT" | ||
- name: "maintainer" | ||
value: "Apache KIE <[email protected]>" | ||
- name: "io.k8s.description" | ||
value: "Kogito DB Migration creates schemas and tables for Data Index and Jobs Service for PostgreSQL database" | ||
- name: "io.k8s.display-name" | ||
value: "Kogito DB Migration for Data Index and Jobs Service - PostgreSQL" | ||
- name: "io.openshift.tags" | ||
value: "kogito,db-migration" | ||
|
||
modules: | ||
repositories: | ||
- path: modules | ||
install: | ||
- name: kogito-postgres-db-migration-deps | ||
|
||
run: | ||
workdir: "/home/default" | ||
entrypoint: | ||
- "/home/default/migration.sh" |
307 changes: 307 additions & 0 deletions
307
...-db-migration-deps/artifacts/db-migration-files/data-index/V1.32.0__data_index_create.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,307 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
SET SEARCH_PATH="$DATA_INDEX_SCHEMA"; | ||
rhkp marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
create table IF NOT EXISTS attachments | ||
( | ||
id varchar(255) not null, | ||
content varchar(255), | ||
name varchar(255), | ||
updated_at timestamp, | ||
updated_by varchar(255), | ||
task_id varchar(255) not null, | ||
primary key (id) | ||
); | ||
|
||
create table IF NOT EXISTS comments | ||
( | ||
id varchar(255) not null, | ||
content varchar(255), | ||
updated_at timestamp, | ||
updated_by varchar(255), | ||
task_id varchar(255) not null, | ||
primary key (id) | ||
); | ||
|
||
create table IF NOT EXISTS jobs | ||
( | ||
id varchar(255) not null, | ||
callback_endpoint varchar(255), | ||
endpoint varchar(255), | ||
execution_counter int4, | ||
expiration_time timestamp, | ||
last_update timestamp, | ||
node_instance_id varchar(255), | ||
priority int4, | ||
process_id varchar(255), | ||
process_instance_id varchar(255), | ||
repeat_interval int8, | ||
repeat_limit int4, | ||
retries int4, | ||
root_process_id varchar(255), | ||
root_process_instance_id varchar(255), | ||
scheduled_id varchar(255), | ||
status varchar(255), | ||
primary key (id) | ||
); | ||
|
||
create table IF NOT EXISTS milestones | ||
( | ||
id varchar(255) not null, | ||
process_instance_id varchar(255) not null, | ||
name varchar(255), | ||
status varchar(255), | ||
primary key (id, process_instance_id) | ||
); | ||
|
||
create table IF NOT EXISTS nodes | ||
( | ||
id varchar(255) not null, | ||
definition_id varchar(255), | ||
enter timestamp, | ||
exit timestamp, | ||
name varchar(255), | ||
node_id varchar(255), | ||
type varchar(255), | ||
process_instance_id varchar(255) not null, | ||
primary key (id) | ||
); | ||
|
||
create table IF NOT EXISTS processes | ||
( | ||
id varchar(255) not null, | ||
business_key varchar(255), | ||
end_time timestamp, | ||
endpoint varchar(255), | ||
message varchar(255), | ||
node_definition_id varchar(255), | ||
last_update_time timestamp, | ||
parent_process_instance_id varchar(255), | ||
process_id varchar(255), | ||
process_name varchar(255), | ||
root_process_id varchar(255), | ||
root_process_instance_id varchar(255), | ||
start_time timestamp, | ||
state int4, | ||
variables jsonb, | ||
primary key (id) | ||
); | ||
|
||
create table IF NOT EXISTS processes_addons | ||
( | ||
process_id varchar(255) not null, | ||
addon varchar(255) not null, | ||
primary key (process_id, addon) | ||
); | ||
|
||
create table IF NOT EXISTS processes_roles | ||
( | ||
process_id varchar(255) not null, | ||
role varchar(255) not null, | ||
primary key (process_id, role) | ||
); | ||
|
||
create table IF NOT EXISTS tasks | ||
( | ||
id varchar(255) not null, | ||
actual_owner varchar(255), | ||
completed timestamp, | ||
description varchar(255), | ||
endpoint varchar(255), | ||
inputs jsonb, | ||
last_update timestamp, | ||
name varchar(255), | ||
outputs jsonb, | ||
priority varchar(255), | ||
process_id varchar(255), | ||
process_instance_id varchar(255), | ||
reference_name varchar(255), | ||
root_process_id varchar(255), | ||
root_process_instance_id varchar(255), | ||
started timestamp, | ||
state varchar(255), | ||
primary key (id) | ||
); | ||
|
||
create table IF NOT EXISTS tasks_admin_groups | ||
( | ||
task_id varchar(255) not null, | ||
group_id varchar(255) not null, | ||
primary key (task_id, group_id) | ||
); | ||
|
||
create table IF NOT EXISTS tasks_admin_users | ||
( | ||
task_id varchar(255) not null, | ||
user_id varchar(255) not null, | ||
primary key (task_id, user_id) | ||
); | ||
|
||
create table IF NOT EXISTS tasks_excluded_users | ||
( | ||
task_id varchar(255) not null, | ||
user_id varchar(255) not null, | ||
primary key (task_id, user_id) | ||
); | ||
|
||
create table IF NOT EXISTS tasks_potential_groups | ||
( | ||
task_id varchar(255) not null, | ||
group_id varchar(255) not null, | ||
primary key (task_id, group_id) | ||
); | ||
|
||
create table IF NOT EXISTS tasks_potential_users | ||
( | ||
task_id varchar(255) not null, | ||
user_id varchar(255) not null, | ||
primary key (task_id, user_id) | ||
); | ||
|
||
alter table if exists attachments | ||
drop constraint if exists fk_attachments_tasks | ||
cascade; | ||
|
||
alter table if exists attachments | ||
add constraint fk_attachments_tasks | ||
foreign key (task_id) | ||
references tasks | ||
on | ||
delete | ||
cascade; | ||
|
||
alter table if exists comments | ||
drop constraint if exists fk_comments_tasks | ||
cascade; | ||
|
||
alter table if exists comments | ||
add constraint fk_comments_tasks | ||
foreign key (task_id) | ||
references tasks | ||
on | ||
delete | ||
cascade; | ||
|
||
alter table if exists milestones | ||
drop constraint if exists fk_milestones_process | ||
cascade; | ||
|
||
alter table if exists milestones | ||
add constraint fk_milestones_process | ||
foreign key (process_instance_id) | ||
references processes | ||
on | ||
delete | ||
cascade; | ||
|
||
alter table if exists nodes | ||
drop constraint if exists fk_nodes_process | ||
cascade; | ||
|
||
alter table if exists nodes | ||
add constraint fk_nodes_process | ||
foreign key (process_instance_id) | ||
references processes | ||
on | ||
delete | ||
cascade; | ||
|
||
alter table if exists processes_addons | ||
drop constraint if exists fk_processes_addons_processes | ||
cascade; | ||
|
||
alter table if exists processes_addons | ||
add constraint fk_processes_addons_processes | ||
foreign key (process_id) | ||
references processes | ||
on | ||
delete | ||
cascade; | ||
|
||
alter table if exists processes_roles | ||
drop constraint if exists fk_processes_roles_processes | ||
cascade; | ||
|
||
alter table if exists processes_roles | ||
add constraint fk_processes_roles_processes | ||
foreign key (process_id) | ||
references processes | ||
on | ||
delete | ||
cascade; | ||
|
||
alter table if exists tasks_admin_groups | ||
drop constraint if exists fk_tasks_admin_groups_tasks | ||
cascade; | ||
|
||
alter table if exists tasks_admin_groups | ||
add constraint fk_tasks_admin_groups_tasks | ||
foreign key (task_id) | ||
references tasks | ||
on | ||
delete | ||
cascade; | ||
|
||
alter table if exists tasks_admin_users | ||
drop constraint if exists fk_tasks_admin_users_tasks | ||
cascade; | ||
|
||
alter table if exists tasks_admin_users | ||
add constraint fk_tasks_admin_users_tasks | ||
foreign key (task_id) | ||
references tasks | ||
on | ||
delete | ||
cascade; | ||
|
||
alter table if exists tasks_excluded_users | ||
drop constraint if exists fk_tasks_excluded_users_tasks | ||
cascade; | ||
|
||
alter table if exists tasks_excluded_users | ||
add constraint fk_tasks_excluded_users_tasks | ||
foreign key (task_id) | ||
references tasks | ||
on | ||
delete | ||
cascade; | ||
|
||
alter table if exists tasks_potential_groups | ||
drop constraint if exists fk_tasks_potential_groups_tasks | ||
cascade; | ||
|
||
alter table if exists tasks_potential_groups | ||
add constraint fk_tasks_potential_groups_tasks | ||
foreign key (task_id) | ||
references tasks | ||
on | ||
delete | ||
cascade; | ||
|
||
alter table if exists tasks_potential_users | ||
drop constraint if exists fk_tasks_potential_users_tasks | ||
cascade; | ||
|
||
alter table if exists tasks_potential_users | ||
add constraint fk_tasks_potential_users_tasks | ||
foreign key (task_id) | ||
references tasks | ||
on | ||
delete | ||
cascade; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, but this is unnecessary. You can remove this file, actually. We use GH releases now.