aboutsummaryrefslogtreecommitdiffstats
path: root/feature-distributed-locking/src/main/feature
diff options
context:
space:
mode:
Diffstat (limited to 'feature-distributed-locking/src/main/feature')
-rw-r--r--feature-distributed-locking/src/main/feature/db/pooling/sql/1804-distributedlocking.upgrade.sql17
-rw-r--r--feature-distributed-locking/src/main/feature/db/pooling/sql/1811-distributedlocking.upgrade.sql6
2 files changed, 15 insertions, 8 deletions
diff --git a/feature-distributed-locking/src/main/feature/db/pooling/sql/1804-distributedlocking.upgrade.sql b/feature-distributed-locking/src/main/feature/db/pooling/sql/1804-distributedlocking.upgrade.sql
index be56d35e..07b30738 100644
--- a/feature-distributed-locking/src/main/feature/db/pooling/sql/1804-distributedlocking.upgrade.sql
+++ b/feature-distributed-locking/src/main/feature/db/pooling/sql/1804-distributedlocking.upgrade.sql
@@ -1,7 +1,7 @@
# ============LICENSE_START=======================================================
# feature-distributed-locking
# ================================================================================
-# Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
+# Copyright (C) 2018, 2022 AT&T Intellectual Property. All rights reserved.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -16,8 +16,15 @@
# limitations under the License.
# ============LICENSE_END=========================================================
- set foreign_key_checks=0;
-
- CREATE TABLE if not exists pooling.locks (resourceId VARCHAR(128), host VARCHAR(128), owner VARCHAR(128), expirationTime BIGINT, PRIMARY KEY (resourceId), INDEX idx_expirationTime(expirationTime), INDEX idx_host(host));
+SET foreign_key_checks=0;
- set foreign_key_checks=1; \ No newline at end of file
+CREATE TABLE if NOT EXISTS pooling.locks(
+ resourceId VARCHAR(128),
+ host VARCHAR(128),
+ owner VARCHAR(128),
+ expirationTime BIGINT,
+ PRIMARY KEY (resourceId),
+ INDEX idx_expirationTime(expirationTime),
+ INDEX idx_host(host));
+
+SET foreign_key_checks=1; \ No newline at end of file
diff --git a/feature-distributed-locking/src/main/feature/db/pooling/sql/1811-distributedlocking.upgrade.sql b/feature-distributed-locking/src/main/feature/db/pooling/sql/1811-distributedlocking.upgrade.sql
index 847c44ac..0cdad5b9 100644
--- a/feature-distributed-locking/src/main/feature/db/pooling/sql/1811-distributedlocking.upgrade.sql
+++ b/feature-distributed-locking/src/main/feature/db/pooling/sql/1811-distributedlocking.upgrade.sql
@@ -16,8 +16,8 @@
# limitations under the License.
# ============LICENSE_END=========================================================
- set foreign_key_checks=0;
+SET foreign_key_checks=0;
- ALTER TABLE pooling.locks modify expirationTime timestamp default '1971-01-01 00:00:00.000000';
+ALTER TABLE pooling.locks MODIFY expirationTime TIMESTAMP DEFAULT '1971-01-01 00:00:00.000000';
- set foreign_key_checks=1;
+SET foreign_key_checks=1;