Tabellen mit Infos von Christin aktualisiert

This commit is contained in:
Daniel Schick 2023-03-25 19:33:49 +01:00
parent f929ca338f
commit 205ab2e9f1
2 changed files with 53 additions and 25 deletions

View File

@ -16,22 +16,36 @@ CREATE TABLE `ship` (
`name` varchar(45) DEFAULT NULL, `name` varchar(45) DEFAULT NULL,
`imo` int(11) DEFAULT NULL, `imo` int(11) DEFAULT NULL,
`callsign` varchar(8) DEFAULT NULL, `callsign` varchar(8) DEFAULT NULL,
`length` FLOAT NULL DEFAULT NULL,
`width` FLOAT NULL DEFAULT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `shipcall` ( CREATE TABLE `shipcall` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT, `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`ship_id` int(11) DEFAULT NULL, `ship_id` INT(11) NULL DEFAULT NULL,
`arrival_berth_id` int(11) DEFAULT NULL, `type` TINYINT(4) NULL DEFAULT NULL,
`departure_berth_id` int(11) DEFAULT NULL, `eta` DATETIME NULL DEFAULT NULL,
`type` tinyint(4) DEFAULT NULL, `voyage` VARCHAR(16) NULL DEFAULT NULL,
`eta` datetime DEFAULT NULL, `etd` DATETIME NULL DEFAULT NULL,
`voyage` varchar(16) DEFAULT NULL, `arrival_berth_id` INT(10) NULL DEFAULT NULL,
`etd` datetime DEFAULT NULL, `departure_berth_id` INT(10) NULL DEFAULT NULL,
`tug_required` BIT(1) NULL DEFAULT NULL,
`pilot_required` BIT(1) NULL DEFAULT NULL,
`flags` INT(10) UNSIGNED NULL DEFAULT 0,
`pier_side` BIT(1) NULL DEFAULT NULL,
`bunkering` BIT(1) NULL DEFAULT NULL,
`replenishing` BIT(1) NULL DEFAULT NULL,
`draft` FLOAT NULL DEFAULT NULL,
`tidal_window_from` DATETIME NULL DEFAULT NULL,
`tidal_window_tp` DATETIME NULL DEFAULT NULL,
`rain_sensitive_cargo` BIT(1) NULL DEFAULT b'0',
`recommended_tugs` INT(11) NULL DEFAULT 0,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Incoming, outgoing or moving to another berth '; )
COMMENT='Incoming, outgoing or moving to another berth'
ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `times` ( CREATE TABLE `times` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT, `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
@ -60,22 +74,27 @@ CREATE TABLE `user` (
CREATE TABLE `participant` ( CREATE TABLE `participant` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT, `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` varchar(128) DEFAULT NULL, `name` VARCHAR(128) NULL DEFAULT NULL,
`street` varchar(128) DEFAULT NULL, `street` VARCHAR(128) NULL DEFAULT NULL,
`postal_code` varchar(5) DEFAULT NULL, `postal_code` VARCHAR(5) NULL DEFAULT NULL,
`city` varchar(64) DEFAULT NULL, `city` VARCHAR(64) NULL DEFAULT NULL,
`flags` int(10) unsigned DEFAULT NULL, `roles` INT(10) UNSIGNED NULL DEFAULT 0 COMMENT 'Bitarray of assigned roles',
`flags` INT(10) UNSIGNED NULL DEFAULT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='An organization taking part'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='An organization taking part';
CREATE TABLE `berth` ( CREATE TABLE `berth` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT, `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`name1` varchar(128) DEFAULT NULL, `name` VARCHAR(128) NULL DEFAULT NULL COMMENT 'Descriptive name',
`name2` varchar(128) DEFAULT NULL, `participant_id` INT(10) UNSIGNED NULL DEFAULT NULL COMMENT 'If berth belongs to a participant, reference it here',
`lock` BIT(1) NULL DEFAULT NULL COMMENT 'The lock must be used',
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Place of ship for a ship call'; )
COMMENT='Berth of ship for a ship call'
ENGINE=InnoDB DEFAULT CHARSET=utf8mb4
;
CREATE TABLE `shipcall_participant_map` ( CREATE TABLE `shipcall_participant_map` (
@ -84,3 +103,14 @@ CREATE TABLE `shipcall_participant_map` (
`participant_id` int(10) unsigned DEFAULT NULL, `participant_id` int(10) unsigned DEFAULT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Associates a participant with a shipcall'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='Associates a participant with a shipcall';
CREATE TABLE `shipcall_tug_map` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`shipcall_id` INT(11) NOT NULL COMMENT 'Ref to ship call',
`ship_id` INT(11) NOT NULL COMMENT 'Ref to ship (that is a tug)',
PRIMARY KEY (`id`)
)
COMMENT='Mapping table that assigns tugs to a ship call'
ENGINE=InnoDB DEFAULT CHARSET=utf8mb4
;

View File

@ -40,9 +40,7 @@ def create_app(test_config=None):
app.register_blueprint(berths.bp) app.register_blueprint(berths.bp)
logging.basicConfig(filename='brecal.log', level=logging.DEBUG, format='%(asctime)s | %(name)s | %(levelname)s | %(message)s') logging.basicConfig(filename='brecal.log', level=logging.DEBUG, format='%(asctime)s | %(name)s | %(levelname)s | %(message)s')
local_db.initPool() local_db.initPool()
logging.info('App started') logging.info('App started')
return app return app