From 03d4f431338dedd7a96e168790e84e9f1abc3319 Mon Sep 17 00:00:00 2001 From: lucs7 Date: Fri, 7 Nov 2025 17:26:58 +0100 Subject: [PATCH 1/3] feat: add VS Code devcontainer configuration Add devcontainer setup for LibreBooking development environment: - Docker Compose configuration with PHP 8.1 and MariaDB 10.6 - Xdebug enabled for debugging support - Composer dependencies auto-installed on container creation - Automatic permission setup for uploads and tpl_c directories - Pre-configured VS Code extensions (PHP Debug, Intelephense, EditorConfig) - Database initialization with test schema This enables consistent development environment across team members and simplifies onboarding for new contributors. --- .devcontainer/Dockerfile | 19 + .devcontainer/devcontainer.json | 35 + .devcontainer/docker-compose.devcontainer.yml | 28 + .devcontainer/init.sql | 937 ++++++++++++++++++ 4 files changed, 1019 insertions(+) create mode 100755 .devcontainer/Dockerfile create mode 100755 .devcontainer/devcontainer.json create mode 100755 .devcontainer/docker-compose.devcontainer.yml create mode 100755 .devcontainer/init.sql diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100755 index 000000000..9c1186771 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,19 @@ +ARG BASE_IMAGE=librebooking/librebooking:develop +FROM ${BASE_IMAGE} +ENV DEBIAN_FRONTEND=noninteractive + +# Configure PHP memory and Xdebug defaults for development +RUN set -eux; \ + echo 'memory_limit = 2048M' > /usr/local/etc/php/conf.d/docker-php-memlimit.ini; \ + { \ + echo 'xdebug.mode=debug,develop'; \ + echo 'xdebug.start_with_request=yes'; \ + echo 'xdebug.discover_client_host=1'; \ + echo 'xdebug.log_level=0'; \ + } > /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini + +WORKDIR / +VOLUME /config + +ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] +CMD ["apache2-foreground"] diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100755 index 000000000..06c114c52 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,35 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/php +{ + "name": "LibreBooking Development", + "dockerComposeFile": [ + "./docker-compose.devcontainer.yml" + ], + "service": "librebooking", + "runServices": [ + "librebooking", + "db" + ], + "workspaceFolder": "/var/www/html", + "mounts": [ + "type=bind,source=${localWorkspaceFolder},target=/var/www/html,consistency=cached" + ], + "forwardPorts": [ + 80 + ], + "postCreateCommand": "composer install --ignore-platform-req=ext-gd", + "postStartCommand": "chown -R www-data:www-data /var/www/html/uploads /var/www/html/tpl_c", + "customizations": { + "vscode": { + "extensions": [ + "xdebug.php-debug", + "bmewburn.vscode-intelephense-client", + "EditorConfig.EditorConfig" + ], + "settings": { + "php.validate.executablePath": "/usr/local/bin/php" + } + } + }, + "shutdownAction": "stopCompose" +} diff --git a/.devcontainer/docker-compose.devcontainer.yml b/.devcontainer/docker-compose.devcontainer.yml new file mode 100755 index 000000000..65ce55db2 --- /dev/null +++ b/.devcontainer/docker-compose.devcontainer.yml @@ -0,0 +1,28 @@ +services: + librebooking: + build: + context: . + dockerfile: Dockerfile + container_name: librebooking-app + depends_on: + - db + ports: + - "80:80" + environment: + - LB_APP_TITLE=LibreBooking-Dev + - LB_DATABASE_HOSTSPEC=librebooking-db + - LB_DATABASE_USER=librebooking + - LB_DATABASE_PASSWORD=devpass + - LB_DATABASE_NAME=librebooking + - LB_ENV=development + - TZ=UTC + db: + image: mariadb:12.0.2 + container_name: librebooking-db + environment: + - MYSQL_ROOT_PASSWORD=devpass + - MYSQL_DATABASE=librebooking + - MYSQL_USER=librebooking + - MYSQL_PASSWORD=devpass + volumes: + - ./init.sql:/docker-entrypoint-initdb.d/init.sql diff --git a/.devcontainer/init.sql b/.devcontainer/init.sql new file mode 100755 index 000000000..9b8d27b9c --- /dev/null +++ b/.devcontainer/init.sql @@ -0,0 +1,937 @@ +-- Adminer 5.3.0 MariaDB 12.0.2-MariaDB-ubu2404 dump + +SET NAMES utf8; +SET time_zone = '+00:00'; +SET foreign_key_checks = 0; +SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'; + +SET NAMES utf8mb4; + +DROP TABLE IF EXISTS `accessories`; +CREATE TABLE `accessories` ( + `accessory_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, + `accessory_name` varchar(85) NOT NULL, + `accessory_quantity` smallint(5) unsigned DEFAULT NULL, + `legacyid` char(16) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL, + PRIMARY KEY (`accessory_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + +INSERT INTO `accessories` (`accessory_id`, `accessory_name`, `accessory_quantity`, `legacyid`) VALUES +(1, 'accessory limited to 10', 10, NULL), +(2, 'accessory limited to 2', 2, NULL), +(3, 'unlimited accessory', NULL, NULL); + +DROP TABLE IF EXISTS `account_activation`; +CREATE TABLE `account_activation` ( + `account_activation_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `user_id` mediumint(8) unsigned NOT NULL, + `activation_code` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci NOT NULL, + `date_created` datetime NOT NULL, + PRIMARY KEY (`account_activation_id`), + UNIQUE KEY `activation_code_2` (`activation_code`), + KEY `activation_code` (`activation_code`), + KEY `user_id` (`user_id`), + CONSTRAINT `account_activation_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + + +DROP TABLE IF EXISTS `announcements`; +CREATE TABLE `announcements` ( + `announcementid` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `announcement_text` text NOT NULL, + `priority` mediumint(8) DEFAULT NULL, + `start_date` datetime DEFAULT NULL, + `end_date` datetime DEFAULT NULL, + `display_page` tinyint(1) unsigned NOT NULL DEFAULT 1, + PRIMARY KEY (`announcementid`), + KEY `start_date` (`start_date`), + KEY `end_date` (`end_date`), + KEY `display_page` (`display_page`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + +LOCK TABLES `announcements` WRITE; +INSERT INTO `announcements` VALUES +(1,' +<ul style="font-size: large; margin-top: 1em;"><li><strong>Admin Login:</strong> <code>admin</code> / <code>password</code></li><li><strong>User Login:</strong> <code>user</code> / <code>password</code></li></ul>',NULL,NULL,NULL,5); +UNLOCK TABLES; + + +DROP TABLE IF EXISTS `announcement_groups`; +CREATE TABLE `announcement_groups` ( + `announcementid` mediumint(8) unsigned NOT NULL, + `group_id` smallint(5) unsigned NOT NULL, + PRIMARY KEY (`announcementid`,`group_id`), + KEY `group_id` (`group_id`), + CONSTRAINT `announcement_groups_ibfk_1` FOREIGN KEY (`announcementid`) REFERENCES `announcements` (`announcementid`) ON DELETE CASCADE, + CONSTRAINT `announcement_groups_ibfk_2` FOREIGN KEY (`group_id`) REFERENCES `groups` (`group_id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + + +DROP TABLE IF EXISTS `announcement_resources`; +CREATE TABLE `announcement_resources` ( + `announcementid` mediumint(8) unsigned NOT NULL, + `resource_id` smallint(5) unsigned NOT NULL, + PRIMARY KEY (`announcementid`,`resource_id`), + KEY `resource_id` (`resource_id`), + CONSTRAINT `announcement_resources_ibfk_1` FOREIGN KEY (`announcementid`) REFERENCES `announcements` (`announcementid`) ON DELETE CASCADE, + CONSTRAINT `announcement_resources_ibfk_2` FOREIGN KEY (`resource_id`) REFERENCES `resources` (`resource_id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + + +DROP TABLE IF EXISTS `blackout_instances`; +CREATE TABLE `blackout_instances` ( + `blackout_instance_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `start_date` datetime NOT NULL, + `end_date` datetime NOT NULL, + `blackout_series_id` int(10) unsigned NOT NULL, + PRIMARY KEY (`blackout_instance_id`), + KEY `start_date` (`start_date`), + KEY `end_date` (`end_date`), + KEY `blackout_series_id` (`blackout_series_id`), + CONSTRAINT `blackout_instances_ibfk_1` FOREIGN KEY (`blackout_series_id`) REFERENCES `blackout_series` (`blackout_series_id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + + +DROP TABLE IF EXISTS `blackout_series`; +CREATE TABLE `blackout_series` ( + `blackout_series_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `date_created` datetime NOT NULL, + `last_modified` datetime DEFAULT NULL, + `title` varchar(85) NOT NULL, + `description` text DEFAULT NULL, + `owner_id` mediumint(8) unsigned NOT NULL, + `legacyid` char(16) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL, + `repeat_type` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL, + `repeat_options` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL, + PRIMARY KEY (`blackout_series_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + + +DROP TABLE IF EXISTS `blackout_series_resources`; +CREATE TABLE `blackout_series_resources` ( + `blackout_series_id` int(10) unsigned NOT NULL, + `resource_id` smallint(5) unsigned NOT NULL, + PRIMARY KEY (`blackout_series_id`,`resource_id`), + KEY `resource_id` (`resource_id`), + CONSTRAINT `blackout_series_resources_ibfk_1` FOREIGN KEY (`blackout_series_id`) REFERENCES `blackout_series` (`blackout_series_id`) ON DELETE CASCADE, + CONSTRAINT `blackout_series_resources_ibfk_2` FOREIGN KEY (`resource_id`) REFERENCES `resources` (`resource_id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + + +DROP TABLE IF EXISTS `credit_log`; +CREATE TABLE `credit_log` ( + `credit_log_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `user_id` mediumint(8) unsigned NOT NULL, + `original_credit_count` decimal(7,2) DEFAULT NULL, + `credit_count` decimal(7,2) DEFAULT NULL, + `credit_note` varchar(1000) DEFAULT NULL, + `date_created` datetime NOT NULL, + PRIMARY KEY (`credit_log_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + + +DROP TABLE IF EXISTS `custom_attributes`; +CREATE TABLE `custom_attributes` ( + `custom_attribute_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `display_label` varchar(50) NOT NULL, + `display_type` tinyint(2) unsigned NOT NULL, + `attribute_category` tinyint(2) unsigned NOT NULL, + `validation_regex` varchar(50) DEFAULT NULL, + `is_required` tinyint(1) unsigned NOT NULL, + `possible_values` text DEFAULT NULL, + `sort_order` tinyint(2) unsigned DEFAULT NULL, + `admin_only` tinyint(1) unsigned DEFAULT NULL, + `secondary_category` tinyint(2) unsigned DEFAULT NULL, + `secondary_entity_ids` varchar(2000) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL, + `is_private` tinyint(1) unsigned DEFAULT NULL, + PRIMARY KEY (`custom_attribute_id`), + KEY `attribute_category` (`attribute_category`), + KEY `display_label` (`display_label`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + +INSERT INTO `custom_attributes` (`custom_attribute_id`, `display_label`, `display_type`, `attribute_category`, `validation_regex`, `is_required`, `possible_values`, `sort_order`, `admin_only`, `secondary_category`, `secondary_entity_ids`, `is_private`) VALUES +(1, 'Test Number', 1, 1, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL), +(2, 'Test String', 1, 1, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL), +(3, 'Test Number', 1, 4, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL), +(4, 'Test String', 1, 4, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + +DROP TABLE IF EXISTS `custom_attribute_entities`; +CREATE TABLE `custom_attribute_entities` ( + `custom_attribute_id` mediumint(8) unsigned NOT NULL, + `entity_id` mediumint(8) unsigned NOT NULL, + PRIMARY KEY (`custom_attribute_id`,`entity_id`), + CONSTRAINT `custom_attribute_entities_ibfk_1` FOREIGN KEY (`custom_attribute_id`) REFERENCES `custom_attributes` (`custom_attribute_id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + + +DROP TABLE IF EXISTS `custom_attribute_values`; +CREATE TABLE `custom_attribute_values` ( + `custom_attribute_value_id` int(8) unsigned NOT NULL AUTO_INCREMENT, + `custom_attribute_id` mediumint(8) unsigned NOT NULL, + `attribute_value` text NOT NULL, + `entity_id` mediumint(8) unsigned NOT NULL, + `attribute_category` tinyint(2) unsigned NOT NULL, + PRIMARY KEY (`custom_attribute_value_id`), + KEY `custom_attribute_id` (`custom_attribute_id`), + KEY `entity_id` (`entity_id`), + KEY `attribute_category` (`attribute_category`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + + +DROP TABLE IF EXISTS `custom_time_blocks`; +CREATE TABLE `custom_time_blocks` ( + `custom_time_block_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, + `start_time` datetime NOT NULL, + `end_time` datetime NOT NULL, + `layout_id` mediumint(8) unsigned NOT NULL, + PRIMARY KEY (`custom_time_block_id`), + KEY `layout_id` (`layout_id`), + CONSTRAINT `custom_time_blocks_ibfk_1` FOREIGN KEY (`layout_id`) REFERENCES `layouts` (`layout_id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + + +DROP TABLE IF EXISTS `dbversion`; +CREATE TABLE `dbversion` ( + `version_number` double unsigned NOT NULL DEFAULT 0, + `version_date` timestamp NOT NULL DEFAULT current_timestamp() +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + +INSERT INTO `dbversion` (`version_number`, `version_date`) VALUES +(2.1, '2025-09-05 11:00:44'), +(2.2, '2025-09-05 11:00:45'), +(2.3, '2025-09-05 11:00:45'), +(2.4, '2025-09-05 11:00:45'), +(2.5, '2025-09-05 11:00:46'), +(2.6, '2025-09-05 11:00:47'), +(2.7, '2025-09-05 11:00:49'), +(2.8, '2025-09-05 11:00:49'), +(2.9, '2025-09-05 11:00:52'), +(3, '2025-09-05 11:00:52'), +(4, '2025-09-05 11:00:52'); + +DROP TABLE IF EXISTS `groups`; +CREATE TABLE `groups` ( + `group_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(85) NOT NULL, + `admin_group_id` smallint(5) unsigned DEFAULT NULL, + `legacyid` char(16) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL, + `isdefault` tinyint(1) unsigned NOT NULL DEFAULT 0, + PRIMARY KEY (`group_id`), + KEY `admin_group_id` (`admin_group_id`), + KEY `isdefault` (`isdefault`), + CONSTRAINT `groups_ibfk_1` FOREIGN KEY (`admin_group_id`) REFERENCES `groups` (`group_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + +INSERT INTO `groups` (`group_id`, `name`, `admin_group_id`, `legacyid`, `isdefault`) VALUES +(1, 'Group Administrators', NULL, NULL, 0), +(2, 'Application Administrators', NULL, NULL, 0), +(3, 'Resource Administrators', NULL, NULL, 0), +(4, 'Schedule Administrators', NULL, NULL, 0); + +DROP TABLE IF EXISTS `group_resource_permissions`; +CREATE TABLE `group_resource_permissions` ( + `group_id` smallint(5) unsigned NOT NULL, + `resource_id` smallint(5) unsigned NOT NULL, + `permission_type` tinyint(3) unsigned NOT NULL DEFAULT 0, + PRIMARY KEY (`group_id`,`resource_id`), + KEY `group_id` (`group_id`), + KEY `resource_id` (`resource_id`), + KEY `group_id_2` (`group_id`), + KEY `resource_id_2` (`resource_id`), + CONSTRAINT `group_resource_permissions_ibfk_1` FOREIGN KEY (`group_id`) REFERENCES `groups` (`group_id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `group_resource_permissions_ibfk_2` FOREIGN KEY (`resource_id`) REFERENCES `resources` (`resource_id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + + +DROP TABLE IF EXISTS `group_roles`; +CREATE TABLE `group_roles` ( + `group_id` smallint(8) unsigned NOT NULL, + `role_id` tinyint(2) unsigned NOT NULL, + PRIMARY KEY (`group_id`,`role_id`), + KEY `group_id` (`group_id`), + KEY `role_id` (`role_id`), + CONSTRAINT `group_roles_ibfk_1` FOREIGN KEY (`group_id`) REFERENCES `groups` (`group_id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `group_roles_ibfk_2` FOREIGN KEY (`role_id`) REFERENCES `roles` (`role_id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + +INSERT INTO `group_roles` (`group_id`, `role_id`) VALUES +(1, 1), +(2, 2), +(4, 4); + +DROP TABLE IF EXISTS `layouts`; +CREATE TABLE `layouts` ( + `layout_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `timezone` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci NOT NULL, + `layout_type` tinyint(3) unsigned NOT NULL DEFAULT 0, + PRIMARY KEY (`layout_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + +INSERT INTO `layouts` (`layout_id`, `timezone`, `layout_type`) VALUES +(1, 'Europe/Berlin', 0); + +DROP TABLE IF EXISTS `payment_configuration`; +CREATE TABLE `payment_configuration` ( + `credit_cost` decimal(7,2) unsigned NOT NULL, + `credit_currency` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci NOT NULL, + `credit_count` int(10) unsigned NOT NULL DEFAULT 1 CHECK (`credit_count` > 0), + PRIMARY KEY (`credit_count`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + +INSERT INTO `payment_configuration` (`credit_cost`, `credit_currency`, `credit_count`) VALUES +(0.00, 'USD', 1); + +DROP TABLE IF EXISTS `payment_gateway_settings`; +CREATE TABLE `payment_gateway_settings` ( + `gateway_type` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci NOT NULL, + `setting_name` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci NOT NULL, + `setting_value` varchar(1000) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci NOT NULL, + PRIMARY KEY (`gateway_type`,`setting_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + + +DROP TABLE IF EXISTS `payment_transaction_log`; +CREATE TABLE `payment_transaction_log` ( + `payment_transaction_log_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `user_id` mediumint(8) unsigned NOT NULL, + `status` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci NOT NULL, + `invoice_number` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL, + `transaction_id` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci NOT NULL, + `subtotal_amount` decimal(7,2) NOT NULL, + `tax_amount` decimal(7,2) NOT NULL, + `total_amount` decimal(7,2) NOT NULL, + `transaction_fee` decimal(7,2) DEFAULT NULL, + `currency` varchar(3) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci NOT NULL, + `transaction_href` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL, + `refund_href` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL, + `date_created` datetime NOT NULL, + `gateway_name` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci NOT NULL, + `gateway_date_created` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci NOT NULL, + `payment_response` text CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL, + PRIMARY KEY (`payment_transaction_log_id`), + KEY `user_id` (`user_id`), + KEY `invoice_number` (`invoice_number`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + + +DROP TABLE IF EXISTS `peak_times`; +CREATE TABLE `peak_times` ( + `peak_times_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `schedule_id` smallint(5) unsigned NOT NULL, + `all_day` tinyint(1) unsigned NOT NULL, + `start_time` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL, + `end_time` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL, + `every_day` tinyint(1) unsigned NOT NULL, + `peak_days` varchar(13) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL, + `all_year` tinyint(1) unsigned NOT NULL, + `begin_month` tinyint(1) unsigned NOT NULL, + `begin_day` tinyint(1) unsigned NOT NULL, + `end_month` tinyint(1) unsigned NOT NULL, + `end_day` tinyint(1) unsigned NOT NULL, + PRIMARY KEY (`peak_times_id`), + KEY `schedule_id` (`schedule_id`), + CONSTRAINT `peak_times_ibfk_1` FOREIGN KEY (`schedule_id`) REFERENCES `schedules` (`schedule_id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + + +DROP TABLE IF EXISTS `quotas`; +CREATE TABLE `quotas` ( + `quota_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `quota_limit` decimal(7,2) unsigned NOT NULL, + `unit` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci NOT NULL, + `duration` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci NOT NULL, + `resource_id` smallint(5) unsigned DEFAULT NULL, + `group_id` smallint(5) unsigned DEFAULT NULL, + `schedule_id` smallint(5) unsigned DEFAULT NULL, + `enforced_days` varchar(15) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL, + `enforced_time_start` time DEFAULT NULL, + `enforced_time_end` time DEFAULT NULL, + `scope` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL, + PRIMARY KEY (`quota_id`), + KEY `resource_id` (`resource_id`), + KEY `group_id` (`group_id`), + KEY `schedule_id` (`schedule_id`), + CONSTRAINT `quotas_ibfk_1` FOREIGN KEY (`resource_id`) REFERENCES `resources` (`resource_id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `quotas_ibfk_2` FOREIGN KEY (`group_id`) REFERENCES `groups` (`group_id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `quotas_ibfk_3` FOREIGN KEY (`schedule_id`) REFERENCES `schedules` (`schedule_id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + + +DROP TABLE IF EXISTS `refund_transaction_log`; +CREATE TABLE `refund_transaction_log` ( + `refund_transaction_log_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `payment_transaction_log_id` int(10) unsigned NOT NULL, + `status` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci NOT NULL, + `transaction_id` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL, + `total_refund_amount` decimal(7,2) NOT NULL, + `payment_refund_amount` decimal(7,2) DEFAULT NULL, + `fee_refund_amount` decimal(7,2) DEFAULT NULL, + `transaction_href` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL, + `date_created` datetime NOT NULL, + `gateway_date_created` varchar(25) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci NOT NULL, + `refund_response` text CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL, + PRIMARY KEY (`refund_transaction_log_id`), + KEY `payment_transaction_log_id` (`payment_transaction_log_id`), + CONSTRAINT `refund_transaction_log_ibfk_1` FOREIGN KEY (`payment_transaction_log_id`) REFERENCES `payment_transaction_log` (`payment_transaction_log_id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + + +DROP TABLE IF EXISTS `reminders`; +CREATE TABLE `reminders` ( + `reminder_id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `user_id` mediumint(8) unsigned NOT NULL, + `address` text NOT NULL, + `message` text NOT NULL, + `sendtime` datetime NOT NULL, + `refnumber` text CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci NOT NULL, + PRIMARY KEY (`reminder_id`), + KEY `reminders_user_id` (`user_id`), + CONSTRAINT `reminders_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + + +DROP TABLE IF EXISTS `reservation_accessories`; +CREATE TABLE `reservation_accessories` ( + `series_id` int(10) unsigned NOT NULL, + `accessory_id` smallint(5) unsigned NOT NULL, + `quantity` smallint(5) unsigned DEFAULT NULL, + PRIMARY KEY (`series_id`,`accessory_id`), + KEY `accessory_id` (`accessory_id`), + KEY `series_id` (`series_id`), + CONSTRAINT `reservation_accessories_ibfk_1` FOREIGN KEY (`accessory_id`) REFERENCES `accessories` (`accessory_id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `reservation_accessories_ibfk_2` FOREIGN KEY (`series_id`) REFERENCES `reservation_series` (`series_id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + + +DROP TABLE IF EXISTS `reservation_color_rules`; +CREATE TABLE `reservation_color_rules` ( + `reservation_color_rule_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `custom_attribute_id` mediumint(8) unsigned NOT NULL, + `attribute_type` smallint(5) unsigned DEFAULT NULL, + `required_value` text CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL, + `comparison_type` smallint(5) unsigned DEFAULT NULL, + `color` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL, + PRIMARY KEY (`reservation_color_rule_id`), + KEY `custom_attribute_id` (`custom_attribute_id`), + CONSTRAINT `reservation_color_rules_ibfk_1` FOREIGN KEY (`custom_attribute_id`) REFERENCES `custom_attributes` (`custom_attribute_id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + + +DROP TABLE IF EXISTS `reservation_files`; +CREATE TABLE `reservation_files` ( + `file_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `series_id` int(10) unsigned NOT NULL, + `file_name` varchar(250) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci NOT NULL, + `file_type` varchar(75) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL, + `file_size` varchar(45) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci NOT NULL, + `file_extension` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci NOT NULL, + PRIMARY KEY (`file_id`), + KEY `series_id` (`series_id`), + CONSTRAINT `reservation_files_ibfk_1` FOREIGN KEY (`series_id`) REFERENCES `reservation_series` (`series_id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + + +DROP TABLE IF EXISTS `reservation_guests`; +CREATE TABLE `reservation_guests` ( + `reservation_instance_id` int(10) unsigned NOT NULL, + `email` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci NOT NULL, + `reservation_user_level` tinyint(2) unsigned NOT NULL, + PRIMARY KEY (`reservation_instance_id`,`email`), + KEY `reservation_guests_reservation_instance_id` (`reservation_instance_id`), + KEY `reservation_guests_email_address` (`email`), + KEY `reservation_guests_reservation_user_level` (`reservation_user_level`), + CONSTRAINT `reservation_guests_ibfk_1` FOREIGN KEY (`reservation_instance_id`) REFERENCES `reservation_instances` (`reservation_instance_id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + + +DROP TABLE IF EXISTS `reservation_instances`; +CREATE TABLE `reservation_instances` ( + `reservation_instance_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `start_date` datetime NOT NULL, + `end_date` datetime NOT NULL, + `reference_number` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci NOT NULL, + `series_id` int(10) unsigned NOT NULL, + `checkin_date` datetime DEFAULT NULL, + `checkout_date` datetime DEFAULT NULL, + `previous_end_date` datetime DEFAULT NULL, + `credit_count` decimal(7,2) unsigned DEFAULT NULL, + PRIMARY KEY (`reservation_instance_id`), + KEY `start_date` (`start_date`), + KEY `end_date` (`end_date`), + KEY `reference_number` (`reference_number`), + KEY `series_id` (`series_id`), + KEY `checkin_date` (`checkin_date`), + CONSTRAINT `reservations_series` FOREIGN KEY (`series_id`) REFERENCES `reservation_series` (`series_id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + + +DROP TABLE IF EXISTS `reservation_reminders`; +CREATE TABLE `reservation_reminders` ( + `reminder_id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `series_id` int(10) unsigned NOT NULL, + `minutes_prior` int(10) unsigned NOT NULL, + `reminder_type` tinyint(2) unsigned NOT NULL, + PRIMARY KEY (`reminder_id`), + KEY `series_id` (`series_id`), + KEY `reminder_type` (`reminder_type`), + CONSTRAINT `reservation_reminders_ibfk_1` FOREIGN KEY (`series_id`) REFERENCES `reservation_series` (`series_id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + + +DROP TABLE IF EXISTS `reservation_resources`; +CREATE TABLE `reservation_resources` ( + `series_id` int(10) unsigned NOT NULL, + `resource_id` smallint(5) unsigned NOT NULL, + `resource_level_id` tinyint(2) unsigned NOT NULL, + PRIMARY KEY (`series_id`,`resource_id`), + KEY `resource_id` (`resource_id`), + KEY `series_id` (`series_id`), + CONSTRAINT `reservation_resources_ibfk_1` FOREIGN KEY (`resource_id`) REFERENCES `resources` (`resource_id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `reservation_resources_ibfk_2` FOREIGN KEY (`series_id`) REFERENCES `reservation_series` (`series_id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + + +DROP TABLE IF EXISTS `reservation_series`; +CREATE TABLE `reservation_series` ( + `series_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `date_created` datetime NOT NULL, + `last_modified` datetime DEFAULT NULL, + `title` varchar(300) DEFAULT NULL, + `description` text DEFAULT NULL, + `allow_participation` tinyint(1) unsigned NOT NULL, + `allow_anon_participation` tinyint(1) unsigned NOT NULL, + `type_id` tinyint(2) unsigned NOT NULL, + `status_id` tinyint(2) unsigned NOT NULL, + `repeat_type` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL, + `repeat_options` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL, + `owner_id` mediumint(8) unsigned NOT NULL, + `legacyid` char(16) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL, + `last_action_by` mediumint(8) unsigned DEFAULT NULL, + `terms_date_accepted` datetime DEFAULT NULL, + PRIMARY KEY (`series_id`), + KEY `type_id` (`type_id`), + KEY `status_id` (`status_id`), + KEY `reservations_owner` (`owner_id`), + CONSTRAINT `reservations_owner` FOREIGN KEY (`owner_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE, + CONSTRAINT `reservations_status` FOREIGN KEY (`status_id`) REFERENCES `reservation_statuses` (`status_id`) ON UPDATE CASCADE, + CONSTRAINT `reservations_type` FOREIGN KEY (`type_id`) REFERENCES `reservation_types` (`type_id`) ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + + +DROP TABLE IF EXISTS `reservation_statuses`; +CREATE TABLE `reservation_statuses` ( + `status_id` tinyint(2) unsigned NOT NULL, + `label` varchar(85) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci NOT NULL, + PRIMARY KEY (`status_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + +INSERT INTO `reservation_statuses` (`status_id`, `label`) VALUES +(1, 'Created'), +(2, 'Deleted'), +(3, 'Pending'); + +DROP TABLE IF EXISTS `reservation_types`; +CREATE TABLE `reservation_types` ( + `type_id` tinyint(2) unsigned NOT NULL, + `label` varchar(85) NOT NULL, + PRIMARY KEY (`type_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + +INSERT INTO `reservation_types` (`type_id`, `label`) VALUES +(1, 'Reservation'), +(2, 'Blackout'); + +DROP TABLE IF EXISTS `reservation_users`; +CREATE TABLE `reservation_users` ( + `reservation_instance_id` int(10) unsigned NOT NULL, + `user_id` mediumint(8) unsigned NOT NULL, + `reservation_user_level` tinyint(2) unsigned NOT NULL, + PRIMARY KEY (`reservation_instance_id`,`user_id`), + KEY `reservation_instance_id` (`reservation_instance_id`), + KEY `user_id` (`user_id`), + KEY `reservation_user_level` (`reservation_user_level`), + CONSTRAINT `reservation_users_ibfk_1` FOREIGN KEY (`reservation_instance_id`) REFERENCES `reservation_instances` (`reservation_instance_id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `reservation_users_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + + +DROP TABLE IF EXISTS `reservation_waitlist_requests`; +CREATE TABLE `reservation_waitlist_requests` ( + `reservation_waitlist_request_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `user_id` mediumint(8) unsigned NOT NULL, + `resource_id` smallint(5) unsigned NOT NULL, + `start_date` datetime DEFAULT NULL, + `end_date` datetime DEFAULT NULL, + PRIMARY KEY (`reservation_waitlist_request_id`), + KEY `user_id` (`user_id`), + KEY `resource_id` (`resource_id`), + CONSTRAINT `reservation_waitlist_requests_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE, + CONSTRAINT `reservation_waitlist_requests_ibfk_2` FOREIGN KEY (`resource_id`) REFERENCES `resources` (`resource_id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + + +DROP TABLE IF EXISTS `resources`; +CREATE TABLE `resources` ( + `resource_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(85) NOT NULL, + `location` varchar(255) DEFAULT NULL, + `contact_info` varchar(255) DEFAULT NULL, + `description` text DEFAULT NULL, + `notes` text DEFAULT NULL, + `min_duration` int(11) DEFAULT NULL, + `min_increment` int(11) DEFAULT NULL, + `max_duration` int(11) DEFAULT NULL, + `unit_cost` decimal(7,2) DEFAULT NULL, + `autoassign` tinyint(1) unsigned NOT NULL DEFAULT 1, + `requires_approval` tinyint(1) unsigned NOT NULL, + `allow_multiday_reservations` tinyint(1) unsigned NOT NULL DEFAULT 1, + `max_participants` mediumint(8) unsigned DEFAULT NULL, + `min_notice_time_add` int(11) DEFAULT NULL, + `max_notice_time` int(11) DEFAULT NULL, + `image_name` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL, + `schedule_id` smallint(5) unsigned NOT NULL, + `legacyid` char(16) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL, + `admin_group_id` smallint(5) unsigned DEFAULT NULL, + `public_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL, + `allow_calendar_subscription` tinyint(1) NOT NULL DEFAULT 0, + `sort_order` smallint(5) unsigned DEFAULT NULL, + `resource_type_id` mediumint(8) unsigned DEFAULT NULL, + `status_id` tinyint(3) unsigned NOT NULL DEFAULT 1, + `resource_status_reason_id` smallint(5) unsigned DEFAULT NULL, + `buffer_time` int(10) unsigned DEFAULT NULL, + `enable_check_in` tinyint(1) unsigned NOT NULL DEFAULT 0, + `auto_release_minutes` smallint(5) unsigned DEFAULT NULL, + `color` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL, + `allow_display` tinyint(1) unsigned NOT NULL DEFAULT 0, + `credit_count` decimal(7,2) unsigned DEFAULT NULL, + `peak_credit_count` decimal(7,2) unsigned DEFAULT NULL, + `min_notice_time_update` int(11) DEFAULT NULL, + `min_notice_time_delete` int(11) DEFAULT NULL, + `date_created` datetime DEFAULT NULL, + `last_modified` datetime DEFAULT NULL, + `additional_properties` text DEFAULT NULL, + PRIMARY KEY (`resource_id`), + UNIQUE KEY `public_id` (`public_id`), + KEY `schedule_id` (`schedule_id`), + KEY `admin_group_id` (`admin_group_id`), + KEY `resource_type_id` (`resource_type_id`), + KEY `resource_status_reason_id` (`resource_status_reason_id`), + KEY `auto_release_minutes` (`auto_release_minutes`), + CONSTRAINT `admin_group_id` FOREIGN KEY (`admin_group_id`) REFERENCES `groups` (`group_id`) ON DELETE SET NULL, + CONSTRAINT `resources_ibfk_1` FOREIGN KEY (`schedule_id`) REFERENCES `schedules` (`schedule_id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `resources_ibfk_2` FOREIGN KEY (`resource_type_id`) REFERENCES `resource_types` (`resource_type_id`) ON DELETE SET NULL, + CONSTRAINT `resources_ibfk_3` FOREIGN KEY (`resource_status_reason_id`) REFERENCES `resource_status_reasons` (`resource_status_reason_id`) ON DELETE SET NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + +INSERT INTO `resources` (`resource_id`, `name`, `location`, `contact_info`, `description`, `notes`, `min_duration`, `min_increment`, `max_duration`, `unit_cost`, `autoassign`, `requires_approval`, `allow_multiday_reservations`, `max_participants`, `min_notice_time_add`, `max_notice_time`, `image_name`, `schedule_id`, `legacyid`, `admin_group_id`, `public_id`, `allow_calendar_subscription`, `sort_order`, `resource_type_id`, `status_id`, `resource_status_reason_id`, `buffer_time`, `enable_check_in`, `auto_release_minutes`, `color`, `allow_display`, `credit_count`, `peak_credit_count`, `min_notice_time_update`, `min_notice_time_delete`, `date_created`, `last_modified`, `additional_properties`) VALUES +(1, 'Conference Room 1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 0, 1, NULL, NULL, NULL, 'resource1.jpg', 1, NULL, NULL, NULL, 0, NULL, NULL, 1, NULL, NULL, 0, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL), +(2, 'Conference Room 2', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 0, 1, NULL, NULL, NULL, 'resource2.jpg', 1, NULL, NULL, NULL, 0, NULL, NULL, 1, NULL, NULL, 0, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + +DROP TABLE IF EXISTS `resource_accessories`; +CREATE TABLE `resource_accessories` ( + `resource_accessory_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `resource_id` smallint(5) unsigned NOT NULL, + `accessory_id` smallint(5) unsigned NOT NULL, + `minimum_quantity` smallint(6) DEFAULT NULL, + `maximum_quantity` smallint(6) DEFAULT NULL, + PRIMARY KEY (`resource_accessory_id`), + KEY `resource_id` (`resource_id`), + KEY `accessory_id` (`accessory_id`), + CONSTRAINT `resource_accessories_ibfk_1` FOREIGN KEY (`resource_id`) REFERENCES `resources` (`resource_id`) ON DELETE CASCADE, + CONSTRAINT `resource_accessories_ibfk_2` FOREIGN KEY (`accessory_id`) REFERENCES `accessories` (`accessory_id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + + +DROP TABLE IF EXISTS `resource_groups`; +CREATE TABLE `resource_groups` ( + `resource_group_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `resource_group_name` varchar(75) DEFAULT NULL, + `parent_id` mediumint(8) unsigned DEFAULT NULL, + `public_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL, + PRIMARY KEY (`resource_group_id`), + KEY `resource_groups_parent_id` (`parent_id`), + CONSTRAINT `resource_groups_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `resource_groups` (`resource_group_id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + + +DROP TABLE IF EXISTS `resource_group_assignment`; +CREATE TABLE `resource_group_assignment` ( + `resource_group_id` mediumint(8) unsigned NOT NULL, + `resource_id` smallint(5) unsigned NOT NULL, + PRIMARY KEY (`resource_group_id`,`resource_id`), + KEY `resource_group_assignment_resource_id` (`resource_id`), + KEY `resource_group_assignment_resource_group_id` (`resource_group_id`), + CONSTRAINT `resource_group_assignment_ibfk_1` FOREIGN KEY (`resource_group_id`) REFERENCES `resource_groups` (`resource_group_id`) ON DELETE CASCADE, + CONSTRAINT `resource_group_assignment_ibfk_2` FOREIGN KEY (`resource_id`) REFERENCES `resources` (`resource_id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + + +DROP TABLE IF EXISTS `resource_images`; +CREATE TABLE `resource_images` ( + `resource_image_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, + `resource_id` smallint(5) unsigned NOT NULL, + `image_name` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL, + PRIMARY KEY (`resource_image_id`), + KEY `resource_id` (`resource_id`), + CONSTRAINT `resource_images_ibfk_1` FOREIGN KEY (`resource_id`) REFERENCES `resources` (`resource_id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + + +DROP TABLE IF EXISTS `resource_status_reasons`; +CREATE TABLE `resource_status_reasons` ( + `resource_status_reason_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, + `status_id` tinyint(3) unsigned NOT NULL, + `description` varchar(100) DEFAULT NULL, + PRIMARY KEY (`resource_status_reason_id`), + KEY `status_id` (`status_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + + +DROP TABLE IF EXISTS `resource_types`; +CREATE TABLE `resource_types` ( + `resource_type_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `resource_type_name` varchar(75) DEFAULT NULL, + `resource_type_description` text DEFAULT NULL, + PRIMARY KEY (`resource_type_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + + +DROP TABLE IF EXISTS `resource_type_assignment`; +CREATE TABLE `resource_type_assignment` ( + `resource_id` smallint(5) unsigned NOT NULL, + `resource_type_id` mediumint(8) unsigned NOT NULL, + PRIMARY KEY (`resource_id`,`resource_type_id`), + KEY `resource_type_id` (`resource_type_id`), + CONSTRAINT `resource_type_assignment_ibfk_1` FOREIGN KEY (`resource_id`) REFERENCES `resources` (`resource_id`) ON DELETE CASCADE, + CONSTRAINT `resource_type_assignment_ibfk_2` FOREIGN KEY (`resource_type_id`) REFERENCES `resource_types` (`resource_type_id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + + +DROP TABLE IF EXISTS `roles`; +CREATE TABLE `roles` ( + `role_id` tinyint(2) unsigned NOT NULL, + `name` varchar(85) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL, + `role_level` tinyint(2) unsigned DEFAULT NULL, + PRIMARY KEY (`role_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + +INSERT INTO `roles` (`role_id`, `name`, `role_level`) VALUES +(1, 'Group Admin', 1), +(2, 'Application Admin', 2), +(3, 'Resource Admin', 3), +(4, 'Schedule Admin', 4); + +DROP TABLE IF EXISTS `saved_reports`; +CREATE TABLE `saved_reports` ( + `saved_report_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `report_name` varchar(50) DEFAULT NULL, + `user_id` mediumint(8) unsigned NOT NULL, + `date_created` datetime NOT NULL, + `report_details` varchar(500) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci NOT NULL, + PRIMARY KEY (`saved_report_id`), + KEY `user_id` (`user_id`), + CONSTRAINT `saved_reports_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + + +DROP TABLE IF EXISTS `schedules`; +CREATE TABLE `schedules` ( + `schedule_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(85) NOT NULL, + `isdefault` tinyint(1) unsigned NOT NULL, + `weekdaystart` tinyint(2) unsigned NOT NULL, + `daysvisible` tinyint(2) unsigned NOT NULL DEFAULT 7, + `layout_id` mediumint(8) unsigned NOT NULL, + `legacyid` char(16) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL, + `public_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL, + `allow_calendar_subscription` tinyint(1) NOT NULL DEFAULT 0, + `admin_group_id` smallint(5) unsigned DEFAULT NULL, + `start_date` datetime DEFAULT NULL, + `end_date` datetime DEFAULT NULL, + `allow_concurrent_bookings` tinyint(1) unsigned NOT NULL DEFAULT 0, + `default_layout` tinyint(4) NOT NULL DEFAULT 0, + `total_concurrent_reservations` smallint(5) unsigned NOT NULL DEFAULT 0, + `max_resources_per_reservation` smallint(5) unsigned NOT NULL DEFAULT 0, + `additional_properties` text DEFAULT NULL, + `notes` text DEFAULT NULL, + `published` tinyint(1) unsigned NOT NULL DEFAULT 0, + PRIMARY KEY (`schedule_id`), + UNIQUE KEY `public_id` (`public_id`), + KEY `layout_id` (`layout_id`), + KEY `schedules_groups_admin_group_id` (`admin_group_id`), + CONSTRAINT `schedules_groups_admin_group_id` FOREIGN KEY (`admin_group_id`) REFERENCES `groups` (`group_id`) ON DELETE SET NULL, + CONSTRAINT `schedules_ibfk_1` FOREIGN KEY (`layout_id`) REFERENCES `layouts` (`layout_id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + +INSERT INTO `schedules` (`schedule_id`, `name`, `isdefault`, `weekdaystart`, `daysvisible`, `layout_id`, `legacyid`, `public_id`, `allow_calendar_subscription`, `admin_group_id`, `start_date`, `end_date`, `allow_concurrent_bookings`, `default_layout`, `total_concurrent_reservations`, `max_resources_per_reservation`, `additional_properties`, `notes`, `published`) VALUES +(1, 'Default', 1, 0, 7, 1, NULL, NULL, 0, NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL, 0); + +DROP TABLE IF EXISTS `terms_of_service`; +CREATE TABLE `terms_of_service` ( + `terms_of_service_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `terms_text` text DEFAULT NULL, + `terms_url` varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL, + `terms_file` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL, + `applicability` varchar(50) DEFAULT NULL, + `date_created` datetime NOT NULL, + PRIMARY KEY (`terms_of_service_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + + +DROP TABLE IF EXISTS `time_blocks`; +CREATE TABLE `time_blocks` ( + `block_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `label` varchar(85) DEFAULT NULL, + `end_label` varchar(85) DEFAULT NULL, + `availability_code` tinyint(2) unsigned NOT NULL, + `layout_id` mediumint(8) unsigned NOT NULL, + `start_time` time NOT NULL, + `end_time` time NOT NULL, + `day_of_week` smallint(5) unsigned DEFAULT NULL, + PRIMARY KEY (`block_id`), + KEY `layout_id` (`layout_id`), + CONSTRAINT `time_blocks_ibfk_1` FOREIGN KEY (`layout_id`) REFERENCES `layouts` (`layout_id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + +INSERT INTO `time_blocks` (`block_id`, `label`, `end_label`, `availability_code`, `layout_id`, `start_time`, `end_time`, `day_of_week`) VALUES +(1, NULL, NULL, 2, 1, '00:00:00', '08:00:00', NULL), +(2, NULL, NULL, 1, 1, '08:00:00', '08:30:00', NULL), +(3, NULL, NULL, 1, 1, '08:30:00', '09:00:00', NULL), +(4, NULL, NULL, 1, 1, '09:00:00', '09:30:00', NULL), +(5, NULL, NULL, 1, 1, '09:30:00', '10:00:00', NULL), +(6, NULL, NULL, 1, 1, '10:00:00', '10:30:00', NULL), +(7, NULL, NULL, 1, 1, '10:30:00', '11:00:00', NULL), +(8, NULL, NULL, 1, 1, '11:00:00', '11:30:00', NULL), +(9, NULL, NULL, 1, 1, '11:30:00', '12:00:00', NULL), +(10, NULL, NULL, 1, 1, '12:00:00', '12:30:00', NULL), +(11, NULL, NULL, 1, 1, '12:30:00', '13:00:00', NULL), +(12, NULL, NULL, 1, 1, '13:00:00', '13:30:00', NULL), +(13, NULL, NULL, 1, 1, '13:30:00', '14:00:00', NULL), +(14, NULL, NULL, 1, 1, '14:00:00', '14:30:00', NULL), +(15, NULL, NULL, 1, 1, '14:30:00', '15:00:00', NULL), +(16, NULL, NULL, 1, 1, '15:00:00', '15:30:00', NULL), +(17, NULL, NULL, 1, 1, '15:30:00', '16:00:00', NULL), +(18, NULL, NULL, 1, 1, '16:00:00', '16:30:00', NULL), +(19, NULL, NULL, 1, 1, '16:30:00', '17:00:00', NULL), +(20, NULL, NULL, 1, 1, '17:00:00', '17:30:00', NULL), +(21, NULL, NULL, 1, 1, '17:30:00', '18:00:00', NULL), +(22, NULL, NULL, 2, 1, '18:00:00', '00:00:00', NULL); + +DROP TABLE IF EXISTS `users`; +CREATE TABLE `users` ( + `user_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `fname` varchar(85) DEFAULT NULL, + `lname` varchar(85) DEFAULT NULL, + `username` varchar(85) DEFAULT NULL, + `email` varchar(85) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci NOT NULL, + `password` varchar(85) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci NOT NULL, + `salt` varchar(85) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci NOT NULL, + `organization` varchar(85) DEFAULT NULL, + `position` varchar(85) DEFAULT NULL, + `phone` varchar(85) DEFAULT NULL, + `timezone` varchar(85) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci NOT NULL, + `language` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci NOT NULL, + `homepageid` tinyint(2) unsigned NOT NULL DEFAULT 1, + `date_created` datetime NOT NULL, + `last_modified` timestamp NULL DEFAULT NULL, + `lastlogin` datetime DEFAULT NULL, + `status_id` tinyint(2) unsigned NOT NULL, + `legacyid` char(16) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL, + `legacypassword` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL, + `public_id` varchar(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL, + `allow_calendar_subscription` tinyint(1) NOT NULL DEFAULT 0, + `default_schedule_id` smallint(5) unsigned DEFAULT NULL, + `credit_count` decimal(7,2) DEFAULT 0.00, + `terms_date_accepted` datetime DEFAULT NULL, + PRIMARY KEY (`user_id`), + UNIQUE KEY `public_id` (`public_id`), + KEY `status_id` (`status_id`), + CONSTRAINT `users_ibfk_1` FOREIGN KEY (`status_id`) REFERENCES `user_statuses` (`status_id`) ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + +INSERT INTO `users` (`user_id`, `fname`, `lname`, `username`, `email`, `password`, `salt`, `organization`, `position`, `phone`, `timezone`, `language`, `homepageid`, `date_created`, `last_modified`, `lastlogin`, `status_id`, `legacyid`, `legacypassword`, `public_id`, `allow_calendar_subscription`, `default_schedule_id`, `credit_count`, `terms_date_accepted`) VALUES +(1, 'User', 'User', 'user', 'user@example.com', '7b6aec38ff9b7650d64d0374194307bdde711425', '3b3dbb9b', 'XYZ Org Inc.', NULL, NULL, 'America/New_York', 'en_us', 1, '2025-09-05 11:00:52', NULL, '2008-09-16 01:59:00', 1, NULL, NULL, NULL, 0, NULL, 0.00, NULL), +(2, 'Admin', 'Admin', 'admin', 'admin@example.com', '70f3e748c6801656e4aae9dca6ee98ab137d952c', '4a04db87', 'ABC Org Inc.', NULL, NULL, 'America/New_York', 'en_us', 1, '2025-09-05 11:00:52', NULL, '2010-03-26 12:44:00', 1, NULL, NULL, NULL, 0, NULL, 0.00, NULL); + +DROP TABLE IF EXISTS `user_email_preferences`; +CREATE TABLE `user_email_preferences` ( + `user_id` mediumint(8) unsigned NOT NULL, + `event_category` varchar(45) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL, + `event_type` varchar(45) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL, + PRIMARY KEY (`user_id`,`event_category`,`event_type`), + CONSTRAINT `user_email_preferences_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + + +DROP TABLE IF EXISTS `user_groups`; +CREATE TABLE `user_groups` ( + `user_id` mediumint(8) unsigned NOT NULL, + `group_id` smallint(5) unsigned NOT NULL, + PRIMARY KEY (`group_id`,`user_id`), + KEY `user_id` (`user_id`), + KEY `group_id` (`group_id`), + CONSTRAINT `user_groups_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `user_groups_ibfk_2` FOREIGN KEY (`group_id`) REFERENCES `groups` (`group_id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + +INSERT INTO `user_groups` (`user_id`, `group_id`) VALUES +(2, 2); + +DROP TABLE IF EXISTS `user_preferences`; +CREATE TABLE `user_preferences` ( + `user_preferences_id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `user_id` mediumint(8) unsigned NOT NULL, + `name` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci NOT NULL, + `value` text CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL, + PRIMARY KEY (`user_preferences_id`), + KEY `user_id` (`user_id`), + CONSTRAINT `user_preferences_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + + +DROP TABLE IF EXISTS `user_resource_permissions`; +CREATE TABLE `user_resource_permissions` ( + `user_id` mediumint(8) unsigned NOT NULL, + `resource_id` smallint(5) unsigned NOT NULL, + `permission_id` tinyint(2) unsigned NOT NULL DEFAULT 1, + `permission_type` tinyint(3) unsigned NOT NULL DEFAULT 0, + PRIMARY KEY (`user_id`,`resource_id`), + KEY `user_id` (`user_id`), + KEY `resource_id` (`resource_id`), + KEY `user_id_2` (`user_id`), + KEY `resource_id_2` (`resource_id`), + CONSTRAINT `user_resource_permissions_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `user_resource_permissions_ibfk_2` FOREIGN KEY (`resource_id`) REFERENCES `resources` (`resource_id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + +INSERT INTO `user_resource_permissions` (`user_id`, `resource_id`, `permission_id`, `permission_type`) VALUES +(1, 1, 1, 0), +(1, 2, 1, 0), +(2, 1, 1, 0), +(2, 2, 1, 0); + +DROP TABLE IF EXISTS `user_session`; +CREATE TABLE `user_session` ( + `user_session_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, + `user_id` mediumint(8) unsigned NOT NULL, + `last_modified` datetime NOT NULL, + `session_token` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci NOT NULL, + `user_session_value` text CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci NOT NULL, + PRIMARY KEY (`user_session_id`), + KEY `user_session_user_id` (`user_id`), + KEY `user_session_session_token` (`session_token`), + CONSTRAINT `user_session_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + + +DROP TABLE IF EXISTS `user_statuses`; +CREATE TABLE `user_statuses` ( + `status_id` tinyint(2) unsigned NOT NULL, + `description` varchar(85) DEFAULT NULL, + PRIMARY KEY (`status_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci; + +INSERT INTO `user_statuses` (`status_id`, `description`) VALUES +(1, 'Active'), +(2, 'Awaiting'), +(3, 'Inactive') From c92bd7b387bc93c7dd295063cdabf77298912520 Mon Sep 17 00:00:00 2001 From: barakiva Date: Sun, 9 Nov 2025 14:39:14 +0200 Subject: [PATCH 2/3] feat: Devcontainer configuration - Added documentation for instructing contribution using devcontainers - Included instructions on using devcontainers without VScode --- docs/source/DEVELOPER-README.rst | 33 ++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/docs/source/DEVELOPER-README.rst b/docs/source/DEVELOPER-README.rst index 67b5e6dcd..a08e7395e 100644 --- a/docs/source/DEVELOPER-README.rst +++ b/docs/source/DEVELOPER-README.rst @@ -15,6 +15,39 @@ Working on the project so they can be looked over, and pull requested to the ``develop`` branch and will eventually end up in a release on ``master``. +Running The Project +---------------------- + +The easiest way to run LibreBooking locally is with VS Code’s +**Dev Containers** feature. This automatically provisions a fully configured environment with PHP, MariaDB, and all dependencies pre-installed. + +If Using VScode (Recommended) +~~~~~~~~~~~~~~~~~~~ +- Make sure `Docker `_ and the `Dev Containers `_ extension are both installed. +- Ensure Docker is running and port 80 is free. + + +Steps +^^^^^ +1. Open the project in VS Code. +2. Press **Ctrl+Shift+P** → select **Dev Containers: Reopen in Container** +3. Wait for the container to build (this may take several minutes the first time) +4. Once loaded, you will be inside a container with PHP, Composer,and MariaDB ready to use. +5. Browse via ``http://localhost:80`` + +If Not Using VScode +~~~~~~~~~~~~~~~~~~~ + +- Make sure `Docker `_ is installed. +- Ensure Docker is running and port 80 is free. + +Steps +^^^^^ +1. cd into the project root directory and run ``docker compose -f .devcontainer/docker-compose.devcontainer.yml up -d --build`` +2. Wait for the container to build (this may take several minutes the first time) +3. Once loaded, you will be inside a container with PHP, Composer,and MariaDB ready to use with your chosen IDE/Text Editor. +4. Browse via ``http://localhost:80`` + Design philosophy ----------------- From b629b9cde0036b8d9d4cb7576b347c685a59679f Mon Sep 17 00:00:00 2001 From: barakiva Date: Sun, 9 Nov 2025 14:51:47 +0200 Subject: [PATCH 3/3] docs: fixed formatting issue with sphinx --- docs/source/DEVELOPER-README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/DEVELOPER-README.rst b/docs/source/DEVELOPER-README.rst index a08e7395e..0cb474e1e 100644 --- a/docs/source/DEVELOPER-README.rst +++ b/docs/source/DEVELOPER-README.rst @@ -22,7 +22,7 @@ The easiest way to run LibreBooking locally is with VS Code’s **Dev Containers** feature. This automatically provisions a fully configured environment with PHP, MariaDB, and all dependencies pre-installed. If Using VScode (Recommended) -~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Make sure `Docker `_ and the `Dev Containers `_ extension are both installed. - Ensure Docker is running and port 80 is free.