DB structure of booking calendar (multi user version)

Tables

bdrbooking

CREATE TABLE `bdrbooking` (
  `booking_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `trash` bigint(10) NOT NULL DEFAULT '0',
  `sync_gid` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `is_new` bigint(10) NOT NULL DEFAULT '1',
  `status` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `sort_date` datetime DEFAULT NULL,
  `modification_date` datetime DEFAULT NULL,
  `form` text COLLATE utf8mb4_unicode_ci,
  `hash` text COLLATE utf8mb4_unicode_ci,
  `booking_type` bigint(10) NOT NULL DEFAULT '1',
  `remark` text COLLATE utf8mb4_unicode_ci,
  `cost` float(15,2) NOT NULL DEFAULT '0.00',
  `pay_status` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `pay_request` smallint(3) NOT NULL DEFAULT '0',
  PRIMARY KEY (`booking_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci

select * from bdrbooking ;

+------------+
| booking_id | trash | sync_gid | is_new | status | sort_date           | modification_date   | form                                                                                                                                                                                                                                                                                      | hash                             | booking_type | remark | cost | pay_status | pay_request |
+------------+
|          1 |     0 |          |      1 |        | 2018-11-24 00:00:00 | 2018-11-18 14:15:48 | text^name1^Victoria~text^secondname1^Smith~email^email1^victoria@wpbookingcalendar.com~text^phone1^458-77-88~select-one^visitors1^2~select-one^children1^0~textarea^details1^Please, reserve an apartment with fresh flowers.~checkbox^term_and_condition1[]^I Accept term and conditions | 060fd5b60901365c5f5b6f7125294f26 |            1 | NULL   | 0.00 |            |           0 |

bdrbooking_coupons

CREATE TABLE `bdrbooking_coupons` (
  `coupon_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `coupon_active` int(10) NOT NULL DEFAULT '1',
  `coupon_code` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `coupon_value` float(7,2) NOT NULL DEFAULT '0.00',
  `coupon_type` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `expiration_date` datetime DEFAULT NULL,
  `coupon_min_sum` float(7,2) NOT NULL DEFAULT '0.00',
  `support_bk_types` text COLLATE utf8mb4_unicode_ci,
  `users` bigint(20) DEFAULT '1',
  PRIMARY KEY (`coupon_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci

No data


bdrbooking_seasons

CREATE TABLE `bdrbooking_seasons` (
  `booking_filter_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `filter` text COLLATE utf8mb4_unicode_ci,
  `users` bigint(20) DEFAULT '1',
  PRIMARY KEY (`booking_filter_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci 

SELECT * FROM bdrbooking_seasons;

+-------------------+
| booking_filter_id | title            | filter                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | users |
+-------------------+
|                 1 | Weekend          | a:6:{s:8:"weekdays";a:7:{i:0;s:2:"On";i:1;s:3:"Off";i:2;s:3:"Off";i:3;s:3:"Off";i:4;s:3:"Off";i:5;s:3:"Off";i:6;s:2:"On";}s:4:"days";a:31:{i:1;s:2:"On";i:2;s:2:"On";i:3;s:2:"On";i:4;s:2:"On";i:5;s:2:"On";i:6;s:2:"On";i:7;s:2:"On";i:8;s:2:"On";i:9;s:2:"On";i:10;s:2:"On";i:11;s:2:"On";i:12;s:2:"On";i:13;s:2:"On";i:14;s:2:"On";i:15;s:2:"On";i:16;s:2:"On";i:17;s:2:"On";i:18;s:2:"On";i:19;s:2:"On";i:20;s:2:"On";i:21;s:2:"On";i:22;s:2:"On";i:23;s:2:"On";i:24;s:2:"On";i:25;s:2:"On";i:26;s:2:"On";i:27;s:2:"On";i:28;s:2:"On";i:29;s:2:"On";i:30;s:2:"On";i:31;s:2:"On";}s:7:"monthes";a:12:{i:1;s:2:"On";i:2;s:2:"On";i:3;s:2:"On";i:4;s:2:"On";i:5;s:2:"On";i:6;s:2:"On";i:7;s:2:"On";i:8;s:2:"On";i:9;s:2:"On";i:10;s:2:"On";i:11;s:2:"On";i:12;s:2:"On";}s:4:"year";a:12:{i:2013;s:3:"Off";i:2014;s:2:"On";i:2015;s:2:"On";i:2016;s:2:"On";i:2017;s:2:"On";i:2018;s:2:"On";i:2019;s:2:"On";i:2020;s:2:"On";i:2021;s:3:"Off";i:2022;s:3:"Off";i:2023;s:3:"Off";i:2024;s:3:"Off";}s:10:"start_time";s:0:"";s:8:"end_time";s:0:"";}                 |     1 |
|                 2 | 1 - 14, December | a:6:{s:8:"weekdays";a:7:{i:0;s:2:"On";i:1;s:2:"On";i:2;s:2:"On";i:3;s:2:"On";i:4;s:2:"On";i:5;s:2:"On";i:6;s:2:"On";}s:4:"days";a:31:{i:1;s:2:"On";i:2;s:2:"On";i:3;s:2:"On";i:4;s:2:"On";i:5;s:2:"On";i:6;s:2:"On";i:7;s:2:"On";i:8;s:2:"On";i:9;s:2:"On";i:10;s:2:"On";i:11;s:2:"On";i:12;s:2:"On";i:13;s:2:"On";i:14;s:2:"On";i:15;s:3:"Off";i:16;s:3:"Off";i:17;s:3:"Off";i:18;s:3:"Off";i:19;s:3:"Off";i:20;s:3:"Off";i:21;s:3:"Off";i:22;s:3:"Off";i:23;s:3:"Off";i:24;s:3:"Off";i:25;s:3:"Off";i:26;s:3:"Off";i:27;s:3:"Off";i:28;s:3:"Off";i:29;s:3:"Off";i:30;s:3:"Off";i:31;s:3:"Off";}s:7:"monthes";a:12:{i:1;s:3:"Off";i:2;s:3:"Off";i:3;s:3:"Off";i:4;s:3:"Off";i:5;s:3:"Off";i:6;s:3:"Off";i:7;s:3:"Off";i:8;s:3:"Off";i:9;s:3:"Off";i:10;s:3:"Off";i:11;s:3:"Off";i:12;s:2:"On";}s:4:"year";a:12:{i:2017;s:3:"Off";i:2018;s:2:"On";i:2019;s:3:"Off";i:2020;s:3:"Off";i:2021;s:3:"Off";i:2022;s:3:"Off";i:2023;s:3:"Off";i:2024;s:3:"Off";i:2025;s:3:"Off";i:2026;s:3:"Off";i:2027;s:3:"Off";i:2028;s:3:"Off";}s:10:"start_time";s:0:"";s:8:"end_time";s:0:"";} |     1 |
|                 3 | High season      | a:6:{s:8:"weekdays";a:7:{i:0;s:2:"On";i:1;s:2:"On";i:2;s:2:"On";i:3;s:2:"On";i:4;s:2:"On";i:5;s:2:"On";i:6;s:2:"On";}s:4:"days";a:31:{i:1;s:2:"On";i:2;s:2:"On";i:3;s:2:"On";i:4;s:2:"On";i:5;s:2:"On";i:6;s:2:"On";i:7;s:2:"On";i:8;s:2:"On";i:9;s:2:"On";i:10;s:2:"On";i:11;s:2:"On";i:12;s:2:"On";i:13;s:2:"On";i:14;s:2:"On";i:15;s:2:"On";i:16;s:2:"On";i:17;s:2:"On";i:18;s:2:"On";i:19;s:2:"On";i:20;s:2:"On";i:21;s:2:"On";i:22;s:2:"On";i:23;s:2:"On";i:24;s:2:"On";i:25;s:2:"On";i:26;s:2:"On";i:27;s:2:"On";i:28;s:2:"On";i:29;s:2:"On";i:30;s:2:"On";i:31;s:2:"On";}s:7:"monthes";a:12:{i:1;s:3:"Off";i:2;s:3:"Off";i:3;s:3:"Off";i:4;s:3:"Off";i:5;s:2:"On";i:6;s:2:"On";i:7;s:2:"On";i:8;s:2:"On";i:9;s:2:"On";i:10;s:3:"Off";i:11;s:3:"Off";i:12;s:3:"Off";}s:4:"year";a:12:{i:2013;s:3:"Off";i:2014;s:2:"On";i:2015;s:2:"On";i:2016;s:2:"On";i:2017;s:2:"On";i:2018;s:2:"On";i:2019;s:2:"On";i:2020;s:2:"On";i:2021;s:3:"Off";i:2022;s:3:"Off";i:2023;s:3:"Off";i:2024;s:3:"Off";}s:10:"start_time";s:0:"";s:8:"end_time";s:0:"";}               |     1 |

bdrbooking_types_meta

CREATE TABLE `bdrbooking_types_meta` (
  `meta_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `type_id` bigint(20) NOT NULL DEFAULT '0',
  `meta_key` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `meta_value` text COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`meta_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci

No data


bdrbookingdates

CREATE TABLE `bdrbookingdates` (
  `booking_id` bigint(20) unsigned NOT NULL,
  `booking_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `approved` bigint(20) unsigned NOT NULL DEFAULT '0',
  `type_id` bigint(20) DEFAULT NULL,
  UNIQUE KEY `booking_id_dates` (`booking_id`,`booking_date`,`type_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci

Data

+------------+---------------------+----------+---------+
| booking_id | booking_date        | approved | type_id |
+------------+---------------------+----------+---------+
|          1 | 2018-11-24 00:00:00 |        0 |    NULL |
|          1 | 2018-11-25 00:00:00 |        0 |    NULL |
|          1 | 2018-11-26 00:00:00 |        0 |    NULL |
+------------+---------------------+----------+---------+

bdrbookingtypes

CREATE TABLE `bdrbookingtypes` (
  `booking_type_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
  `users` bigint(20) DEFAULT '1',
  `import` text COLLATE utf8mb4_unicode_ci,
  `export` text COLLATE utf8mb4_unicode_ci,
  `cost` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0',
  `default_form` varchar(249) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'standard',
  `prioritet` int(4) DEFAULT '0',
  `parent` bigint(20) DEFAULT '0',
  `visitors` bigint(20) DEFAULT '1',
  PRIMARY KEY (`booking_type_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci 

Data

+------------+---------------------+----------+---------+
| booking_id | booking_date        | approved | type_id |
+------------+---------------------+----------+---------+
|          1 | 2018-11-24 00:00:00 |        0 |    NULL |
|          1 | 2018-11-25 00:00:00 |        0 |    NULL |
|          1 | 2018-11-26 00:00:00 |        0 |    NULL |
+------------+---------------------+----------+---------+