Jens Pelzetter 2020-06-13 18:57:40 +02:00
parent e2fcd17b19
commit 074cc6af67
8 changed files with 55 additions and 13 deletions

View File

@ -1,4 +1,4 @@
package db.migrations.org.libreccm.ccm_cms;
package db.migrations.org.librecms.ccm_cms;
import org.flywaydb.core.api.migration.BaseJavaMigration;
import org.flywaydb.core.api.migration.Context;
@ -84,7 +84,7 @@ public class V7_0_0_24__add_lifecycle_uuid extends BaseJavaMigration {
private void addDefinitionLifecycleCol(final Connection connection)
throws Exception {
try (PreparedStatement stmt = connection.prepareStatement(
"alter table LIFECYCLE_DEFINITIONS "
"alter table lifecyle_definitions "
+ "add column UUID varchar(255)"
)) {
stmt.execute();
@ -110,7 +110,7 @@ public class V7_0_0_24__add_lifecycle_uuid extends BaseJavaMigration {
final Connection connection, final List<Long> definitionIds
) throws Exception {
try (PreparedStatement stmt = connection.prepareStatement(
"update LIFECYCLE_DEFINITIONS set UUID = ? "
"update LIFECYLE_DEFINITIONS set UUID = ? "
+ "where LIFECYCLE_DEFINITION_ID = ?"
)) {
for (final Long lifecycleId : definitionIds) {
@ -139,7 +139,7 @@ public class V7_0_0_24__add_lifecycle_uuid extends BaseJavaMigration {
final Connection connection
) throws Exception {
try (PreparedStatement stmt = connection.prepareStatement(
"alter table LIFECYCLE_DEFINITIONS "
"alter table LIFECYLE_DEFINITIONS "
+ "add constraint UK_n6ki3s5im2k2nccpocuctqqe3 "
+ "unique (UUID)"
)) {

View File

@ -0,0 +1,22 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package db.migrations.org.librecms.ccm_cms.h2;
import org.flywaydb.core.api.migration.Context;
/**
*
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
public class V7_0_0_24__add_lifecycle_uuid
extends db.migrations.org.librecms.ccm_cms.V7_0_0_24__add_lifecycle_uuid {
@Override
public void migrate(final Context context) throws Exception {
super.migrate(context);
}
}

View File

@ -0,0 +1,22 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package db.migrations.org.librecms.ccm_cms.pgsql;
import org.flywaydb.core.api.migration.Context;
/**
*
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
*/
public class V7_0_0_24__add_lifecycle_uuid
extends db.migrations.org.librecms.ccm_cms.V7_0_0_24__add_lifecycle_uuid {
@Override
public void migrate(final Context context) throws Exception {
super.migrate(context);
}
}

View File

@ -1,9 +1,8 @@
drop schema if exists CCM_CMS;
drop schema if exists CCM_CORE;
drop schema if exists CCM_CMS CASCADE;
drop schema if exists CCM_CORE CASCADE;
drop sequence if exists HIBERNATE_SEQUENCE;
create schema CCM_CMS;
create schema CCM_CORE;

View File

@ -47,7 +47,6 @@ import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import javax.transaction.Transactional;
/**

View File

@ -1,4 +1,4 @@
drop schema if exists CCM_CORE;
drop schema if exists CCM_CORE CASCADE;
drop sequence if exists HIBERNATE_SEQUENCE;

View File

@ -1,5 +1,5 @@
DROP SCHEMA IF EXISTS ccm_docrepo;
DROP SCHEMA IF EXISTS ccm_core;
DROP SCHEMA IF EXISTS ccm_docrepo CASCADE;
DROP SCHEMA IF EXISTS ccm_core CASCADE;
DROP SEQUENCE IF EXISTS hibernate_sequence;

View File

@ -1,5 +1,5 @@
DROP SCHEMA IF EXISTS ccm_shortcuts;
DROP SCHEMA IF EXISTS ccm_core;
DROP SCHEMA IF EXISTS ccm_shortcuts CASCADE;
DROP SCHEMA IF EXISTS ccm_core CASCADE;
DROP SEQUENCE IF EXISTS hibernate_sequence;