-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved liquibase client and Timestamp scripts to be run only when r…
…equired Signed-off-by: coduz <alberto.codutti@eurotech.com>
- Loading branch information
Showing
42 changed files
with
236 additions
and
110 deletions.
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
57 changes: 57 additions & 0 deletions
57
...rc/main/java/org/eclipse/kapua/commons/liquibase/settings/LiquibaseClientSettingKeys.java
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,57 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2020 Eurotech and/or its affiliates and others | ||
* | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* Eurotech - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.kapua.commons.liquibase.settings; | ||
|
||
import org.eclipse.kapua.commons.setting.SettingKey; | ||
|
||
/** | ||
* {@link LiquibaseClientSettings} {@link SettingKey}s | ||
* | ||
* @since 1.2.0 | ||
*/ | ||
public enum LiquibaseClientSettingKeys implements SettingKey { | ||
|
||
/** | ||
* Whether or not force the fix of the SQL timestamps. | ||
* | ||
* @since 1.2.0 | ||
*/ | ||
FORCE_TIMESTAMPS_FIX("liquibaseClient.timestamps.fix.force"), | ||
|
||
/** | ||
* {@link liquibase.Liquibase} version. | ||
* | ||
* @since 1.2.0 | ||
*/ | ||
LIQUIBASE_VERSION("liquibaseClient.liquibase.version"); | ||
|
||
|
||
/** | ||
* The {@link String} {@link LiquibaseClientSettingKeys} name. | ||
*/ | ||
private final String key; | ||
|
||
/** | ||
* Constructor. | ||
* | ||
* @param key The {@link String} {@link LiquibaseClientSettingKeys} name. | ||
* @since 1.2.0 | ||
*/ | ||
private LiquibaseClientSettingKeys(String key) { | ||
this.key = key; | ||
} | ||
|
||
@Override | ||
public String key() { | ||
return key; | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
...s/src/main/java/org/eclipse/kapua/commons/liquibase/settings/LiquibaseClientSettings.java
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,44 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2020 Eurotech and/or its affiliates and others | ||
* | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* Eurotech - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.kapua.commons.liquibase.settings; | ||
|
||
import org.eclipse.kapua.commons.setting.AbstractKapuaSetting; | ||
|
||
/** | ||
* @since 1.2.0 | ||
*/ | ||
public class LiquibaseClientSettings extends AbstractKapuaSetting<LiquibaseClientSettingKeys> { | ||
|
||
private static final String CONFIG_RESOURCE_NAME = "liquibase-client-settings.properties"; | ||
|
||
private static final LiquibaseClientSettings INSTANCE = new LiquibaseClientSettings(); | ||
|
||
/** | ||
* Constructor. | ||
* | ||
* @since 1.2.0 | ||
*/ | ||
private LiquibaseClientSettings() { | ||
super(CONFIG_RESOURCE_NAME); | ||
} | ||
|
||
/** | ||
* Gets the {@link LiquibaseClientSettings} singleton instance. | ||
* | ||
* @return The {@link LiquibaseClientSettings} singleton instance. | ||
* @since 1.2.0 | ||
*/ | ||
public static LiquibaseClientSettings getInstance() { | ||
return INSTANCE; | ||
} | ||
|
||
} |
14 changes: 14 additions & 0 deletions
14
commons/src/main/resources/liquibase-client-settings.properties
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,14 @@ | ||
############################################################################### | ||
# Copyright (c) 2020 Eurotech and/or its affiliates and others | ||
# | ||
# All rights reserved. This program and the accompanying materials | ||
# are made available under the terms of the Eclipse Public License v1.0 | ||
# which accompanies this distribution, and is available at | ||
# http://www.eclipse.org/legal/epl-v10.html | ||
# | ||
# Contributors: | ||
# Eurotech - initial API and implementation | ||
# | ||
############################################################################### | ||
liquibaseClient.liquibase.version=${liquibase.version} | ||
liquibaseClient.timestamps.fix.force=false |
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
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
Oops, something went wrong.