Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions docker/postgres/docker-compose-deps-postgres.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ services:
restart_policy:
condition: on-failure
environment:
POSTGRES_DB: "hawkbit"
POSTGRES_USER: "postgres"
POSTGRES_PASSWORD: "admin"
POSTGRES_DB: "hawkbit"
healthcheck:
test: ["CMD-SHELL", "pg_isready -d ${POSTGRES_DB} -U ${POSTGRES_USER}"]
test: ["CMD-SHELL", "pg_isready -d ${POSTGRES_DB:-hawkbit} -U ${POSTGRES_USER:-postgres}"]
interval: 20s
retries: 10

Expand All @@ -44,5 +44,4 @@ services:
- "5672:5672"
deploy:
restart_policy:
condition: on-failure

condition: on-failure
16 changes: 14 additions & 2 deletions docs/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ $ mvn clean install -DskipTests
$ java -jar ./hawkbit-monolith/hawkbit-update-server/target/hawkbit-update-server-0-SNAPSHOT.jar
```

> **Note:** you could start it also in **microservices mode** by:
**Note:** you could start it also in **microservices mode** by:

```bash
$ java -jar ./hawkbit-mgmt/hawkbit-mgmt-server/target/hawkbit-mgmt-server-0-SNAPSHOT.jar
Expand All @@ -137,10 +137,22 @@ And (only if you want to use the DMF feature):
$ java -jar ./hawkbit-monolith/hawkbit-update-server/target/hawkbit-update-server-0-SNAPSHOT.jar
```

**Note:** You could also start with H2 console enabled with:
```bash
$java -jar ./hawkbit-monolith/hawkbit-update-server/target/hawkbit-update-server-0-SNAPSHOT.jar --spring.h2.console.enabled=true --spring.h2.console.path=/h2-console
```
for monolith, and:
```bash
$java -jar ./hawkbit-mgmt/hawkbit-mgmt-server/target/hawkbit-mgmt-server-0-SNAPSHOT.jar --spring.h2.console.enabled=true --spring.h2.console.path=/h2-console
```
for mgmt server in micro-service mode.

Then you will get H2 console available at '/h2-console' (Database available at 'jdbc:h2:mem:hawkbit')

You could also start the **hawkBit UI** by:

```bash
$ java -jar ./hawkbit--ui/target/hawkbit-ui-0-SNAPSHOT.jar
$ java -jar ./hawkbit-ui/target/hawkbit-ui-0-SNAPSHOT.jar
```

---
Expand Down
878 changes: 377 additions & 501 deletions eclipse_codeformatter.xml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- remove unnecessary / faulty default for a tenant's scope unique key
ALTER TABLE sp_target_type ALTER COLUMN type_key DROP DEFAULT;

-- remove unused column
ALTER TABLE sp_rollout DROP COLUMN group_theshold;
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
-- fix NOT NULL disappeared in V1_12_12__change_length_of_controller_id_and_name___MYSQL.sql and V1_12_22__change_target_type_name_length___MYSQL.sql
UPDATE sp_software_module SET name = '' WHERE name IS NULL;
ALTER TABLE sp_software_module MODIFY name VARCHAR(128) NOT NULL;
UPDATE sp_software_module_type SET name = '' WHERE name IS NULL;
ALTER TABLE sp_software_module_type MODIFY name VARCHAR(128) NOT NULL;

UPDATE sp_distribution_set SET name = '' WHERE name IS NULL;
ALTER TABLE sp_distribution_set MODIFY name VARCHAR(128) NOT NULL;
UPDATE sp_distribution_set_type SET name = '' WHERE name IS NULL;
ALTER TABLE sp_distribution_set_type MODIFY name VARCHAR(128) NOT NULL;
UPDATE sp_distribution_set_tag SET name = '' WHERE name IS NULL;
ALTER TABLE sp_distribution_set_tag MODIFY name VARCHAR(128) NOT NULL;

UPDATE sp_target SET name = '' WHERE name IS NULL;
ALTER TABLE sp_target MODIFY name VARCHAR(128) NOT NULL;
UPDATE sp_target_type SET name = '' WHERE name IS NULL;
ALTER TABLE sp_target_type MODIFY name VARCHAR(128) NOT NULL;
UPDATE sp_target_tag SET name = '' WHERE name IS NULL;
ALTER TABLE sp_target_tag MODIFY name VARCHAR(128) NOT NULL;
UPDATE sp_target_filter_query SET name = '' WHERE name IS NULL;
ALTER TABLE sp_target_filter_query MODIFY name VARCHAR(128) NOT NULL;

UPDATE sp_rollout SET name = '' WHERE name IS NULL;
ALTER TABLE sp_rollout MODIFY name VARCHAR(128) NOT NULL;
UPDATE sp_rollout_group SET name = '' WHERE name IS NULL;
ALTER TABLE sp_rollout_group MODIFY name VARCHAR(128) NOT NULL;

UPDATE sp_target SET controller_id = '' WHERE controller_id IS NULL;
ALTER TABLE sp_target MODIFY controller_id VARCHAR(256) NOT NULL;

-- remove unnecessary / faulty default for a tenant's scope unique key
ALTER TABLE sp_target_type ALTER COLUMN type_key DROP DEFAULT;

-- remove unused column
ALTER TABLE sp_rollout DROP COLUMN group_theshold;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ALTER TABLE sp_software_module_type ADD COLUMN min_artifacts integer default 0 NOT NULL;
DROP INDEX sp_idx_distribution_set_01;
DROP INDEX sp_idx_distribution_set_01_sp_distribution_set;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this edits intermediate migration - is that even ok ?
what happens if already processed but now it is with different checksum ?

CREATE INDEX sp_idx_distribution_set_01 ON sp_distribution_set USING BTREE (tenant, deleted);
ALTER TABLE sp_distribution_set DROP COLUMN complete;
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
-- fix NOT NULL V1_12_15__baseline___POSTGRESQL.sql and V1_12_22__change_target_type_name_length___POSTGRESQL.sql
UPDATE sp_software_module SET name = '' WHERE name IS NULL;
ALTER TABLE sp_software_module ALTER COLUMN name SET NOT NULL;
UPDATE sp_software_module_type SET name = '' WHERE name IS NULL;
ALTER TABLE sp_software_module_type ALTER COLUMN name SET NOT NULL;

UPDATE sp_distribution_set SET name = '' WHERE name IS NULL;
ALTER TABLE sp_distribution_set ALTER COLUMN name SET NOT NULL;
UPDATE sp_distribution_set_type SET name = '' WHERE name IS NULL;
ALTER TABLE sp_distribution_set_type ALTER COLUMN name SET NOT NULL;
UPDATE sp_distribution_set_tag SET name = '' WHERE name IS NULL;
ALTER TABLE sp_distribution_set_tag ALTER COLUMN name SET NOT NULL;

UPDATE sp_target SET name = '' WHERE name IS NULL;
ALTER TABLE sp_target ALTER COLUMN name SET NOT NULL;
UPDATE sp_target_type SET name = '' WHERE name IS NULL;
ALTER TABLE sp_target_type ALTER COLUMN name SET NOT NULL;
UPDATE sp_target_tag SET name = '' WHERE name IS NULL;
ALTER TABLE sp_target_tag ALTER COLUMN name SET NOT NULL;
UPDATE sp_target_filter_query SET name = '' WHERE name IS NULL;
ALTER TABLE sp_target_filter_query ALTER COLUMN name SET NOT NULL;

UPDATE sp_rollout SET name = '' WHERE name IS NULL;
ALTER TABLE sp_rollout ALTER COLUMN name SET NOT NULL;
UPDATE sp_rollout_group SET name = '' WHERE name IS NULL;
ALTER TABLE sp_rollout_group ALTER COLUMN name SET NOT NULL;

UPDATE sp_target SET controller_id = '' WHERE controller_id IS NULL;
ALTER TABLE sp_target ALTER COLUMN controller_id SET NOT NULL;

-- fix sp_target_conf_status_new column order (to be MySQL and H2 schemes compatible)
BEGIN;

CREATE TABLE sp_target_conf_status_new (
id BIGINT GENERATED BY DEFAULT AS IDENTITY,
target BIGINT NOT NULL,
initiator VARCHAR(64),
remark VARCHAR(512),
created_at BIGINT,
created_by VARCHAR(64),
last_modified_at BIGINT,
last_modified_by VARCHAR(64),
optlock_revision BIGINT,
tenant VARCHAR(40) NOT NULL,
PRIMARY KEY (id)
);

INSERT INTO sp_target_conf_status_new
SELECT id, target, initiator, remark, created_at, created_by, last_modified_at, last_modified_by, optlock_revision, tenant
FROM sp_target_conf_status;
-- inserting with id hasn't / may haven't incremented the sequence
DO $$
BEGIN
PERFORM setval('sp_target_conf_status_new_id_seq', (SELECT MAX(id) FROM sp_target_conf_status_new));
END $$;

DROP TABLE sp_target_conf_status;
ALTER TABLE sp_target_conf_status_new RENAME TO sp_target_conf_status;

COMMIT;

DROP INDEX sp_idx_rollout_group_parent;
ALTER TABLE sp_target_conf_status
ADD CONSTRAINT fk_target_conf_status_target FOREIGN KEY (target) REFERENCES sp_target (id) ON DELETE CASCADE;
ALTER TABLE sp_target_type_ds_type
ADD CONSTRAINT pk_sp_target_type_ds_type PRIMARY KEY (target_type, distribution_set_type);

-- remove unnecessary / faulty default for a tenant's scope unique key
ALTER TABLE sp_target_type ALTER COLUMN type_key DROP DEFAULT;

-- remove unused column
ALTER TABLE sp_rollout DROP COLUMN group_theshold;

-- -- unify index names --
-- sp_distribution_set_tag table indexes
ALTER INDEX sp_idx_distribution_set_tag_01_sp_distributionset_tag RENAME TO sp_idx_distribution_set_tag_01;
ALTER INDEX sp_idx_distribution_set_tag_prim_sp_distributionset_tag RENAME TO sp_idx_distribution_set_tag_prim;
-- sp_distribution_set_type table indexes
ALTER INDEX sp_idx_distribution_set_type_prim_sp_distribution_set_type RENAME TO sp_idx_distribution_set_type_prim;
ALTER INDEX sp_idx_distribution_set_type_01_sp_distribution_set_type RENAME TO sp_idx_distribution_set_type_01;
-- sp_software_module_type table indexes
ALTER INDEX sp_idx_software_module_type_prim_sp_software_module_type RENAME TO sp_idx_software_module_type_prim;
ALTER INDEX sp_idx_software_module_type_01_sp_software_module_type RENAME TO sp_idx_software_module_type_01;
-- sp_target_tag table indexes
ALTER INDEX sp_idx_target_tag_prim_sp_target_tag RENAME TO sp_idx_target_tag_prim;
ALTER INDEX sp_idx_target_tag_01_sp_target_tag RENAME TO sp_idx_target_tag_01;
-- sp_distribution_set table indexes
ALTER INDEX sp_idx_distribution_set_prim_sp_distribution_set RENAME TO sp_idx_distribution_set_prim;
-- sp_tenant table indexes
ALTER INDEX sp_idx_tenant_prim_sp_tenant RENAME TO sp_idx_tenant_prim;
-- sp_rollout table indexes
ALTER INDEX uk_rollout_sp_rollout RENAME TO uk_rollout;
-- sp_target table indexes
ALTER INDEX uk_target RENAME TO uk_target_controller_id;
ALTER INDEX sp_idx_target_01_sp_target RENAME TO sp_idx_target_01;
ALTER INDEX sp_idx_target_03_sp_target RENAME TO sp_idx_target_03;
ALTER INDEX sp_idx_target_04_sp_target RENAME TO sp_idx_target_04;
ALTER INDEX sp_idx_target_prim_sp_target RENAME TO sp_idx_target_prim;
-- sp_artifact table indexes
ALTER INDEX sp_idx_artifact_prim_sp_artifact RENAME TO sp_idx_artifact_prim;
ALTER INDEX sp_idx_artifact_01_sp_artifact RENAME TO sp_idx_artifact_01;
ALTER INDEX sp_idx_artifact_02_sp_artifact RENAME TO sp_idx_artifact_02;
-- sp_action table indexes
ALTER INDEX sp_idx_action_prim_sp_action RENAME TO sp_idx_action_prim;
ALTER INDEX sp_idx_action_01_sp_action RENAME TO sp_idx_action_01;
ALTER INDEX sp_idx_action_02_sp_action RENAME TO sp_idx_action_02;
ALTER INDEX sp_idx_action_external_ref_sp_action RENAME TO sp_idx_action_external_ref;
-- sp_action_status table indexes
ALTER INDEX sp_idx_action_status_prim_sp_action_status RENAME TO sp_idx_action_status_prim;
ALTER INDEX sp_idx_action_status_02_sp_action_status RENAME TO sp_idx_action_status_02;
Loading
Loading