PluginProbe
Fluent Booking – The Ultimate Appointments Scheduling, Events Booking, Events Calendar Solution / 1.6.0
Fluent Booking – The Ultimate Appointments Scheduling, Events Booking, Events Calendar Solution v1.6.0
2.4.0 2.3.0 2.2.5 2.2.0 2.1.2 2.1.1 trunk 1.10.0 1.10.01 1.10.02 1.5.0 1.5.01 1.5.02 1.5.1 1.5.10 1.5.20 1.5.21 1.5.22 1.5.23 1.5.24 1.5.25 1.6.0 1.7.0 1.7.1 1.7.2 All 33 releases
fluent-booking / database / Migrations / BookingMigrator.php

BookingMigrator.php in Fluent Booking – The Ultimate Appointments Scheduling, Events Booking, Events Calendar Solution 1.6.0, at database/Migrations/BookingMigrator.php

75 lines 3.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentBooking\Database\Migrations;
4
5 class BookingMigrator
6 {
7 static $tableName = 'fcal_bookings';
8
9 public static function migrate()
10 {
11 global $wpdb;
12
13 $charsetCollate = $wpdb->get_charset_collate();
14
15 $table = $wpdb->prefix . static::$tableName;
16
17 if ($wpdb->get_var($wpdb->prepare("SHOW TABLES LIKE %s", $table)) != $table) { // phpcs:ignore WordPress.DB.DirectDatabaseQuery
18 $sql = "CREATE TABLE $table (
19 `id` BIGINT(20) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
20 `hash` VARCHAR(192) NULL,
21 `calendar_id` BIGINT(20) UNSIGNED NOT NULL,
22 `event_id` BIGINT(20) UNSIGNED NOT NULL,
23 `group_id` BIGINT(20) UNSIGNED NULL,
24 `fcrm_id` BIGINT(20) UNSIGNED NULL,
25 `parent_id` BIGINT(20) UNSIGNED NULL,
26 `host_user_id` BIGINT(20) UNSIGNED NULL,
27 `person_user_id` BIGINT(20) UNSIGNED NULL,
28 `person_contact_id` BIGINT(20) UNSIGNED NULL,
29 `person_time_zone` VARCHAR(100) NULL,
30 `start_time` TIMESTAMP NULL,
31 `end_time` TIMESTAMP NULL,
32 `slot_minutes` INT(11) UNSIGNED NOT NULL,
33 `first_name` VARCHAR(192) NULL,
34 `last_name` VARCHAR(192) NULL,
35 `email` VARCHAR(192) NULL,
36 `message` TEXT NULL,
37 `internal_note` TEXT NULL,
38 `phone` VARCHAR(100) NULL,
39 `country` VARCHAR(100) NULL,
40 `ip_address` VARCHAR(192) NULL,
41 `browser` VARCHAR(192) NULL,
42 `device` VARCHAR(192) NULL,
43 `other_info` LONGTEXT NULL,
44 `location_details` LONGTEXT NULL,
45 `cancelled_by` BIGINT(20) UNSIGNED NULL,
46 `status` VARCHAR(20) NOT NULL DEFAULT 'scheduled',
47 `source` VARCHAR(20) NOT NULL DEFAULT 'web',
48 `booking_type` VARCHAR(20) NOT NULL DEFAULT 'scheduling',
49 `event_type` VARCHAR(20) NOT NULL DEFAULT 'single', /* singe|group */
50 `payment_status` VARCHAR(20) NULL, /* pending|paid */
51 `payment_method` VARCHAR(20) NULL,
52 `source_url` TEXT NULL,
53 `source_id` BIGINT(20) UNSIGNED NULL,
54 `utm_source` VARCHAR(192) NULL DEFAULT '',
55 `utm_medium` VARCHAR(192) NULL DEFAULT '',
56 `utm_campaign` VARCHAR(192) NULL DEFAULT '',
57 `utm_term` VARCHAR(192) NULL DEFAULT '',
58 `created_at` TIMESTAMP NULL,
59 `updated_at` TIMESTAMP NULL,
60 KEY `fcal_b_parent_id` (`parent_id`),
61 KEY `fcal_b_hash` (`hash`),
62 KEY `fcal_b_calendar_id` (`calendar_id`),
63 KEY `fcal_b_fcrm_id` (`fcrm_id`),
64 KEY `fcal_b_event_id` (`event_id`),
65 KEY `fcal_b_booking_type` (`booking_type`),
66 KEY `fcal_b_start_time` (`start_time`)
67 ) $charsetCollate;";
68
69 require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
70
71 dbDelta($sql);
72 }
73 }
74 }
75