summaryrefslogtreecommitdiffstats
path: root/src/main/resources
diff options
context:
space:
mode:
authorTharre <tharre3@gmail.com>2018-05-11 15:49:43 +0200
committerTharre <tharre3@gmail.com>2018-05-11 15:49:43 +0200
commitf7d14a76123911f0bced08356a0c69e61147cb1b (patch)
treea75b0baa891453a14046c78503603d21986126c5 /src/main/resources
parentacd6b64e494192f7c73032240029bfa53dccb362 (diff)
parent5298356db60cd971fed686d379130102843db819 (diff)
downloadsepm-groupproject-f7d14a76123911f0bced08356a0c69e61147cb1b.tar.gz
sepm-groupproject-f7d14a76123911f0bced08356a0c69e61147cb1b.tar.xz
sepm-groupproject-f7d14a76123911f0bced08356a0c69e61147cb1b.zip
Merge branch 'develop'
Diffstat (limited to 'src/main/resources')
-rw-r--r--src/main/resources/fxml/CreateOperationController.fxml95
-rw-r--r--src/main/resources/fxml/RegistrationWindow.fxml76
-rw-r--r--src/main/resources/fxml/createCar.fxml17
-rw-r--r--src/main/resources/fxml/createNewEmployee.fxml24
-rw-r--r--src/main/resources/fxml/vehiclePane.fxml70
-rw-r--r--src/main/resources/images/NEF.pngbin0 -> 327 bytes
-rw-r--r--src/main/resources/images/Not.pngbin0 -> 872 bytes
-rw-r--r--src/main/resources/images/NotNEF.pngbin0 -> 1042 bytes
-rw-r--r--src/main/resources/images/Qualification.pngbin0 -> 1029 bytes
-rw-r--r--src/main/resources/images/Vehicle.pngbin0 -> 964 bytes
-rw-r--r--src/main/resources/sql/H2RegistrationDAOTest_depopulate.sql5
-rw-r--r--src/main/resources/sql/H2RegistrationDAOTest_populate.sql15
-rw-r--r--src/main/resources/sql/database.sql20
13 files changed, 316 insertions, 6 deletions
diff --git a/src/main/resources/fxml/CreateOperationController.fxml b/src/main/resources/fxml/CreateOperationController.fxml
new file mode 100644
index 0000000..086a5d1
--- /dev/null
+++ b/src/main/resources/fxml/CreateOperationController.fxml
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<?import javafx.scene.control.Button?>
+<?import javafx.scene.control.Hyperlink?>
+<?import javafx.scene.control.Label?>
+<?import javafx.scene.control.ListView?>
+<?import javafx.scene.control.TextField?>
+<?import javafx.scene.layout.AnchorPane?>
+<?import javafx.scene.text.Font?>
+
+<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="650.0" prefWidth="1200.0" xmlns="http://javafx.com/javafx/9.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.userInterface.CreateOperationController">
+ <children>
+ <AnchorPane layoutX="964.0" layoutY="-66.0" prefHeight="182.0" prefWidth="1200.0" style="-fx-background-color: #2D75B6;" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="0.0" />
+ <AnchorPane fx:id="apCreateOperation" layoutX="40.0" layoutY="71.0" prefHeight="151.0" prefWidth="920.0" style="-fx-background-color: white; -fx-effect: dropshadow(three-pass-box, rgba(0,0,0,0.8), 5, 0, 0, 5);">
+ <children>
+ <Label layoutX="14.0" layoutY="14.0" prefHeight="30.0" prefWidth="62.0" text="Code">
+ <font>
+ <Font size="19.0" />
+ </font>
+ </Label>
+ <Label layoutX="185.0" layoutY="14.0" prefHeight="30.0" prefWidth="94.0" text="Adresse">
+ <font>
+ <Font size="19.0" />
+ </font>
+ </Label>
+ <Label layoutX="587.0" layoutY="14.0" prefHeight="30.0" prefWidth="121.0" text="Anmerkung">
+ <font>
+ <Font size="19.0" />
+ </font>
+ </Label>
+ <TextField fx:id="txtCode" layoutX="14.0" layoutY="48.0" prefHeight="39.0" prefWidth="163.0">
+ <font>
+ <Font name="System Bold" size="20.0" />
+ </font>
+ </TextField>
+ <TextField fx:id="txtAddress" layoutX="185.0" layoutY="48.0" prefHeight="39.0" prefWidth="396.0">
+ <font>
+ <Font name="System Bold" size="20.0" />
+ </font>
+ </TextField>
+ <TextField fx:id="txtNote" layoutX="587.0" layoutY="48.0" prefHeight="39.0" prefWidth="319.0">
+ <font>
+ <Font name="System Bold" size="20.0" />
+ </font>
+ </TextField>
+ <Label layoutX="14.0" layoutY="101.0" prefHeight="30.0" prefWidth="102.0" text="Fahrzeuge:">
+ <font>
+ <Font size="19.0" />
+ </font>
+ </Label>
+ <Label fx:id="lblChosenVehicles" layoutX="116.0" layoutY="102.0" prefHeight="30.0" prefWidth="610.0" text="keine ausgewählt">
+ <font>
+ <Font size="19.0" />
+ </font>
+ </Label>
+ <Button fx:id="btnCreateOperation" layoutX="747.0" layoutY="95.0" mnemonicParsing="false" onAction="#createOperationClicked" prefHeight="0.0" prefWidth="158.0" text="Erstellen">
+ <font>
+ <Font name="System Bold" size="21.0" />
+ </font>
+ </Button>
+ </children>
+ </AnchorPane>
+ <Hyperlink layoutX="44.0" layoutY="38.0" onAction="#onRegistrationLinkClicked" text="Anmeldungen" textFill="WHITE">
+ <font>
+ <Font size="15.0" />
+ </font>
+ </Hyperlink>
+ <Hyperlink layoutX="802.0" layoutY="38.0" onAction="#onEmployeeLinkClicked" text="Personen" textFill="WHITE">
+ <font>
+ <Font size="15.0" />
+ </font>
+ </Hyperlink>
+ <Hyperlink layoutX="877.0" layoutY="38.0" onAction="#onVehicleLinkClicked" text="Fahrzeuge" textFill="WHITE">
+ <font>
+ <Font size="15.0" />
+ </font>
+ </Hyperlink>
+ <AnchorPane fx:id="apActiveOperations" layoutX="968.0" layoutY="71.0" prefHeight="315.0" prefWidth="207.0" style="-fx-background-color: white; -fx-effect: dropshadow(three-pass-box, rgba(0,0,0,0.8), 10, 0, 0, 5);">
+ <children>
+ <ListView fx:id="lvActiveOperations" layoutX="4.0" layoutY="74.0" prefHeight="242.0" prefWidth="200.0" style="-fx-background-color: white;" />
+ <Label layoutX="10.0" layoutY="14.0" prefHeight="46.0" prefWidth="103.0" text="Aktive Einsätze">
+ <font>
+ <Font name="System Bold" size="14.0" />
+ </font>
+ </Label>
+ <Label layoutX="148.0" layoutY="28.0" text="Archiv">
+ <font>
+ <Font size="13.0" />
+ </font>
+ </Label>
+ </children>
+ </AnchorPane>
+ <ListView fx:id="lvVehicles" layoutX="40.0" layoutY="228.0" prefHeight="388.0" prefWidth="920.0" style="-fx-effect: dropshadow(three-pass-box, rgba(0,0,0,0.8), 10, 0, 0, 5);" />
+ </children>
+</AnchorPane>
diff --git a/src/main/resources/fxml/RegistrationWindow.fxml b/src/main/resources/fxml/RegistrationWindow.fxml
new file mode 100644
index 0000000..0394ca7
--- /dev/null
+++ b/src/main/resources/fxml/RegistrationWindow.fxml
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<?import javafx.geometry.Insets?>
+<?import javafx.scene.control.Button?>
+<?import javafx.scene.control.ChoiceBox?>
+<?import javafx.scene.control.Label?>
+<?import javafx.scene.control.SplitPane?>
+<?import javafx.scene.control.TableColumn?>
+<?import javafx.scene.control.TableView?>
+<?import javafx.scene.control.TextField?>
+<?import javafx.scene.layout.AnchorPane?>
+<?import javafx.scene.layout.HBox?>
+<?import javafx.scene.layout.VBox?>
+
+<VBox maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefWidth="600.0" xmlns="http://javafx.com/javafx/9.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.controller.RegistrationWindowController">
+ <children>
+ <AnchorPane prefHeight="135.0" prefWidth="600.0">
+ <children>
+ <Label layoutX="14.0" layoutY="14.0" text="Neue Anmeldung" />
+ <Label layoutX="14.0" layoutY="44.0" text="von" />
+ <Label layoutX="133.0" layoutY="44.0" text="bis" />
+ <ChoiceBox fx:id="cbStart" layoutX="42.0" layoutY="40.0" prefWidth="80.0" />
+ <ChoiceBox fx:id="cbEnd" layoutX="159.0" layoutY="40.0" prefWidth="80.0" />
+ <Label layoutX="10.0" layoutY="82.0" text="Fahrzeug" />
+ <Label fx:id="lVehicles" layoutX="10.0" layoutY="108.0" text="Fahrzeugname" />
+ <Label layoutX="216.0" layoutY="82.0" text="Personen" />
+ <Label fx:id="lEmployees" layoutX="216.0" layoutY="108.0" text="Namen" />
+ </children>
+ </AnchorPane>
+ <SplitPane dividerPositions="0.35" prefWidth="200.0">
+ <items>
+ <VBox prefHeight="200.0" prefWidth="100.0">
+ <children>
+ <Label text="Fahrzeugsuche" />
+ <TextField fx:id="tfVehicleSearch" />
+ <TableView fx:id="tvVehicles" prefHeight="200.0" prefWidth="200.0">
+ <columns>
+ <TableColumn fx:id="tcVehicles" prefWidth="75.0" text="Fahrzeuge" />
+ </columns>
+ <columnResizePolicy>
+ <TableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
+ </columnResizePolicy>
+ </TableView>
+ </children>
+ </VBox>
+ <VBox prefHeight="200.0" prefWidth="100.0">
+ <children>
+ <Label text="Personensuche" />
+ <TextField fx:id="tfEmployeeSearch" />
+ <TableView fx:id="tvEmployees" prefHeight="200.0" prefWidth="200.0">
+ <columns>
+ <TableColumn fx:id="tcEmployees" prefWidth="75.0" text="Personen" />
+ </columns>
+ <columnResizePolicy>
+ <TableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
+ </columnResizePolicy>
+ </TableView>
+ </children>
+ </VBox>
+ </items>
+ </SplitPane>
+ <HBox alignment="CENTER" prefWidth="200.0">
+ <children>
+ <Button mnemonicParsing="false" onAction="#cancel" text="Abbrechen">
+ <HBox.margin>
+ <Insets bottom="8.0" left="8.0" right="8.0" top="8.0" />
+ </HBox.margin>
+ </Button>
+ <Button mnemonicParsing="false" onAction="#create" text="Erstellen">
+ <HBox.margin>
+ <Insets bottom="8.0" left="8.0" right="8.0" top="8.0" />
+ </HBox.margin>
+ </Button>
+ </children></HBox>
+ </children>
+</VBox>
diff --git a/src/main/resources/fxml/createCar.fxml b/src/main/resources/fxml/createCar.fxml
new file mode 100644
index 0000000..b0898da
--- /dev/null
+++ b/src/main/resources/fxml/createCar.fxml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<?import javafx.scene.control.Button?>
+<?import javafx.scene.control.CheckBox?>
+<?import javafx.scene.control.ChoiceBox?>
+<?import javafx.scene.layout.AnchorPane?>
+
+
+<AnchorPane prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/9.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.controller.CreateCarController">
+ <children>
+ <ChoiceBox fx:id="cmb_Ctyp" layoutX="14.0" layoutY="14.0" prefWidth="150.0" />
+ <ChoiceBox fx:id="cmb_typ" layoutX="191.0" layoutY="14.0" prefWidth="150.0" />
+ <Button fx:id="btn_cancel" layoutX="500.0" layoutY="14.0" mnemonicParsing="false" text="abbrechen" />
+ <Button fx:id="btn_create" layoutX="500.0" layoutY="53.0" mnemonicParsing="false" onAction="#createCar" text="Erstellen" />
+ <CheckBox fx:id="cbx_NEF" layoutX="14.0" layoutY="57.0" mnemonicParsing="false" text="NEF - Halterung" />
+ </children>
+</AnchorPane>
diff --git a/src/main/resources/fxml/createNewEmployee.fxml b/src/main/resources/fxml/createNewEmployee.fxml
new file mode 100644
index 0000000..5fa1ca9
--- /dev/null
+++ b/src/main/resources/fxml/createNewEmployee.fxml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<?import javafx.scene.control.Button?>
+<?import javafx.scene.control.CheckBox?>
+<?import javafx.scene.control.ChoiceBox?>
+<?import javafx.scene.control.Hyperlink?>
+<?import javafx.scene.control.Label?>
+<?import javafx.scene.control.TextField?>
+<?import javafx.scene.layout.AnchorPane?>
+
+
+<AnchorPane prefHeight="114.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/9.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.controller.CreateNewEmployeeController">
+ <children>
+ <Label layoutX="14.0" layoutY="14.0" text="Neue Person erstellen" />
+ <Label layoutX="14.0" layoutY="38.0" text="Name" />
+ <Label layoutX="206.0" layoutY="38.0" text="Qualifikation" />
+ <CheckBox fx:id="inputIsDriver" layoutX="343.0" layoutY="37.0" mnemonicParsing="false" text="Fahrer" />
+ <CheckBox fx:id="inputIsPilot" layoutX="343.0" layoutY="62.0" mnemonicParsing="false" text="Pilot" />
+ <Hyperlink fx:id="btnCancel" layoutX="441.0" layoutY="31.0" onAction="#onCancelClicked" text="abbrechen" />
+ <Button fx:id="btnCreate" layoutX="441.0" layoutY="55.0" mnemonicParsing="false" onAction="#onCreateClicked" text="Erstellen" />
+ <TextField fx:id="inputName" layoutX="14.0" layoutY="57.0" prefHeight="25.0" prefWidth="179.0" />
+ <ChoiceBox fx:id="inputQualification" layoutX="199.0" layoutY="57.0" prefHeight="25.0" prefWidth="128.0" />
+ </children>
+</AnchorPane>
diff --git a/src/main/resources/fxml/vehiclePane.fxml b/src/main/resources/fxml/vehiclePane.fxml
new file mode 100644
index 0000000..8b1d194
--- /dev/null
+++ b/src/main/resources/fxml/vehiclePane.fxml
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<?import javafx.geometry.Insets?>
+<?import javafx.scene.image.Image?>
+<?import javafx.scene.image.ImageView?>
+<?import javafx.scene.layout.ColumnConstraints?>
+<?import javafx.scene.layout.GridPane?>
+<?import javafx.scene.layout.RowConstraints?>
+<?import javafx.scene.text.Font?>
+<?import javafx.scene.text.Text?>
+<?import javafx.scene.text.TextFlow?>
+
+<GridPane hgap="6.0" xmlns="http://javafx.com/javafx/9.0.1" xmlns:fx="http://javafx.com/fxml/1"
+ fx:controller="at.ac.tuwien.sepm.assignment.groupphase.einsatzverwaltung.ui.vehiclepane.VehiclePaneController">
+ <columnConstraints>
+ <ColumnConstraints/>
+ <ColumnConstraints/>
+ <ColumnConstraints/>
+ <ColumnConstraints/>
+ </columnConstraints>
+ <rowConstraints>
+ <RowConstraints/>
+ <RowConstraints/>
+ <RowConstraints/>
+ <RowConstraints/>
+ </rowConstraints>
+ <padding>
+ <Insets bottom="6.0" left="6.0" right="6.0" top="6.0"/>
+ </padding>
+ <TextFlow GridPane.columnIndex="0" GridPane.columnSpan="2" GridPane.rowIndex="0">
+ <Text text="RTW" fx:id="txtType">
+ <font>
+ <Font name="System Bold" size="18.0"/>
+ </font>
+ </Text>
+ <Text text="-10003" fx:id="txtNumber">
+ <font>
+ <Font size="16.0"/>
+ </font>
+ </Text>
+ </TextFlow>
+ <ImageView fx:id="ivNEF" fitHeight="25.0" fitWidth="25.0" pickOnBounds="true" preserveRatio="true"
+ GridPane.columnIndex="0" GridPane.rowIndex="1">
+ <Image url="@../images/NotNEF.png"/>
+ </ImageView>
+ <Text fx:id="txtNEF" text="keine NEF-Halterung" GridPane.columnIndex="1" GridPane.rowIndex="1">
+ <font>
+ <Font size="14.0"/>
+ </font>
+ </Text>
+ <ImageView fx:id="ivQualification" fitHeight="25.0" fitWidth="25.0" pickOnBounds="true"
+ preserveRatio="true"
+ GridPane.columnIndex="0" GridPane.rowIndex="2">
+ <Image url="@../images/Qualification.png"/>
+ </ImageView>
+ <Text fx:id="txtQualification" text="Notarzt" GridPane.columnIndex="1" GridPane.rowIndex="2">
+ <font>
+ <Font size="14.0"/>
+ </font>
+ </Text>
+ <ImageView fitHeight="25.0" fitWidth="25.0" pickOnBounds="true" preserveRatio="true"
+ GridPane.columnIndex="0" GridPane.rowIndex="3">
+ <Image url="@../images/Vehicle.png"/>
+ </ImageView>
+ <Text fx:id="txtRooftype" text="Hochdach" GridPane.columnIndex="1" GridPane.rowIndex="3">
+ <font>
+ <Font size="14.0"/>
+ </font>
+ </Text>
+</GridPane>
diff --git a/src/main/resources/images/NEF.png b/src/main/resources/images/NEF.png
new file mode 100644
index 0000000..687f914
--- /dev/null
+++ b/src/main/resources/images/NEF.png
Binary files differ
diff --git a/src/main/resources/images/Not.png b/src/main/resources/images/Not.png
new file mode 100644
index 0000000..03063af
--- /dev/null
+++ b/src/main/resources/images/Not.png
Binary files differ
diff --git a/src/main/resources/images/NotNEF.png b/src/main/resources/images/NotNEF.png
new file mode 100644
index 0000000..0c17d53
--- /dev/null
+++ b/src/main/resources/images/NotNEF.png
Binary files differ
diff --git a/src/main/resources/images/Qualification.png b/src/main/resources/images/Qualification.png
new file mode 100644
index 0000000..c58a640
--- /dev/null
+++ b/src/main/resources/images/Qualification.png
Binary files differ
diff --git a/src/main/resources/images/Vehicle.png b/src/main/resources/images/Vehicle.png
new file mode 100644
index 0000000..2fe992d
--- /dev/null
+++ b/src/main/resources/images/Vehicle.png
Binary files differ
diff --git a/src/main/resources/sql/H2RegistrationDAOTest_depopulate.sql b/src/main/resources/sql/H2RegistrationDAOTest_depopulate.sql
new file mode 100644
index 0000000..f43b641
--- /dev/null
+++ b/src/main/resources/sql/H2RegistrationDAOTest_depopulate.sql
@@ -0,0 +1,5 @@
+DELETE FROM Registration;
+DELETE FROM Vehicle;
+DELETE FROM VehicleVersion;
+DELETE FROM Employee;
+DELETE FROM EmployeeVersion; \ No newline at end of file
diff --git a/src/main/resources/sql/H2RegistrationDAOTest_populate.sql b/src/main/resources/sql/H2RegistrationDAOTest_populate.sql
new file mode 100644
index 0000000..7e7b428
--- /dev/null
+++ b/src/main/resources/sql/H2RegistrationDAOTest_populate.sql
@@ -0,0 +1,15 @@
+DELETE FROM Registration;
+DELETE FROM Vehicle;
+DELETE FROM VehicleVersion;
+DELETE FROM Employee;
+DELETE FROM EmployeeVersion;
+INSERT INTO EmployeeVersion (id, name, birthday, educationLevel, isDriver, isPilot) VALUES (1, 'John Doe', '2000-01-01', 'RS', TRUE, TRUE);
+INSERT INTO EmployeeVersion (id, name, birthday, educationLevel, isDriver, isPilot) VALUES (2, 'Nick "Kage" Verily', '1990-01-01', 'NKV', TRUE, FALSE);
+INSERT INTO EmployeeVersion (id, name, birthday, educationLevel, isDriver, isPilot) VALUES (3, 'Nicht Arzt', '1980-01-01', 'NA', FALSE, FALSE);
+INSERT INTO Employee (id, version) VALUES (1, 1);
+INSERT INTO Employee (id, version) VALUES (2, 2);
+INSERT INTO Employee (id, version) VALUES (3, 3);
+INSERT INTO VehicleVersion (id, name, hasNef, constructionType, type) VALUES (1, 'RTW-1', TRUE, 'HOCHDACH', 'RTW');
+INSERT INTO VehicleVersion (id, name, hasNef, constructionType, type) VALUES (2, 'NEF-1', FALSE, 'NORMAL', 'NEF');
+INSERT INTO Vehicle (id, version, status) VALUES (1, 1, 'ABGEMELDET');
+INSERT INTO Vehicle (id, version, status) VALUES (2, 2, 'ABGEMELDET'); \ No newline at end of file
diff --git a/src/main/resources/sql/database.sql b/src/main/resources/sql/database.sql
index 9d1b0e1..4f3adf7 100644
--- a/src/main/resources/sql/database.sql
+++ b/src/main/resources/sql/database.sql
@@ -1,25 +1,30 @@
CREATE TABLE IF NOT EXISTS VehicleVersion (
id BIGINT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(100) NOT NULL,
- constructionType ENUM('Normal', 'Hochdach', 'Mittelhochdach') NOT NULL,
- type ENUM('BKTW', 'KTW-B', 'KTW', 'RTW', 'NEF', 'NAH') NOT NULL,
+ constructionType VARCHAR NOT NULL,
+ type VARCHAR NOT NULL,
+ hasNef BOOLEAN NOT NULL,
+ CHECK constructionType IN ('NORMAL', 'HOCHDACH', 'MITTELHOCHDACH'),
+ CHECK type IN ('BKTW', 'KTW-B', 'KTW', 'RTW', 'NEF', 'NAH')
);
CREATE TABLE IF NOT EXISTS Vehicle (
id BIGINT AUTO_INCREMENT PRIMARY KEY,
version BIGINT NOT NULL,
- status ENUM('abgemeldet', 'frei_wache', 'zum_berufungsort', 'am_berufungsort', 'zum_zielort',
- 'am_zielort', 'frei_funk', 'deleted') 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')
);
CREATE TABLE IF NOT EXISTS EmployeeVersion (
id BIGINT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(100) NOT NULL,
birthday DATE NOT NULL,
- educationLevel ENUM('RS', 'NFS', 'NKV', 'NKA', 'NKI', 'NA') NOT NULL,
+ educationLevel VARCHAR NOT NULL,
isDriver BOOLEAN NOT NULL,
isPilot BOOLEAN NOT NULL,
+ CHECK educationLevel IN ('RS', 'NFS', 'NKV', 'NKA', 'NKI', 'NA')
);
CREATE TABLE IF NOT EXISTS Employee (
@@ -42,10 +47,13 @@ CREATE TABLE IF NOT EXISTS Registration (
CREATE TABLE IF NOT EXISTS Operation (
id BIGINT AUTO_INCREMENT PRIMARY KEY,
opCode VARCHAR(20) NOT NULL,
- severity ENUM('A', 'B', 'C', 'D', 'E', 'O') NOT NULL,
+ severity VARCHAR NOT NULL,
created TIMESTAMP NOT NULL,
destination VARCHAR(100) NOT NULL,
additionalInfo VARCHAR(100),
+ 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 (