From d4d8ba884a80d0f7483efe2fb2c981023f983022 Mon Sep 17 00:00:00 2001
From: Felix Kehrer <felix.kehrer@gmail.com>
Date: Mon, 7 May 2018 17:23:31 +0200
Subject: Changed enums (and similar fields) to match enum names of Java

---
 src/main/resources/sql/database.sql | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

(limited to 'src/main/resources/sql/database.sql')

diff --git a/src/main/resources/sql/database.sql b/src/main/resources/sql/database.sql
index e775550..4f3adf7 100644
--- a/src/main/resources/sql/database.sql
+++ b/src/main/resources/sql/database.sql
@@ -4,7 +4,7 @@ CREATE TABLE IF NOT EXISTS VehicleVersion (
   constructionType VARCHAR NOT NULL,
   type VARCHAR NOT NULL,
   hasNef BOOLEAN NOT NULL,
-  CHECK constructionType IN ('Normal', 'Hochdach', 'Mittelhochdach'),
+  CHECK constructionType IN ('NORMAL', 'HOCHDACH', 'MITTELHOCHDACH'),
   CHECK type IN ('BKTW', 'KTW-B', 'KTW', 'RTW', 'NEF', 'NAH')
 );
 
@@ -13,8 +13,8 @@ CREATE TABLE IF NOT EXISTS Vehicle (
   version BIGINT NOT NULL,
   status VARCHAR NOT NULL,
   FOREIGN KEY (version) REFERENCES VehicleVersion(id),
-  CHECK status IN ('abgemeldet', 'frei_wache', 'zum_berufungsort', 'am_berufungsort', 'zum_zielort',
-              'am_zielort', 'frei_funk', 'deleted')
+  CHECK status IN ('ABGEMELDET', 'FREI_WACHE', 'ZUM_BERUFUNGSORT', 'AM_BERUFUNGSORT', 'ZUM_ZIELORT',
+              'AM_ZIELORT', 'FREI_FUNK', 'DELETED')
 );
 
 CREATE TABLE IF NOT EXISTS EmployeeVersion (
@@ -51,7 +51,9 @@ CREATE TABLE IF NOT EXISTS Operation (
   created TIMESTAMP NOT NULL,
   destination VARCHAR(100) NOT NULL,
   additionalInfo VARCHAR(100),
-  CHECK severity IN ('A', 'B', 'C', 'D', 'E', 'O')
+  status VARCHAR NOT NULL,
+  CHECK severity IN ('A', 'B', 'C', 'D', 'E', 'O'),
+  CHECK status IN ('ACTIVE', 'COMPLETED', 'CANCELLED')
 );
 
 CREATE TABLE IF NOT EXISTS VehicleOperation (
-- 
cgit v1.2.3-70-g09d2

