Add files via upload

This commit is contained in:
TORBEN HAACK 2024-04-18 09:53:17 +02:00 committed by GitHub Enterprise
parent 43fb11ea83
commit 0cfa856705
2 changed files with 57 additions and 0 deletions

57
docs/MYP (1).sql Normal file
View File

@ -0,0 +1,57 @@
CREATE TABLE `Printer` (
`id` int UNIQUE PRIMARY KEY,
`name` text,
`description` text,
`status` int COMMENT '0: OPERATIONAL
1: OUT_OF_ORDER',
`created_at` timestamp,
`updated_at` timestamp
);
CREATE TABLE `PrintJob` (
`id` int UNIQUE PRIMARY KEY,
`printer_id` int,
`user_id` int,
`start_at` timestamp,
`duration_in_minutes` int,
`comments` text,
`aborted` boolean DEFAULT false,
`abort_reason` text COMMENT 'Error code displayed on printer'
);
CREATE TABLE `Account` (
`id` text UNIQUE PRIMARY KEY,
`userId` text,
`type` text,
`provider` text,
`providerAccountId` text,
`refresh_token` text,
`access_token` text,
`expires_at` int,
`token_type` text,
`scope` text,
`id_token` text,
`session_state` text
);
CREATE TABLE `Session` (
`id` text UNIQUE PRIMARY KEY,
`sessionToken` text UNIQUE,
`userId` text,
`expires` datetime
);
CREATE TABLE `User` (
`id` text PRIMARY KEY,
`name` text,
`email` text UNIQUE,
`role` text COMMENT 'ADMIN,USER,GUEST'
);
ALTER TABLE `User` ADD FOREIGN KEY (`id`) REFERENCES `PrintJob` (`user_id`);
ALTER TABLE `User` ADD FOREIGN KEY (`id`) REFERENCES `Account` (`userId`);
ALTER TABLE `User` ADD FOREIGN KEY (`id`) REFERENCES `Session` (`userId`);
ALTER TABLE `Printer` ADD FOREIGN KEY (`id`) REFERENCES `PrintJob` (`printer_id`);

BIN
docs/MYP.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB