diff options
6 files changed, 120 insertions, 0 deletions
diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1700/downgrade/0100-message.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1700/downgrade/0100-message.sql new file mode 100644 index 00000000..2bec3fb3 --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1700/downgrade/0100-message.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2025 Nordix Foundation + * ================================================================================ + * Licensed 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. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +DROP TABLE message; diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1700/downgrade/0200-messagejob.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1700/downgrade/0200-messagejob.sql new file mode 100644 index 00000000..e4b56251 --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1700/downgrade/0200-messagejob.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2025 Nordix Foundation + * ================================================================================ + * Licensed 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. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +DROP TABLE messagejob; diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1700/downgrade/0300-messagejob_identificationId_index.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1700/downgrade/0300-messagejob_identificationId_index.sql new file mode 100644 index 00000000..d54f5381 --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1700/downgrade/0300-messagejob_identificationId_index.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2025 Nordix Foundation + * ================================================================================ + * Licensed 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. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +DROP INDEX IF EXISTS messagejob_identificationId_index; diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1700/upgrade/0100-message.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1700/upgrade/0100-message.sql new file mode 100644 index 00000000..f13f3b8e --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1700/upgrade/0100-message.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2025 Nordix Foundation + * ================================================================================ + * Licensed 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. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +CREATE TABLE IF NOT EXISTS message (messageId varchar(255) NOT NULL, identificationId varchar(255) NOT NULL, lastMsg timestamp without time zone NOT NULL DEFAULT now(), docMessage text NOT NULL, CONSTRAINT PK_MESSAGE PRIMARY KEY (messageId)); diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1700/upgrade/0200-messagejob.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1700/upgrade/0200-messagejob.sql new file mode 100644 index 00000000..ea6d7baa --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1700/upgrade/0200-messagejob.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2025 Nordix Foundation + * ================================================================================ + * Licensed 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. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +CREATE TABLE IF NOT EXISTS messagejob (jobId varchar(255) NOT NULL, identificationId varchar(255) NOT NULL, jobStarted timestamp without time zone NOT NULL DEFAULT now(), CONSTRAINT PK_MESSAGE_JOB PRIMARY KEY (jobId)); diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1700/upgrade/0300-messagejob_identificationId_index.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1700/upgrade/0300-messagejob_identificationId_index.sql new file mode 100644 index 00000000..4d512dc5 --- /dev/null +++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1700/upgrade/0300-messagejob_identificationId_index.sql @@ -0,0 +1,20 @@ +/* + * ============LICENSE_START======================================================= + * Copyright (C) 2025 Nordix Foundation + * ================================================================================ + * Licensed 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. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +CREATE UNIQUE INDEX messagejob_identificationId_index ON messagejob(identificationId); |