From 64694e1d34e7823dc39201efca5789fdbbb322c6 Mon Sep 17 00:00:00 2001 From: Florian Meissner Date: Fri, 25 Aug 2023 18:13:19 +0200 Subject: [PATCH] Added tables --- eaMain.dia | Bin 5567 -> 6443 bytes init/02-ddl/01-mysql_user.sql | 4 ++ init/02-ddl/02-eaMain_database.sql | 2 + init/02-ddl/10-airports.sql | 55 +++++++++++++++++++++++++ init/02-ddl/10-users.sql | 45 ++++++++++++++++++++ init/02-ddl/20-airportComments.sql | 48 ++++++++++++++++++++++ init/02-ddl/20-airportFrequencies.sql | 45 ++++++++++++++++++++ init/02-ddl/20-airportPhones.sql | 46 +++++++++++++++++++++ init/02-ddl/20-airportWebsites.sql | 41 ++++++++++++++++++ init/02-ddl/20-amenities.sql | 52 +++++++++++++++++++++++ init/02-ddl/20-fuel.sql | 47 +++++++++++++++++++++ init/02-ddl/20-runways.sql | 57 ++++++++++++++++++++++++++ init/02-ddl/30-photos.sql | 48 ++++++++++++++++++++++ 13 files changed, 490 insertions(+) create mode 100644 init/02-ddl/10-airports.sql create mode 100644 init/02-ddl/10-users.sql create mode 100644 init/02-ddl/20-airportComments.sql create mode 100644 init/02-ddl/20-airportFrequencies.sql create mode 100644 init/02-ddl/20-airportPhones.sql create mode 100644 init/02-ddl/20-airportWebsites.sql create mode 100644 init/02-ddl/20-amenities.sql create mode 100644 init/02-ddl/20-fuel.sql create mode 100644 init/02-ddl/20-runways.sql create mode 100644 init/02-ddl/30-photos.sql diff --git a/eaMain.dia b/eaMain.dia index c2e681079dacb91dede8db588c8cb500d18673d0..044d846478af87dabe84289d0fa3b4d95659208b 100644 GIT binary patch literal 6443 zcmV+`8Pw(QPro?Q zC;@c|iI#+YJP-3Q-!oq|Uotxdb{Q}iBajPfI|ADhsoYX3SLV*lwRZmHuYZgJ^1$N6 zkHRl!iX@*A7WN{~4+me)x}C3|?X$oBF8syw>7U^e$-n+CBHapQh2C9$fCDYuW4wU4gRp z-($&!$~>QDMNY$6vWrdSzL+j&(Rh9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8W;Xock4psJqfKB%fGM!~c$RZ~%|QXEd+G7Hw>!`IeLjYXNY;1(d-H0^GQHCOUu zGf%Qxv5?KU3ym~hk|n_)KI;(d2$wT5kF5uiZ6P?}fe-(;;{V}-_D53t+h2rqCamuc z+&-Ckz)P*$IOP`Q-=&xJtTVs)AyIk}TXKB45p{F|uTt^Gh)D$LwYAM?| z+-gY#;Vu~nx4u}~3T z?+jnvcCUJT{wIMS(SFnbv6DZQr7|lki2}kIw4N{`vt6+#GT^}&CtheJ=7+e}DDd-# zoQ{Y?#Qma(tApu?V;mw55tkR@dK>|VfI~NDbaO^GXLNH$H|Jw=bKb$>M@vd@SM_WO z?jrr-+~vnobiJ&~nx>SF!sW+)=4(q8LMn7TfxA+Nkj^N0WL&x-oO;J z^rbc-Z7@LSlv6*F{s3W*G4UYzV@i1hk2TSWCnqPKrM8V;Jn!3!XHzH#O+SiLd&+8A zlhv{~w#UR%dlp2X_uqDGkEJh3VK93P;($RMFo**NaljxBIUn1jsXz1B9?dw4V|!-i zj;^S&xf37Tqp3$8yDGJVd!QzY+YO#YDKvP{;6Z~24IVUj(BR4Y^qyslM^p2PT4g3S zc3`y4(9(hA3t;Q$Wlg^ + +-- This program is free software: you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software Foundation, either +-- version 3 of the License, or (at your option) any later version. This program is distributed in the +-- hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. You should have received a copy of the GNU General Public License along with this program. +-- (license.md in the root folder of this project) If not, see . + + +USE eaMain; + +START TRANSACTION; + +CREATE TABLE IF NOT EXISTS `airports` ( + `id` INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, + `icao` CHAR(4) UNIQUE, + `ident` VARCHAR(6) NOT NULL UNIQUE COMMENT 'Local identifier', + `iata` CHAR(3), + `name` VARCHAR(100) NOT NULL, + `type` ENUM('B', 'G', 'H', 'I', 'N', 'U') NOT NULL, + `lat` DECIMAL(7, 2) NOT NULL COMMENT 'degrees', + `lon` DECIMAL(8, 2) NOT NULL COMMENT 'degrees', + `continent` ENUM('AF', 'AN', 'AS', 'CA', 'EU', 'NA', 'OC', 'SA') DEFAULT 'EU' NOT NULL, + `country` CHAR(2) DEFAULT 'ZZ' NOT NULL COMMENT 'ISO 3166-1 alpha-2 identifier', + `region` CHAR(5) COMMENT 'ISO 3166-2 identifier', + `city` VARCHAR(100), + CONSTRAINT `airports.hasIdent` CHECK ( + NOT ( + `icao` IS NULL + AND `ident` IS NULL + AND `iata` IS NULL + ) + ) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +COMMIT; diff --git a/init/02-ddl/10-users.sql b/init/02-ddl/10-users.sql new file mode 100644 index 0000000..7b1a16a --- /dev/null +++ b/init/02-ddl/10-users.sql @@ -0,0 +1,45 @@ +-- **************************************************************************************************** +-- * ______ _ _ * +-- * | ____| /\ (_) | | * +-- * | |__ _ _ _ __ ___ _ __ ___ __ _ _ __ / \ _ _ __ _ __ ___ _ __| |_ ___ * +-- * | __|| | | | '__/ _ \| '_ \ / _ \/ _` | '_ \ / /\ \ | | '__| '_ \ / _ \| '__| __/ __| * +-- * | |___| |_| | | | (_) | |_) | __/ (_| | | | | / ____ \| | | | |_) | (_) | | | |_\__ \ * +-- * |______\__,_|_| \___/| .__/ \___|\__,_|_| |_| /_/ \_\_|_| | .__/ \___/|_| \__|___/ * +-- * | | | | * +-- * |_| |_| * +-- * * +-- **************************************************************************************************** + +-- This file is part of the European Airports Project, a free, collaborative platform of airport data +-- extending beyond the official AIPs. + +-- Copyright (C) 2023 + +-- Florian Meissner + +-- This program is free software: you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software Foundation, either +-- version 3 of the License, or (at your option) any later version. This program is distributed in the +-- hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. You should have received a copy of the GNU General Public License along with this program. +-- (license.md in the root folder of this project) If not, see . + + +USE eaMain; + +START TRANSACTION; + +CREATE TABLE IF NOT EXISTS `users` ( + `id` INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, + `username` VARCHAR(30) NOT NULL UNIQUE, + `email` VARCHAR(100) NOT NULL UNIQUE, + `firstName` VARCHAR(100), + `lastName` VARCHAR(100), + `password` CHAR(64) NOT NULL COMMENT 'sha512', + `salt` UUID NOT NULL DEFAULT SYS_GUID(), + `active` BOOLEAN DEFAULT TRUE, + `sysUser` BOOLEAN DEFAULT FALSE, +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='User data; Avatars saved on disk as .jpg'; + +COMMIT; diff --git a/init/02-ddl/20-airportComments.sql b/init/02-ddl/20-airportComments.sql new file mode 100644 index 0000000..bc2b2e5 --- /dev/null +++ b/init/02-ddl/20-airportComments.sql @@ -0,0 +1,48 @@ +-- **************************************************************************************************** +-- * ______ _ _ * +-- * | ____| /\ (_) | | * +-- * | |__ _ _ _ __ ___ _ __ ___ __ _ _ __ / \ _ _ __ _ __ ___ _ __| |_ ___ * +-- * | __|| | | | '__/ _ \| '_ \ / _ \/ _` | '_ \ / /\ \ | | '__| '_ \ / _ \| '__| __/ __| * +-- * | |___| |_| | | | (_) | |_) | __/ (_| | | | | / ____ \| | | | |_) | (_) | | | |_\__ \ * +-- * |______\__,_|_| \___/| .__/ \___|\__,_|_| |_| /_/ \_\_|_| | .__/ \___/|_| \__|___/ * +-- * | | | | * +-- * |_| |_| * +-- * * +-- **************************************************************************************************** + +-- This file is part of the European Airports Project, a free, collaborative platform of airport data +-- extending beyond the official AIPs. + +-- Copyright (C) 2023 + +-- Florian Meissner + +-- This program is free software: you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software Foundation, either +-- version 3 of the License, or (at your option) any later version. This program is distributed in the +-- hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. You should have received a copy of the GNU General Public License along with this program. +-- (license.md in the root folder of this project) If not, see . + + +USE eaMain; + +START TRANSACTION; + +CREATE TABLE IF NOT EXISTS `airportComments` ( + `id` INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, + `author` INT UNSIGNED NOT NULL, + `airport` INT UNSIGNED NOT NULL, + `createdAt` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP(), + `changedAt` TIMESTAMP ON UPDATE CURRENT_TIMESTAMP , + `title` VARCHAR(200), + `message` TEXT NOT NULL, + `hidden` BOOLEAN NOT NULL DEFAULT FALSE, + `ref` INT UNSIGNED COMMENT 'reference to a previous comment', + CONSTRAINT `airportComments.fk_author` FOREIGN KEY (`author`) REFERENCES users(id), + CONSTRAINT `airportComments.fk_airport` FOREIGN KEY (`airport`) REFERENCES airports(id), + CONSTRAINT `airportComments.fk_ref` FOREIGN KEY (`ref`) REFERENCES airportComments(id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +COMMIT; diff --git a/init/02-ddl/20-airportFrequencies.sql b/init/02-ddl/20-airportFrequencies.sql new file mode 100644 index 0000000..ce99638 --- /dev/null +++ b/init/02-ddl/20-airportFrequencies.sql @@ -0,0 +1,45 @@ +-- **************************************************************************************************** +-- * ______ _ _ * +-- * | ____| /\ (_) | | * +-- * | |__ _ _ _ __ ___ _ __ ___ __ _ _ __ / \ _ _ __ _ __ ___ _ __| |_ ___ * +-- * | __|| | | | '__/ _ \| '_ \ / _ \/ _` | '_ \ / /\ \ | | '__| '_ \ / _ \| '__| __/ __| * +-- * | |___| |_| | | | (_) | |_) | __/ (_| | | | | / ____ \| | | | |_) | (_) | | | |_\__ \ * +-- * |______\__,_|_| \___/| .__/ \___|\__,_|_| |_| /_/ \_\_|_| | .__/ \___/|_| \__|___/ * +-- * | | | | * +-- * |_| |_| * +-- * * +-- **************************************************************************************************** + +-- This file is part of the European Airports Project, a free, collaborative platform of airport data +-- extending beyond the official AIPs. + +-- Copyright (C) 2023 + +-- Florian Meissner + +-- This program is free software: you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software Foundation, either +-- version 3 of the License, or (at your option) any later version. This program is distributed in the +-- hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. You should have received a copy of the GNU General Public License along with this program. +-- (license.md in the root folder of this project) If not, see . + + +USE eaMain; + +START TRANSACTION; + +CREATE TABLE IF NOT EXISTS `airportFrequencies` ( + `id` INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, + `airport` INT UNSIGNED NOT NULL, + `type` ENUM( + 'A/A', 'A/G', 'AFIS', 'APP', 'ATIS', 'CNTR', 'CTAF', 'DEL', 'DEP', 'DIR', 'FIS', + 'GND', 'MISC', 'PRE', 'UNIC', 'TWR') + NOT NULL DEFAULT 'MISC', + `callsign` VARCHAR(30) NOT NULL, + `frequency` DECIMAL(6, 3) NOT NULL COMMENT 'MHz', + CONSTRAINT `airportFrequencies.fk_airport` FOREIGN KEY (`airport`) REFERENCES airports(id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +COMMIT; diff --git a/init/02-ddl/20-airportPhones.sql b/init/02-ddl/20-airportPhones.sql new file mode 100644 index 0000000..cf87418 --- /dev/null +++ b/init/02-ddl/20-airportPhones.sql @@ -0,0 +1,46 @@ +-- **************************************************************************************************** +-- * ______ _ _ * +-- * | ____| /\ (_) | | * +-- * | |__ _ _ _ __ ___ _ __ ___ __ _ _ __ / \ _ _ __ _ __ ___ _ __| |_ ___ * +-- * | __|| | | | '__/ _ \| '_ \ / _ \/ _` | '_ \ / /\ \ | | '__| '_ \ / _ \| '__| __/ __| * +-- * | |___| |_| | | | (_) | |_) | __/ (_| | | | | / ____ \| | | | |_) | (_) | | | |_\__ \ * +-- * |______\__,_|_| \___/| .__/ \___|\__,_|_| |_| /_/ \_\_|_| | .__/ \___/|_| \__|___/ * +-- * | | | | * +-- * |_| |_| * +-- * * +-- **************************************************************************************************** + +-- This file is part of the European Airports Project, a free, collaborative platform of airport data +-- extending beyond the official AIPs. + +-- Copyright (C) 2023 + +-- Florian Meissner + +-- This program is free software: you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software Foundation, either +-- version 3 of the License, or (at your option) any later version. This program is distributed in the +-- hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. You should have received a copy of the GNU General Public License along with this program. +-- (license.md in the root folder of this project) If not, see . + + +USE eaMain; + +START TRANSACTION; + +CREATE TABLE IF NOT EXISTS `airportPhones` ( + `id` INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, + `airport` INT UNSIGNED NOT NULL, + `phoneNumber` VARCHAR(30) NOT NULL, + `type` ENUM('OPS', 'PPR', 'OPR', 'CUST', 'FUEL', 'CLUB', 'OTH') NOT NULL DEFAULT 'OTH', + `reportedBy` INT UNSIGNED NOT NULL, + `reportedAt` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP(), + `active` BOOLEAN NOT NULL DEFAULT TRUE, + `description` TEXT, + CONSTRAINT `airportPhones.fk_airport` FOREIGN KEY (`airport`) REFERENCES airports(id) + CONSTRAINT `airportPhones.fk_reportedBy` FOREIGN KEY (`reportedBy`) REFERENCES users(id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +COMMIT; diff --git a/init/02-ddl/20-airportWebsites.sql b/init/02-ddl/20-airportWebsites.sql new file mode 100644 index 0000000..04ef17a --- /dev/null +++ b/init/02-ddl/20-airportWebsites.sql @@ -0,0 +1,41 @@ +-- **************************************************************************************************** +-- * ______ _ _ * +-- * | ____| /\ (_) | | * +-- * | |__ _ _ _ __ ___ _ __ ___ __ _ _ __ / \ _ _ __ _ __ ___ _ __| |_ ___ * +-- * | __|| | | | '__/ _ \| '_ \ / _ \/ _` | '_ \ / /\ \ | | '__| '_ \ / _ \| '__| __/ __| * +-- * | |___| |_| | | | (_) | |_) | __/ (_| | | | | / ____ \| | | | |_) | (_) | | | |_\__ \ * +-- * |______\__,_|_| \___/| .__/ \___|\__,_|_| |_| /_/ \_\_|_| | .__/ \___/|_| \__|___/ * +-- * | | | | * +-- * |_| |_| * +-- * * +-- **************************************************************************************************** + +-- This file is part of the European Airports Project, a free, collaborative platform of airport data +-- extending beyond the official AIPs. + +-- Copyright (C) 2023 + +-- Florian Meissner + +-- This program is free software: you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software Foundation, either +-- version 3 of the License, or (at your option) any later version. This program is distributed in the +-- hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. You should have received a copy of the GNU General Public License along with this program. +-- (license.md in the root folder of this project) If not, see . + + +USE eaMain; + +START TRANSACTION; + +CREATE TABLE IF NOT EXISTS `airportWebsites` ( + `id` INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, + `airport` INT UNSIGNED NOT NULL, + `url` VARCHAR(255) NOT NULL, + `title` VARCHAR(255), + CONSTRAINT `airportWebsites.fk_airport` FOREIGN KEY (`airport`) REFERENCES airports(id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +COMMIT; diff --git a/init/02-ddl/20-amenities.sql b/init/02-ddl/20-amenities.sql new file mode 100644 index 0000000..bf9ed93 --- /dev/null +++ b/init/02-ddl/20-amenities.sql @@ -0,0 +1,52 @@ +-- **************************************************************************************************** +-- * ______ _ _ * +-- * | ____| /\ (_) | | * +-- * | |__ _ _ _ __ ___ _ __ ___ __ _ _ __ / \ _ _ __ _ __ ___ _ __| |_ ___ * +-- * | __|| | | | '__/ _ \| '_ \ / _ \/ _` | '_ \ / /\ \ | | '__| '_ \ / _ \| '__| __/ __| * +-- * | |___| |_| | | | (_) | |_) | __/ (_| | | | | / ____ \| | | | |_) | (_) | | | |_\__ \ * +-- * |______\__,_|_| \___/| .__/ \___|\__,_|_| |_| /_/ \_\_|_| | .__/ \___/|_| \__|___/ * +-- * | | | | * +-- * |_| |_| * +-- * * +-- **************************************************************************************************** + +-- This file is part of the European Airports Project, a free, collaborative platform of airport data +-- extending beyond the official AIPs. + +-- Copyright (C) 2023 + +-- Florian Meissner + +-- This program is free software: you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software Foundation, either +-- version 3 of the License, or (at your option) any later version. This program is distributed in the +-- hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. You should have received a copy of the GNU General Public License along with this program. +-- (license.md in the root folder of this project) If not, see . + + +USE eaMain; + +START TRANSACTION; + +CREATE TABLE IF NOT EXISTS `amenities` ( + `id` INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, + `airport` INT UNSIGNED NOT NULL, + `type` ENUM('CAMP', 'HANG', 'SQ', 'REST', 'SH', 'TIE', 'OTH', 'CUST', 'IM', 'WC') + NOT NULL DEFAULT 'OTH', + `price` DECIMAL(6, 2), + `reportedBy` INT UNSIGNED NOT NULL, + `reportedAt` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP(), + `available` BOOLEAN NOT NULL DEFAULT TRUE, + `contactName` VARCHAR(100), + `contactPhone` VARCHAR(30), + `contactMail` VARCHAR(100), + `contactUrl` VARCHAR(100), + `description` TEXT, + `priorNotice` VARCHAR(20), + CONSTRAINT `amenities.fk_reportedBy` FOREIGN KEY (`reportedBy`) REFERENCES users(id), + CONSTRAINT `amenities.fk_airport` FOREIGN KEY (`airport`) REFERENCES airports(id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +COMMIT; diff --git a/init/02-ddl/20-fuel.sql b/init/02-ddl/20-fuel.sql new file mode 100644 index 0000000..628ba60 --- /dev/null +++ b/init/02-ddl/20-fuel.sql @@ -0,0 +1,47 @@ +-- **************************************************************************************************** +-- * ______ _ _ * +-- * | ____| /\ (_) | | * +-- * | |__ _ _ _ __ ___ _ __ ___ __ _ _ __ / \ _ _ __ _ __ ___ _ __| |_ ___ * +-- * | __|| | | | '__/ _ \| '_ \ / _ \/ _` | '_ \ / /\ \ | | '__| '_ \ / _ \| '__| __/ __| * +-- * | |___| |_| | | | (_) | |_) | __/ (_| | | | | / ____ \| | | | |_) | (_) | | | |_\__ \ * +-- * |______\__,_|_| \___/| .__/ \___|\__,_|_| |_| /_/ \_\_|_| | .__/ \___/|_| \__|___/ * +-- * | | | | * +-- * |_| |_| * +-- * * +-- **************************************************************************************************** + +-- This file is part of the European Airports Project, a free, collaborative platform of airport data +-- extending beyond the official AIPs. + +-- Copyright (C) 2023 + +-- Florian Meissner + +-- This program is free software: you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software Foundation, either +-- version 3 of the License, or (at your option) any later version. This program is distributed in the +-- hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. You should have received a copy of the GNU General Public License along with this program. +-- (license.md in the root folder of this project) If not, see . + + +USE eaMain; + +START TRANSACTION; + +CREATE TABLE IF NOT EXISTS `fuel` ( + `id` INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, + `airport` INT UNSIGNED NOT NULL, + `type` ENUM('A1', '100LL', 'UL91', 'DIESEL', 'MOGAS', 'OTH') NOT NULL DEFAULT 'OTH', + `price` DECIMAL(4, 2) NOT NULL COMMENT '€/L', + `priceDate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP(), + `priceSource` ENUM('EDDH', 'SkyDemon', 'ForeFlight', 'AeroPS', 'AirBP', 'Total', 'User') NOT NULL, + `reportedBy` INT UNSIGNED, + `paymentOptions` ENUM('AirBP', 'Total', 'Cash', 'Debit', 'Credit', 'Swish', 'Other'), + `paymentOptionsOther` VARCHAR(50), + CONSTRAINT `fuel.fk_airport` FOREIGN KEY (`airport`) REFERENCES airports(id) + CONSTRAINT `fuel.fk_reportedBy` FOREIGN KEY (`reportedBy`) REFERENCES users(id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +COMMIT; diff --git a/init/02-ddl/20-runways.sql b/init/02-ddl/20-runways.sql new file mode 100644 index 0000000..58cb619 --- /dev/null +++ b/init/02-ddl/20-runways.sql @@ -0,0 +1,57 @@ +-- **************************************************************************************************** +-- * ______ _ _ * +-- * | ____| /\ (_) | | * +-- * | |__ _ _ _ __ ___ _ __ ___ __ _ _ __ / \ _ _ __ _ __ ___ _ __| |_ ___ * +-- * | __|| | | | '__/ _ \| '_ \ / _ \/ _` | '_ \ / /\ \ | | '__| '_ \ / _ \| '__| __/ __| * +-- * | |___| |_| | | | (_) | |_) | __/ (_| | | | | / ____ \| | | | |_) | (_) | | | |_\__ \ * +-- * |______\__,_|_| \___/| .__/ \___|\__,_|_| |_| /_/ \_\_|_| | .__/ \___/|_| \__|___/ * +-- * | | | | * +-- * |_| |_| * +-- * * +-- **************************************************************************************************** + +-- This file is part of the European Airports Project, a free, collaborative platform of airport data +-- extending beyond the official AIPs. + +-- Copyright (C) 2023 + +-- Florian Meissner + +-- This program is free software: you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software Foundation, either +-- version 3 of the License, or (at your option) any later version. This program is distributed in the +-- hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. You should have received a copy of the GNU General Public License along with this program. +-- (license.md in the root folder of this project) If not, see . + + +USE eaMain; + +START TRANSACTION; + +CREATE TABLE IF NOT EXISTS `runways` ( + `id` INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, + `airport` INT UNSIGNED NOT NULL, + `length` MEDIUMINT UNSIGNED NOT NULL COMMENT 'meters', + `width` SMALLINT UNSIGNED NOT NULL COMMENT 'meters', + `surface` ENUM('ASP', 'BIT', 'BRI', 'CLA', 'COM', 'CON', 'COP', 'COR', 'GRE', 'GRS', 'GVL', + 'ICE', 'LAT', 'MAC', 'PEM', 'PER', 'PSP', 'SAN', 'SMT', 'SNO', 'U', 'WAT') NOT NULL DEFAULT 'U', + `lighted` BOOLEAN NOT NULL DEFAULT FALSE, + `closed` BOOLEAN NOT NULL DEFAULT FALSE, + `leIdent` VARCHAR(3) NOT NULL COMMENT 'runway designator', + `leLat` DECIMAL(7, 2) NOT NULL COMMENT 'degrees', + `leLon` DECIMAL(8, 2) NOT NULL COMMENT 'degrees', + `leElev` FLOAT(7, 3) NOT NULL COMMENT 'meters', + `leHdg` MEDIUMINT UNSIGNED NOT NULL COMMENT 'degrees', + `leDisplThres` MEDIUMINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'meters', + `heIdent` VARCHAR(3) NOT NULL COMMENT 'runway designator', + `heLat` DECIMAL(7, 2) NOT NULL COMMENT 'degrees', + `heLon` DECIMAL(8, 2) NOT NULL COMMENT 'degrees', + `heElev` FLOAT(7, 3) NOT NULL COMMENT 'meters', + `heHdg` MEDIUMINT UNSIGNED NOT NULL COMMENT 'degrees', + `heDisplThres` MEDIUMINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'meters', + CONSTRAINT `runways.fk_airport` FOREIGN KEY (`airport`) REFERENCES airports(id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='le=low end; he=high end'; + +COMMIT; diff --git a/init/02-ddl/30-photos.sql b/init/02-ddl/30-photos.sql new file mode 100644 index 0000000..71d65f3 --- /dev/null +++ b/init/02-ddl/30-photos.sql @@ -0,0 +1,48 @@ +-- **************************************************************************************************** +-- * ______ _ _ * +-- * | ____| /\ (_) | | * +-- * | |__ _ _ _ __ ___ _ __ ___ __ _ _ __ / \ _ _ __ _ __ ___ _ __| |_ ___ * +-- * | __|| | | | '__/ _ \| '_ \ / _ \/ _` | '_ \ / /\ \ | | '__| '_ \ / _ \| '__| __/ __| * +-- * | |___| |_| | | | (_) | |_) | __/ (_| | | | | / ____ \| | | | |_) | (_) | | | |_\__ \ * +-- * |______\__,_|_| \___/| .__/ \___|\__,_|_| |_| /_/ \_\_|_| | .__/ \___/|_| \__|___/ * +-- * | | | | * +-- * |_| |_| * +-- * * +-- **************************************************************************************************** + +-- This file is part of the European Airports Project, a free, collaborative platform of airport data +-- extending beyond the official AIPs. + +-- Copyright (C) 2023 + +-- Florian Meissner + +-- This program is free software: you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software Foundation, either +-- version 3 of the License, or (at your option) any later version. This program is distributed in the +-- hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. You should have received a copy of the GNU General Public License along with this program. +-- (license.md in the root folder of this project) If not, see . + + +USE eaMain; + +START TRANSACTION; + +CREATE TABLE IF NOT EXISTS `photos` ( + `id` INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, + `airport` INT UNSIGNED NOT NULL, + `uploadedBy` INT UNSIGNED NOT NULL, + `uploadedAt` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP(), + `title` VARCHAR(200), + `description` TEXT NOT NULL, + `runway` INT UNSIGNED, + `category` BIT(8) NOT NULL DEFAULT 0b00000000, + `hidden` BOOLEAN NOT NULL DEFAULT FALSE, + CONSTRAINT `photos.fk_uploadedBy` FOREIGN KEY (`uploadedBy`) REFERENCES users(id), + CONSTRAINT `photos.fk_airport` FOREIGN KEY (`airport`) REFERENCES airports(id), + CONSTRAINT `photos.fk_runway` FOREIGN KEY (`runway`) REFERENCES runways(id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +COMMIT;