Skip to content

Commit

Permalink
PUSH
Browse files Browse the repository at this point in the history
-> Fat DB
  • Loading branch information
NaysKutzu committed Dec 26, 2024
1 parent b3e07a6 commit a57e66c
Show file tree
Hide file tree
Showing 14 changed files with 183 additions and 0 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"Predis",
"recommand",
"Regen",
"shortdescription",
"SOURCECODE",
"Swal",
"sweetalert"
Expand Down
12 changes: 12 additions & 0 deletions backend/storage/25.12.2024-22.03-create-tickets-attachments.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
CREATE TABLE
`mythicalclient_tickets_attachments` (
`id` INT NOT NULL AUTO_INCREMENT,
`ticket` int(16) NOT NULL,

`enabled` ENUM ('false', 'true') NOT NULL DEFAULT 'false',
`deleted` ENUM ('false', 'true') NOT NULL DEFAULT 'false',
`locked` ENUM ('false', 'true') NOT NULL DEFAULT 'false',
`date` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
FOREIGN KEY (`ticket`) REFERENCES `mythicalclient_tickets` (`id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
14 changes: 14 additions & 0 deletions backend/storage/25.12.2024-22.03-create-tickets.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
CREATE TABLE
`mythicalclient_tickets` (
`id` INT NOT NULL AUTO_INCREMENT,
`user` varchar(36) NOT NULL,
`department` int(16) NOT NULL,

`enabled` ENUM ('false', 'true') NOT NULL DEFAULT 'false',
`deleted` ENUM ('false', 'true') NOT NULL DEFAULT 'false',
`locked` ENUM ('false', 'true') NOT NULL DEFAULT 'false',
`date` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
FOREIGN KEY (`user`) REFERENCES `mythicalclient_users` (`uuid`),
FOREIGN KEY (`department`) REFERENCES `mythicalclient_departments` (`id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
CREATE TABLE
`mythicalclient_services_categories` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` TEXT NOT NULL ,
`uri` TEXT NOT NULL ,
`headline` TEXT NOT NULL,
`tagline` TEXT NOT NULL,
`enabled` ENUM ('false', 'true') NOT NULL DEFAULT 'false',
`deleted` ENUM ('false', 'true') NOT NULL DEFAULT 'false',
`locked` ENUM ('false', 'true') NOT NULL DEFAULT 'false',
`date` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
CREATE TABLE
`mythicalclient_services_categories_features` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` TEXT NOT NULL ,
`category` int(16) NOT NULL,
`description` TEXT NOT NULL,
`enabled` ENUM ('false', 'true') NOT NULL DEFAULT 'false',
`deleted` ENUM ('false', 'true') NOT NULL DEFAULT 'false',
`locked` ENUM ('false', 'true') NOT NULL DEFAULT 'false',
`date` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
FOREIGN KEY (`category`) REFERENCES `mythicalclient_services_categories` (`id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
CREATE TABLE
`mythicalclient_departments` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` TEXT NOT NULL,
`description` TEXT NOT NULL,
`time_open` TEXT NOT NULL,
`time_close` TEXT NOT NULL,
`enabled` ENUM ('false', 'true') NOT NULL DEFAULT 'false',
`deleted` ENUM ('false', 'true') NOT NULL DEFAULT 'false',
`locked` ENUM ('false', 'true') NOT NULL DEFAULT 'false',
`date` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
CREATE TABLE
`mythicalclient_addons_types` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` TEXT NOT NULL,
`enabled` ENUM ('false', 'true') NOT NULL DEFAULT 'true',
`deleted` ENUM ('false', 'true') NOT NULL DEFAULT 'false',
`locked` ENUM ('false', 'true') NOT NULL DEFAULT 'false',
`date` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;

INSERT INTO
`mythicalclient_addons_types` (`name`)
VALUES
('event'),
('gateway'),
('provider'),
('components');
13 changes: 13 additions & 0 deletions backend/storage/migrations/25.12.2024-23.51-create-addons.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
CREATE TABLE
`mythicalclient_addons` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` TEXT NOT NULL,
`type` INT NOT NULL,
`display_name` TEXT NOT NULL,
`enabled` ENUM ('false', 'true') NOT NULL DEFAULT 'false',
`deleted` ENUM ('false', 'true') NOT NULL DEFAULT 'false',
`locked` ENUM ('false', 'true') NOT NULL DEFAULT 'false',
`date` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
FOREIGN KEY (`type`) REFERENCES `mythicalclient_addons_types` (`id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
23 changes: 23 additions & 0 deletions backend/storage/migrations/25.12.2024-23.58-create-services.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
CREATE TABLE
`mythicalclient_services` (
`id` INT NOT NULL AUTO_INCREMENT,
`category` INT NOT NULL,
`name` TEXT NOT NULL,
`tagline` TEXT NOT NULL,
`quantity` INT NOT NULL,
`stock` INT NOT NULL,
`stock_enabled` ENUM ('false', 'true') NOT NULL DEFAULT 'false',

`uri` TEXT NOT NULL,
`shortdescription` TEXT NOT NULL,
`description` TEXT NOT NULL,
`setup_fee` INT NOT NULL,
`provider` INT NOT NULL,
`enabled` ENUM ('false', 'true') NOT NULL DEFAULT 'false',
`deleted` ENUM ('false', 'true') NOT NULL DEFAULT 'false',
`locked` ENUM ('false', 'true') NOT NULL DEFAULT 'false',
`date` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
FOREIGN KEY (`category`) REFERENCES `mythicalclient_services_categories` (`id`),
FOREIGN KEY (`provider`) REFERENCES `mythicalclient_addons` (`id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
CREATE TABLE
`mythicalclient_services_price_types` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` TEXT NOT NULL,
`deleted` ENUM ('false', 'true') NOT NULL DEFAULT 'false',
`locked` ENUM ('false', 'true') NOT NULL DEFAULT 'false',
`date` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
INSERT INTO `mythicalclient_services_price_types` (`name`) VALUES ('one-time'), ('recurring'), ('free');
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
CREATE TABLE
`mythicalclient_services_price` (
`id` INT NOT NULL AUTO_INCREMENT,
`service` INT NOT NULL,
`type` INT NOT NULL,
`monthly` TEXT NULL,
`quarterly` TEXT NULL,
`semi_annually` TEXT NULL,
`annually` TEXT NULL,
`biennially` TEXT NULL,
`triennially` TEXT NULL,
`deleted` ENUM ('false', 'true') NOT NULL DEFAULT 'false',
`locked` ENUM ('false', 'true') NOT NULL DEFAULT 'false',
`date` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
FOREIGN KEY (`type`) REFERENCES `mythicalclient_services_price_types` (`id`),
FOREIGN KEY (`service`) REFERENCES `mythicalclient_services` (`id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
CREATE TABLE
`mythicalclient_services_upgrades` (
`id` INT NOT NULL AUTO_INCREMENT,
`product_id_old` INT NOT NULL,
`product-id_new` INT NOT NULL,
`enabled` ENUM ('false', 'true') NOT NULL DEFAULT 'false',
`deleted` ENUM ('false', 'true') NOT NULL DEFAULT 'false',
`locked` ENUM ('false', 'true') NOT NULL DEFAULT 'false',
`date` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
FOREIGN KEY (`product_id_old`) REFERENCES `mythicalclient_services` (`id`),
FOREIGN KEY (`product-id_new`) REFERENCES `mythicalclient_services` (`id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
CREATE TABLE
`mythicalclient_invoice_templates` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` INT NOT NULL,
`content` INT NOT NULL,
`enabled` ENUM ('false', 'true') NOT NULL DEFAULT 'false',
`deleted` ENUM ('false', 'true') NOT NULL DEFAULT 'false',
`locked` ENUM ('false', 'true') NOT NULL DEFAULT 'false',
`date` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
11 changes: 11 additions & 0 deletions backend/storage/migrations/26.12.2024-00.29-create-invoices.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
CREATE TABLE
`mythicalclient_invoice_templates` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` INT NOT NULL,
`content` INT NOT NULL,
`enabled` ENUM ('false', 'true') NOT NULL DEFAULT 'false',
`deleted` ENUM ('false', 'true') NOT NULL DEFAULT 'false',
`locked` ENUM ('false', 'true') NOT NULL DEFAULT 'false',
`date` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;

0 comments on commit a57e66c

Please sign in to comment.