SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: `eventsch1089`
--
-- --------------------------------------------------------
--
-- Table structure for table `analytics_appearances_daily`
--
CREATE TABLE `analytics_appearances_daily` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`role_id` bigint(20) unsigned NOT NULL,
`schedule_role_id` bigint(20) unsigned NOT NULL,
`date` date NOT NULL,
`desktop_views` int(10) unsigned NOT NULL DEFAULT '0',
`mobile_views` int(10) unsigned NOT NULL DEFAULT '0',
`tablet_views` int(10) unsigned NOT NULL DEFAULT '0',
`unknown_views` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `analytics_appearances_daily_role_id_schedule_role_id_date_unique` (`role_id`,`schedule_role_id`,`date`),
KEY `analytics_appearances_daily_schedule_role_id_date_index` (`schedule_role_id`,`date`),
KEY `analytics_appearances_daily_date_index` (`date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `analytics_daily`
--
CREATE TABLE `analytics_daily` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`role_id` bigint(20) unsigned NOT NULL,
`date` date NOT NULL,
`desktop_views` int(10) unsigned NOT NULL DEFAULT '0',
`mobile_views` int(10) unsigned NOT NULL DEFAULT '0',
`tablet_views` int(10) unsigned NOT NULL DEFAULT '0',
`unknown_views` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `analytics_daily_role_id_date_unique` (`role_id`,`date`),
KEY `analytics_daily_date_index` (`date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `analytics_events_daily`
--
CREATE TABLE `analytics_events_daily` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`event_id` bigint(20) unsigned NOT NULL,
`date` date NOT NULL,
`desktop_views` int(10) unsigned NOT NULL DEFAULT '0',
`mobile_views` int(10) unsigned NOT NULL DEFAULT '0',
`tablet_views` int(10) unsigned NOT NULL DEFAULT '0',
`unknown_views` int(10) unsigned NOT NULL DEFAULT '0',
`sales_count` int(10) unsigned NOT NULL DEFAULT '0',
`revenue` decimal(13,3) NOT NULL DEFAULT '0.000',
`promo_sales_count` int(10) unsigned NOT NULL DEFAULT '0',
`promo_discount_total` decimal(13,3) NOT NULL DEFAULT '0.000',
PRIMARY KEY (`id`),
UNIQUE KEY `analytics_events_daily_event_id_date_unique` (`event_id`,`date`),
KEY `analytics_events_daily_date_index` (`date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `analytics_referrers_daily`
--
CREATE TABLE `analytics_referrers_daily` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`role_id` bigint(20) unsigned NOT NULL,
`date` date NOT NULL,
`source` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
`domain` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`views` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `referrers_daily_unique` (`role_id`,`date`,`source`,`domain`),
KEY `analytics_referrers_daily_role_id_date_index` (`role_id`,`date`),
KEY `analytics_referrers_daily_date_index` (`date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `audit_logs`
--
CREATE TABLE `audit_logs` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) unsigned DEFAULT NULL,
`action` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
`model_type` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`model_id` bigint(20) unsigned DEFAULT NULL,
`old_values` json DEFAULT NULL,
`new_values` json DEFAULT NULL,
`ip_address` varchar(45) COLLATE utf8mb4_unicode_ci NOT NULL,
`user_agent` varchar(512) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`metadata` text COLLATE utf8mb4_unicode_ci,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `audit_logs_user_id_index` (`user_id`),
KEY `audit_logs_action_index` (`action`),
KEY `audit_logs_model_type_index` (`model_type`),
KEY `audit_logs_created_at_index` (`created_at`),
KEY `audit_logs_model_type_model_id_index` (`model_type`,`model_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `backup_jobs`
--
CREATE TABLE `backup_jobs` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) unsigned NOT NULL,
`type` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
`status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
`role_ids` json DEFAULT NULL,
`file_path` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`file_expires_at` timestamp NULL DEFAULT NULL,
`progress` json DEFAULT NULL,
`report` json DEFAULT NULL,
`error_message` text COLLATE utf8mb4_unicode_ci,
`include_images` tinyint(1) NOT NULL DEFAULT '0',
`started_at` timestamp NULL DEFAULT NULL,
`completed_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `backup_jobs_user_id_type_status_index` (`user_id`,`type`,`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `blog_posts`
--
CREATE TABLE `blog_posts` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`slug` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`content` text COLLATE utf8mb4_unicode_ci NOT NULL,
`excerpt` text COLLATE utf8mb4_unicode_ci,
`tags` json DEFAULT NULL,
`published_at` timestamp NULL DEFAULT NULL,
`meta_title` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`meta_description` text COLLATE utf8mb4_unicode_ci,
`featured_image` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`author_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Event Schedule Team',
`is_published` tinyint(1) NOT NULL DEFAULT '0',
`view_count` int(11) NOT NULL DEFAULT '0',
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `blog_posts_slug_unique` (`slug`),
KEY `blog_posts_published_at_is_published_index` (`published_at`,`is_published`),
KEY `blog_posts_slug_index` (`slug`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `boost_ads`
--
CREATE TABLE `boost_ads` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`boost_campaign_id` bigint(20) unsigned NOT NULL,
`meta_ad_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`meta_creative_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`headline` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`primary_text` text COLLATE utf8mb4_unicode_ci,
`description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`call_to_action` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'LEARN_MORE',
`image_url` varchar(2048) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`image_hash` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`destination_url` varchar(2048) COLLATE utf8mb4_unicode_ci NOT NULL,
`variant` char(1) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`is_winner` tinyint(1) NOT NULL DEFAULT '0',
`status` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
`meta_status` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`meta_rejection_reason` text COLLATE utf8mb4_unicode_ci,
`impressions` bigint(20) unsigned NOT NULL DEFAULT '0',
`reach` bigint(20) unsigned NOT NULL DEFAULT '0',
`clicks` bigint(20) unsigned NOT NULL DEFAULT '0',
`spend` decimal(10,2) NOT NULL DEFAULT '0.00',
`ctr` decimal(8,4) NOT NULL DEFAULT '0.0000',
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `boost_ads_boost_campaign_id_status_index` (`boost_campaign_id`,`status`),
KEY `boost_ads_meta_ad_id_index` (`meta_ad_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `boost_billing_records`
--
CREATE TABLE `boost_billing_records` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`boost_campaign_id` bigint(20) unsigned DEFAULT NULL,
`type` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
`amount` decimal(10,2) NOT NULL,
`meta_spend` decimal(10,2) DEFAULT NULL,
`markup_amount` decimal(10,2) DEFAULT NULL,
`stripe_payment_intent_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`stripe_refund_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
`notes` text COLLATE utf8mb4_unicode_ci,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `boost_billing_records_boost_campaign_id_type_index` (`boost_campaign_id`,`type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `boost_campaigns`
--
CREATE TABLE `boost_campaigns` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`event_id` bigint(20) unsigned DEFAULT NULL,
`role_id` bigint(20) unsigned DEFAULT NULL,
`user_id` bigint(20) unsigned DEFAULT NULL,
`meta_campaign_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`meta_adset_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`objective` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'OUTCOME_AWARENESS',
`status` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'draft',
`meta_status` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`meta_rejection_reason` text COLLATE utf8mb4_unicode_ci,
`daily_budget` decimal(10,2) DEFAULT NULL,
`lifetime_budget` decimal(10,2) DEFAULT NULL,
`budget_type` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'lifetime',
`currency_code` varchar(3) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'USD',
`scheduled_start` timestamp NULL DEFAULT NULL,
`scheduled_end` timestamp NULL DEFAULT NULL,
`targeting` json DEFAULT NULL,
`placements` json DEFAULT NULL,
`user_budget` decimal(10,2) NOT NULL,
`markup_rate` decimal(5,4) NOT NULL DEFAULT '0.2000',
`total_charged` decimal(10,2) DEFAULT NULL,
`actual_spend` decimal(10,2) DEFAULT NULL,
`stripe_payment_intent_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`billing_status` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
`impressions` bigint(20) unsigned NOT NULL DEFAULT '0',
`reach` bigint(20) unsigned NOT NULL DEFAULT '0',
`clicks` bigint(20) unsigned NOT NULL DEFAULT '0',
`ctr` decimal(8,4) NOT NULL DEFAULT '0.0000',
`cpc` decimal(10,2) NOT NULL DEFAULT '0.00',
`cpm` decimal(10,2) NOT NULL DEFAULT '0.00',
`conversions` int(10) unsigned NOT NULL DEFAULT '0',
`daily_analytics` json DEFAULT NULL,
`analytics_synced_at` timestamp NULL DEFAULT NULL,
`meta_synced_at` timestamp NULL DEFAULT NULL,
`budget_alert_sent_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `boost_campaigns_stripe_payment_intent_id_unique` (`stripe_payment_intent_id`),
KEY `boost_campaigns_event_id_status_index` (`event_id`,`status`),
KEY `boost_campaigns_role_id_status_index` (`role_id`,`status`),
KEY `boost_campaigns_user_id_status_index` (`user_id`,`status`),
KEY `boost_campaigns_meta_campaign_id_index` (`meta_campaign_id`),
KEY `boost_campaigns_status_billing_status_index` (`status`,`billing_status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `cache`
--
CREATE TABLE `cache` (
`key` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`value` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL,
`expiration` int(11) NOT NULL,
PRIMARY KEY (`key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `cache_locks`
--
CREATE TABLE `cache_locks` (
`key` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`owner` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`expiration` int(11) NOT NULL,
PRIMARY KEY (`key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `carpool_offers`
--
CREATE TABLE `carpool_offers` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`event_id` bigint(20) unsigned NOT NULL,
`user_id` bigint(20) unsigned NOT NULL,
`role_id` bigint(20) unsigned DEFAULT NULL,
`event_date` date DEFAULT NULL,
`direction` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'to_event',
`city` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`departure_time` time DEFAULT NULL,
`meeting_point` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`total_spots` tinyint(3) unsigned NOT NULL,
`note` text COLLATE utf8mb4_unicode_ci,
`status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'active',
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `carpool_offers_role_id_foreign` (`role_id`),
KEY `carpool_offers_event_id_event_date_status_index` (`event_id`,`event_date`,`status`),
KEY `carpool_offers_user_id_index` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `carpool_reports`
--
CREATE TABLE `carpool_reports` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`reporter_user_id` bigint(20) unsigned NOT NULL,
`reported_user_id` bigint(20) unsigned NOT NULL,
`carpool_offer_id` bigint(20) unsigned NOT NULL,
`reason` text COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `carpool_reports_offer_reporter_reported_unique` (`carpool_offer_id`,`reporter_user_id`,`reported_user_id`),
KEY `carpool_reports_reporter_user_id_index` (`reporter_user_id`),
KEY `carpool_reports_reported_user_id_index` (`reported_user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `carpool_requests`
--
CREATE TABLE `carpool_requests` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`carpool_offer_id` bigint(20) unsigned NOT NULL,
`user_id` bigint(20) unsigned NOT NULL,
`message` text COLLATE utf8mb4_unicode_ci,
`status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
`reminder_sent_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `carpool_requests_carpool_offer_id_user_id_unique` (`carpool_offer_id`,`user_id`),
KEY `carpool_requests_user_id_index` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `carpool_reviews`
--
CREATE TABLE `carpool_reviews` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`carpool_offer_id` bigint(20) unsigned NOT NULL,
`reviewer_user_id` bigint(20) unsigned NOT NULL,
`reviewed_user_id` bigint(20) unsigned NOT NULL,
`rating` tinyint(3) unsigned NOT NULL,
`comment` text COLLATE utf8mb4_unicode_ci,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `carpool_reviews_offer_reviewer_reviewed_unique` (`carpool_offer_id`,`reviewer_user_id`,`reviewed_user_id`),
KEY `carpool_reviews_reviewer_user_id_index` (`reviewer_user_id`),
KEY `carpool_reviews_reviewed_user_id_index` (`reviewed_user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `events`
--
CREATE TABLE `events` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) unsigned NOT NULL,
`venue_id_bak` bigint(20) unsigned DEFAULT NULL,
`published_at` datetime DEFAULT NULL,
`is_accepted` tinyint(1) DEFAULT NULL,
`starts_at` datetime DEFAULT NULL,
`duration` float DEFAULT NULL,
`description` text COLLATE utf8mb4_unicode_ci,
`description_html` text COLLATE utf8mb4_unicode_ci,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`days_of_week` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`recurring_frequency` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`recurring_interval` int(11) DEFAULT NULL,
`recurring_end_type` enum('never','on_date','after_events') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'never',
`recurring_end_value` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`recurring_include_dates` text COLLATE utf8mb4_unicode_ci,
`recurring_exclude_dates` text COLLATE utf8mb4_unicode_ci,
`event_url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`flyer_image_url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`event_password` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`is_private` tinyint(1) NOT NULL DEFAULT '0',
`tickets_enabled` tinyint(1) NOT NULL DEFAULT '0',
`rsvp_enabled` tinyint(1) NOT NULL DEFAULT '0',
`rsvp_limit` int(10) unsigned DEFAULT NULL,
`rsvp_sold` text COLLATE utf8mb4_unicode_ci,
`feedback_enabled` tinyint(1) DEFAULT NULL,
`ticket_currency_code` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'USD',
`ticket_price` decimal(13,3) DEFAULT NULL,
`coupon_code` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`ticket_notes` text COLLATE utf8mb4_unicode_ci,
`terms_url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`total_tickets_mode` enum('individual','combined') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'individual',
`payment_method` enum('cash','stripe','invoiceninja','payment_url') COLLATE utf8mb4_unicode_ci DEFAULT 'cash',
`invoiceninja_subscription_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`invoiceninja_subscription_url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`payment_instructions` text COLLATE utf8mb4_unicode_ci,
`payment_instructions_html` text COLLATE utf8mb4_unicode_ci,
`expire_unpaid_tickets` int(11) NOT NULL DEFAULT '0',
`ticket_notes_html` text COLLATE utf8mb4_unicode_ci,
`creator_role_id` bigint(20) unsigned DEFAULT NULL,
`slug` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`registration_url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`name_en` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`short_description` text COLLATE utf8mb4_unicode_ci,
`short_description_en` text COLLATE utf8mb4_unicode_ci,
`description_en` text COLLATE utf8mb4_unicode_ci,
`description_html_en` text COLLATE utf8mb4_unicode_ci,
`category_id` int(10) unsigned DEFAULT NULL,
`custom_fields` text COLLATE utf8mb4_unicode_ci,
`custom_field_values` text COLLATE utf8mb4_unicode_ci,
`translation_attempts` smallint(5) unsigned NOT NULL DEFAULT '0',
`last_translated_at` timestamp NULL DEFAULT NULL,
`last_notified_fan_content_count` int(11) DEFAULT '0',
`ask_phone` tinyint(1) NOT NULL DEFAULT '0',
`require_phone` tinyint(1) NOT NULL DEFAULT '0',
`country_code_phone` tinyint(1) NOT NULL DEFAULT '0',
`individual_tickets` tinyint(1) NOT NULL DEFAULT '0',
`individual_ticket_fields` tinyint(1) NOT NULL DEFAULT '0',
`fan_comments_enabled` tinyint(1) DEFAULT NULL,
`fan_photos_enabled` tinyint(1) DEFAULT NULL,
`fan_videos_enabled` tinyint(1) DEFAULT NULL,
`agenda_ai_prompt` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`agenda_image_url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `events_user_id_foreign` (`user_id`),
KEY `events_creator_role_id_foreign` (`creator_role_id`),
KEY `events_slug_index` (`slug`),
KEY `events_starts_at_index` (`starts_at`),
KEY `events_created_at_index` (`created_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `event_comments`
--
CREATE TABLE `event_comments` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`event_id` bigint(20) unsigned NOT NULL,
`event_part_id` bigint(20) unsigned DEFAULT NULL,
`event_date` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`user_id` bigint(20) unsigned DEFAULT NULL,
`comment` text COLLATE utf8mb4_unicode_ci NOT NULL,
`is_approved` tinyint(1) NOT NULL DEFAULT '0',
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `event_comments_user_id_foreign` (`user_id`),
KEY `event_comments_event_id_is_approved_index` (`event_id`,`is_approved`),
KEY `event_comments_event_part_id_is_approved_index` (`event_part_id`,`is_approved`),
KEY `event_comments_event_id_event_date_is_approved_index` (`event_id`,`event_date`,`is_approved`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `event_feedbacks`
--
CREATE TABLE `event_feedbacks` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`event_id` bigint(20) unsigned NOT NULL,
`sale_id` bigint(20) unsigned NOT NULL,
`event_date` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`rating` tinyint(3) unsigned NOT NULL,
`comment` text COLLATE utf8mb4_unicode_ci,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `event_feedbacks_sale_id_unique` (`sale_id`),
KEY `event_feedbacks_event_id_event_date_index` (`event_id`,`event_date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `event_parts`
--
CREATE TABLE `event_parts` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`event_id` bigint(20) unsigned NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`name_en` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`description` text COLLATE utf8mb4_unicode_ci,
`description_en` text COLLATE utf8mb4_unicode_ci,
`description_html_en` text COLLATE utf8mb4_unicode_ci,
`description_html` text COLLATE utf8mb4_unicode_ci,
`start_time` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`end_time` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`sort_order` int(11) NOT NULL DEFAULT '0',
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`translation_attempts` smallint(5) unsigned NOT NULL DEFAULT '0',
`last_translated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `event_parts_event_id_foreign` (`event_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `event_photos`
--
CREATE TABLE `event_photos` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`event_id` bigint(20) unsigned NOT NULL,
`event_part_id` bigint(20) unsigned DEFAULT NULL,
`event_date` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`user_id` bigint(20) unsigned DEFAULT NULL,
`photo_url` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`is_approved` tinyint(1) NOT NULL DEFAULT '0',
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `event_photos_user_id_foreign` (`user_id`),
KEY `event_photos_event_id_is_approved_index` (`event_id`,`is_approved`),
KEY `event_photos_event_part_id_is_approved_index` (`event_part_id`,`is_approved`),
KEY `event_photos_event_id_event_date_is_approved_index` (`event_id`,`event_date`,`is_approved`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `event_polls`
--
CREATE TABLE `event_polls` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`event_id` bigint(20) unsigned NOT NULL,
`question` varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL,
`options` json NOT NULL,
`is_active` tinyint(1) NOT NULL DEFAULT '1',
`sort_order` int(10) unsigned NOT NULL DEFAULT '0',
`allow_user_options` tinyint(1) NOT NULL DEFAULT '0',
`require_option_approval` tinyint(1) NOT NULL DEFAULT '0',
`pending_options` json DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `event_polls_event_id_is_active_index` (`event_id`,`is_active`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `event_poll_votes`
--
CREATE TABLE `event_poll_votes` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`event_poll_id` bigint(20) unsigned NOT NULL,
`user_id` bigint(20) unsigned NOT NULL,
`option_index` smallint(5) unsigned NOT NULL,
`event_date` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `event_poll_votes_event_poll_id_user_id_event_date_unique` (`event_poll_id`,`user_id`,`event_date`),
KEY `event_poll_votes_user_id_foreign` (`user_id`),
KEY `event_poll_votes_event_poll_id_option_index_index` (`event_poll_id`,`option_index`),
KEY `event_poll_votes_event_poll_id_event_date_index` (`event_poll_id`,`event_date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `event_role`
--
CREATE TABLE `event_role` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`event_id` bigint(20) unsigned NOT NULL,
`role_id` bigint(20) unsigned NOT NULL,
`is_accepted` tinyint(1) DEFAULT NULL,
`caldav_event_uid` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`caldav_event_etag` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`name_translated` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`description_translated` text COLLATE utf8mb4_unicode_ci,
`description_html_translated` text COLLATE utf8mb4_unicode_ci,
`short_description_translated` text COLLATE utf8mb4_unicode_ci,
`google_event_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`translation_attempts` smallint(5) unsigned NOT NULL DEFAULT '0',
`last_translated_at` timestamp NULL DEFAULT NULL,
`group_id` bigint(20) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `event_role_role_id_event_id_unique` (`role_id`,`event_id`),
KEY `event_role_caldav_event_uid_index` (`caldav_event_uid`),
KEY `event_role_event_id_index` (`event_id`),
KEY `event_role_google_event_id_index` (`google_event_id`),
KEY `event_role_group_id_foreign` (`group_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `event_videos`
--
CREATE TABLE `event_videos` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`event_id` bigint(20) unsigned NOT NULL,
`event_part_id` bigint(20) unsigned DEFAULT NULL,
`event_date` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`user_id` bigint(20) unsigned DEFAULT NULL,
`youtube_url` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`is_approved` tinyint(1) NOT NULL DEFAULT '0',
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `event_videos_user_id_foreign` (`user_id`),
KEY `event_videos_event_id_is_approved_index` (`event_id`,`is_approved`),
KEY `event_videos_event_part_id_is_approved_index` (`event_part_id`,`is_approved`),
KEY `event_videos_event_id_event_date_is_approved_index` (`event_id`,`event_date`,`is_approved`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `failed_jobs`
--
CREATE TABLE `failed_jobs` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`uuid` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`connection` text COLLATE utf8mb4_unicode_ci NOT NULL,
`queue` text COLLATE utf8mb4_unicode_ci NOT NULL,
`payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
`exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
`failed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `groups`
--
CREATE TABLE `groups` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`name_en` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`slug` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`color` varchar(7) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`role_id` bigint(20) unsigned NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `groups_slug_role_id_unique` (`slug`,`role_id`),
KEY `groups_role_id_foreign` (`role_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `jobs`
--
CREATE TABLE `jobs` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`queue` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
`attempts` tinyint(3) unsigned NOT NULL,
`reserved_at` int(10) unsigned DEFAULT NULL,
`available_at` int(10) unsigned NOT NULL,
`created_at` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`),
KEY `jobs_queue_index` (`queue`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `job_batches`
--
CREATE TABLE `job_batches` (
`id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`total_jobs` int(11) NOT NULL,
`pending_jobs` int(11) NOT NULL,
`failed_jobs` int(11) NOT NULL,
`failed_job_ids` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
`options` mediumtext COLLATE utf8mb4_unicode_ci,
`cancelled_at` int(11) DEFAULT NULL,
`created_at` int(11) NOT NULL,
`finished_at` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `migrations`
--
CREATE TABLE `migrations` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`batch` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=159 ;
--
-- Dumping data for table `migrations`
--
INSERT INTO `migrations` VALUES
(1, '0001_01_01_000000_create_users_table', 1),
(2, '0001_01_01_000001_create_cache_table', 1),
(3, '0001_01_01_000002_create_jobs_table', 1),
(4, '2024_07_13_184927_setup_database', 1),
(5, '2024_08_18_154754_add_schedule_column', 1),
(6, '2024_08_23_110631_add_availability', 1),
(7, '2024_08_25_141207_add_show_email_address', 1),
(8, '2024_09_04_095216_add_curator_to_type_enum', 1),
(9, '2024_09_10_080929_add_is_subscribed', 1),
(10, '2024_09_17_111106_add_is_open', 1),
(11, '2024_09_23_123138_add_is_curated', 1),
(12, '2024_09_24_091734_change_event_roles', 1),
(13, '2024_10_08_072109_add_online_events', 1),
(14, '2024_11_06_151458_adjust_role_types', 1),
(15, '2024_12_18_142217_add_solid_background', 1),
(16, '2024_12_30_132215_add_tickets', 1),
(17, '2025_01_05_113546_add_stripe', 1),
(18, '2025_01_15_000000_add_creator_role_id_to_events', 1),
(19, '2025_01_23_000001_add_caldav_fields_to_roles_table', 1),
(20, '2025_01_23_000002_add_caldav_event_uid_to_event_role_table', 1),
(21, '2025_01_23_000003_add_caldav_indexes', 1),
(22, '2025_01_25_212106_add_quantity', 1),
(23, '2025_02_28_130335_adjust_default_accept_requests', 1),
(24, '2025_03_06_091949_add_registration_url', 1),
(25, '2025_03_09_094853_add_translation_columns', 1),
(26, '2025_03_09_222322_change_translation_column_types', 1),
(27, '2025_04_01_000000_add_api_key_to_users', 1),
(28, '2025_04_08_111332_change_schedule_to_talent', 1),
(29, '2025_06_05_083530_add_groups', 1),
(30, '2025_06_24_075408_add_payment_url_to_users_table', 1),
(31, '2025_06_25_121433_add_is_subscribed_to_users_table', 1),
(32, '2025_06_26_052317_create_blog_posts_table', 1),
(33, '2025_07_03_073217_move_venue_to_event_role', 1),
(34, '2025_07_18_074512_add_import_config_to_roles_table', 1),
(35, '2025_08_01_151424_rename_is_open_to_require_approval', 1),
(36, '2025_08_03_123713_add_total_tickets_mode_to_events_table', 1),
(37, '2025_09_01_122943_add_custom_domain', 1),
(38, '2025_09_10_100922_add_google_calendar_fields_to_events_table', 1),
(39, '2025_09_20_184706_move_google_event_id_to_event_roles_table', 1),
(40, '2025_12_09_111532_add_recurring_end_fields_to_events_table', 1),
(41, '2026_01_12_115220_add_custom_css_to_roles_table', 1),
(42, '2026_01_16_083847_fix_nis_currency_code_to_ils', 1),
(43, '2026_01_20_000000_create_page_views_table', 1),
(44, '2026_01_20_163241_add_terms_url_to_events_table', 1),
(45, '2026_01_20_200000_add_custom_fields', 1),
(46, '2026_01_20_210000_add_description_html_to_tickets', 1),
(47, '2026_01_21_000000_add_is_admin_to_users_table', 1),
(48, '2026_01_21_000000_create_analytics_appearances_daily_table', 1),
(49, '2026_01_21_000000_normalize_country_codes', 1),
(50, '2026_01_21_100000_add_google_oauth_id_to_users_table', 1),
(51, '2026_01_21_110000_make_password_nullable_in_users_table', 1),
(52, '2026_01_21_192148_add_subscription_fields_to_roles_table', 1),
(53, '2026_01_21_192214_create_customer_columns', 1),
(54, '2026_01_21_192215_create_subscriptions_table', 1),
(55, '2026_01_21_192216_create_subscription_items_table', 1),
(56, '2026_01_22_000000_add_graphic_settings_to_roles_table', 1),
(57, '2026_01_22_000000_create_aggregated_analytics_tables', 1),
(58, '2026_01_22_100000_add_conversion_tracking_to_analytics_events_daily', 1),
(59, '2026_01_22_100001_create_analytics_referrers_daily_table', 1),
(60, '2026_01_27_000000_add_slug_pattern_to_roles_table', 1),
(61, '2026_01_27_120000_add_api_key_hash_to_users_table', 1),
(62, '2026_01_27_120001_encrypt_invoiceninja_credentials', 1),
(63, '2026_01_28_000000_add_event_custom_fields_to_roles_table', 1),
(64, '2026_01_28_000001_add_custom_field_values_to_events_table', 1),
(65, '2026_01_28_100000_add_performance_indexes', 1),
(66, '2026_01_31_000000_add_utm_fields_to_users_table', 1),
(67, '2026_02_01_000001_create_newsletter_tables', 1),
(68, '2026_02_01_100000_add_landing_page_to_users_table', 1),
(69, '2026_02_01_100001_create_event_parts_table', 1),
(70, '2026_02_01_143124_add_unique_index_to_newsletter_segment_users', 1),
(71, '2026_02_01_200000_add_use_24_hour_time_to_users', 1),
(72, '2026_02_01_200000_change_event_layout_default_to_list', 1),
(73, '2026_02_02_000001_create_event_fan_content_tables', 1),
(74, '2026_02_02_000002_add_event_date_to_fan_content_tables', 1),
(75, '2026_02_02_100000_add_missing_indices', 1),
(76, '2026_02_03_000001_fix_invoiceninja_credential_encryption', 1),
(77, '2026_02_03_114221_create_usage_daily_table', 1),
(78, '2026_02_03_114222_add_translation_tracking_columns', 1),
(79, '2026_02_04_000000_add_color_to_groups', 1),
(80, '2026_02_04_000001_add_last_notified_fan_content_count_to_events_table', 1),
(81, '2026_02_05_112434_add_agenda_visibility_to_roles_table', 1),
(82, '2026_02_05_134317_add_description_html_to_event_parts_table', 1),
(83, '2026_02_05_200000_fix_missing_description_html_en_column', 1),
(84, '2026_02_06_000001_add_short_description_to_events_table', 1),
(85, '2026_02_06_000002_add_short_description_to_event_role_table', 1),
(86, '2026_02_06_122159_add_ticket_price_to_events_table', 1),
(87, '2026_02_07_000001_add_direct_registration_to_roles', 1),
(88, '2026_02_08_000001_add_api_key_expires_at_to_users_table', 1),
(89, '2026_02_08_000002_encrypt_user_tokens', 1),
(90, '2026_02_12_000001_add_first_day_of_week_to_roles_table', 1),
(91, '2026_02_17_000001_add_coupon_code_to_events_table', 1),
(92, '2026_02_20_000001_create_boost_tables', 1),
(93, '2026_02_20_000002_add_admin_newsletter_support', 1),
(94, '2026_02_20_000003_add_budget_alert_sent_at_to_boost_campaigns', 1),
(95, '2026_02_20_000004_add_unique_stripe_payment_intent_to_boost_campaigns', 1),
(96, '2026_02_20_000005_boost_schema_fixes', 1),
(97, '2026_02_22_000001_boost_role_user_fk_fixes', 1),
(98, '2026_02_22_194257_add_boost_credit_to_roles_table', 1),
(99, '2026_02_22_202254_add_phone_to_users_table', 1),
(100, '2026_02_22_202254_add_show_phone_to_roles_table', 1),
(101, '2026_02_22_210000_add_boost_max_budget_to_roles_table', 1),
(102, '2026_02_22_220000_add_attribution_to_sales_table', 1),
(103, '2026_02_23_000000_add_approved_subdomains_to_roles_table', 1),
(104, '2026_02_25_000001_add_newsletter_id_to_sales_table', 1),
(105, '2026_02_26_000000_increase_profile_image_url_length', 1),
(106, '2026_02_26_000001_create_event_polls_tables', 1),
(107, '2026_02_26_000002_add_recurring_dates_to_events_table', 1),
(108, '2026_02_27_000001_add_invoiceninja_mode_to_users_table', 1),
(109, '2026_02_28_000000_add_subscription_reminder_fields_to_roles_table', 1),
(110, '2026_02_28_000001_add_custom_value_9_10', 1),
(111, '2026_02_28_000002_add_ticket_sales_end_at_to_events', 1),
(112, '2026_03_01_000000_add_notification_settings_to_role_user_table', 1),
(113, '2026_03_03_000000_add_phone_to_sales_and_events_tables', 1),
(114, '2026_03_03_000001_add_fan_content_enabled_columns', 1),
(115, '2026_03_03_000001_add_sponsor_logos_to_roles_table', 1),
(116, '2026_03_03_000002_add_poll_instance_votes_and_user_options', 1),
(117, '2026_03_04_000000_add_country_code_phone_to_events_table', 1),
(118, '2026_03_04_000000_create_referral_program_tables', 1),
(119, '2026_03_08_000000_add_design_to_roles_table', 1),
(120, '2026_03_08_000000_create_backup_jobs_table', 1),
(121, '2026_03_09_000000_add_last_notified_poll_option_count_to_roles_table', 1),
(122, '2026_03_10_000001_create_carpool_tables', 1),
(123, '2026_07_01_000000_move_group_id_to_event_role', 1),
(124, '2026_07_01_000001_add_translation_columns_to_event_parts', 1),
(125, '2026_07_01_000002_add_agenda_ai_prompt_columns', 1),
(126, '2026_07_01_000003_add_recurring_frequency_to_events_table', 1),
(127, '2026_07_01_000004_create_audit_logs_table', 1),
(128, '2026_07_01_000005_add_two_factor_columns_to_users_table', 1),
(129, '2026_07_01_000006_add_short_description_to_roles_table', 1),
(130, '2026_07_01_000007_add_require_account_to_roles_table', 1),
(131, '2026_07_01_000008_ensure_selfhost_admin', 1),
(132, '2026_07_01_000009_add_is_private_to_events_table', 1),
(133, '2026_07_01_000010_add_agenda_image_url', 1),
(134, '2026_07_01_000011_create_event_photos_table', 1),
(135, '2026_07_01_000012_add_custom_domain_columns_to_roles', 1),
(136, '2026_07_15_000001_add_viewer_level_to_role_user_table', 1),
(137, '2026_07_15_000002_add_promo_codes', 1),
(138, '2026_07_16_000000_add_promo_analytics_to_analytics_events_daily', 1),
(139, '2026_07_17_000000_add_invoiceninja_subscription_to_events_table', 1),
(140, '2026_07_18_000000_add_default_role_id_to_users_table', 1),
(141, '2026_07_18_000001_add_default_curator_ids_to_roles_table', 1),
(142, '2026_07_19_000000_create_ticket_waitlists_table', 1),
(143, '2026_07_20_000000_create_webhook_tables', 1),
(144, '2026_07_21_000000_add_rsvp_to_events_table', 1),
(145, '2026_07_22_000000_add_rsvp_to_sales_payment_method', 1),
(146, '2026_07_23_000000_create_event_feedbacks_table', 1),
(147, '2026_07_23_000001_add_feedback_columns', 1),
(148, '2026_07_24_000000_move_sales_end_at_to_tickets', 1),
(149, '2026_07_25_000000_split_fan_content_enabled_columns', 1),
(150, '2026_07_26_000000_add_custom_labels_to_roles_table', 1),
(151, '2026_07_27_000000_add_individual_tickets_and_group_id', 1),
(152, '2026_07_28_000000_add_individual_ticket_fields_to_events_table', 1),
(153, '2026_07_29_000000_add_ai_instructions_to_roles_table', 1),
(154, '2026_07_30_000000_add_dashboard_config_to_users_table', 1),
(155, '2026_07_31_000000_set_default_role_id_for_existing_users', 1),
(156, '2026_08_01_000000_make_fan_content_user_id_nullable', 1),
(157, '2026_08_02_000000_add_event_request_form_to_roles_table', 1),
(158, '2026_08_03_000000_add_calendar_description_template_to_roles_table', 1);
-- --------------------------------------------------------
--
-- Table structure for table `newsletters`
--
CREATE TABLE `newsletters` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`role_id` bigint(20) unsigned DEFAULT NULL,
`type` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'schedule',
`user_id` bigint(20) unsigned NOT NULL,
`subject` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`blocks` json DEFAULT NULL,
`style_settings` json DEFAULT NULL,
`template` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'modern',
`event_ids` json DEFAULT NULL,
`segment_ids` json DEFAULT NULL,
`status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'draft',
`scheduled_at` timestamp NULL DEFAULT NULL,
`sent_at` timestamp NULL DEFAULT NULL,
`sent_count` int(10) unsigned NOT NULL DEFAULT '0',
`open_count` int(10) unsigned NOT NULL DEFAULT '0',
`click_count` int(10) unsigned NOT NULL DEFAULT '0',
`ab_test_id` bigint(20) unsigned DEFAULT NULL,
`ab_variant` char(1) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`send_token` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `newsletters_send_token_unique` (`send_token`),
KEY `newsletters_user_id_foreign` (`user_id`),
KEY `newsletters_ab_test_id_foreign` (`ab_test_id`),
KEY `newsletters_role_id_status_index` (`role_id`,`status`),
KEY `newsletters_scheduled_at_status_index` (`scheduled_at`,`status`),
KEY `newsletters_sent_at_index` (`sent_at`),
KEY `newsletters_type_status_index` (`type`,`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `newsletter_ab_tests`
--
CREATE TABLE `newsletter_ab_tests` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`role_id` bigint(20) unsigned DEFAULT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`test_field` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
`sample_percentage` int(10) unsigned NOT NULL DEFAULT '20',
`winner_criteria` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'open_rate',
`winner_wait_hours` int(10) unsigned NOT NULL DEFAULT '4',
`winner_selected_at` timestamp NULL DEFAULT NULL,
`winner_variant` char(1) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `newsletter_ab_tests_role_id_foreign` (`role_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `newsletter_clicks`
--
CREATE TABLE `newsletter_clicks` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`newsletter_recipient_id` bigint(20) unsigned NOT NULL,
`url` varchar(2048) COLLATE utf8mb4_unicode_ci NOT NULL,
`clicked_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`ip_address` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`user_agent` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `newsletter_clicks_newsletter_recipient_id_index` (`newsletter_recipient_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `newsletter_recipients`
--
CREATE TABLE `newsletter_recipients` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`newsletter_id` bigint(20) unsigned NOT NULL,
`user_id` bigint(20) unsigned DEFAULT NULL,
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`token` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL,
`status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
`sent_at` timestamp NULL DEFAULT NULL,
`error_message` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`opened_at` timestamp NULL DEFAULT NULL,
`open_count` int(10) unsigned NOT NULL DEFAULT '0',
`clicked_at` timestamp NULL DEFAULT NULL,
`click_count` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `newsletter_recipients_token_unique` (`token`),
KEY `newsletter_recipients_user_id_foreign` (`user_id`),
KEY `newsletter_recipients_newsletter_id_status_index` (`newsletter_id`,`status`),
KEY `newsletter_recipients_token_index` (`token`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `newsletter_segments`
--
CREATE TABLE `newsletter_segments` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`role_id` bigint(20) unsigned DEFAULT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
`filter_criteria` json DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `newsletter_segments_role_id_index` (`role_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `newsletter_segment_users`
--
CREATE TABLE `newsletter_segment_users` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`newsletter_segment_id` bigint(20) unsigned NOT NULL,
`user_id` bigint(20) unsigned DEFAULT NULL,
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `newsletter_segment_users_newsletter_segment_id_email_unique` (`newsletter_segment_id`,`email`),
KEY `newsletter_segment_users_user_id_foreign` (`user_id`),
KEY `newsletter_segment_users_newsletter_segment_id_index` (`newsletter_segment_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `newsletter_unsubscribes`
--
CREATE TABLE `newsletter_unsubscribes` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`role_id` bigint(20) unsigned NOT NULL,
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`unsubscribed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `newsletter_unsubscribes_role_id_email_unique` (`role_id`,`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `parsed_event_urls`
--
CREATE TABLE `parsed_event_urls` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`role_id` bigint(20) unsigned NOT NULL,
`url` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `parsed_event_urls_url_unique` (`url`),
KEY `parsed_event_urls_role_id_foreign` (`role_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `password_reset_tokens`
--
CREATE TABLE `password_reset_tokens` (
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `promo_codes`
--
CREATE TABLE `promo_codes` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`event_id` bigint(20) unsigned NOT NULL,
`code` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
`type` enum('percentage','fixed') COLLATE utf8mb4_unicode_ci NOT NULL,
`value` decimal(13,3) NOT NULL,
`max_uses` int(11) DEFAULT NULL,
`times_used` int(11) NOT NULL DEFAULT '0',
`expires_at` datetime DEFAULT NULL,
`is_active` tinyint(1) NOT NULL DEFAULT '1',
`ticket_ids` json DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `promo_codes_event_id_code_unique` (`event_id`,`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `referrals`
--
CREATE TABLE `referrals` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`referrer_user_id` bigint(20) unsigned NOT NULL,
`referred_user_id` bigint(20) unsigned NOT NULL,
`referred_role_id` bigint(20) unsigned DEFAULT NULL,
`plan_type` enum('pro','enterprise') COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`status` enum('pending','subscribed','qualified','credited','expired') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pending',
`subscribed_at` timestamp NULL DEFAULT NULL,
`qualified_at` timestamp NULL DEFAULT NULL,
`credited_at` timestamp NULL DEFAULT NULL,
`credited_role_id` bigint(20) unsigned DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `referrals_referred_user_id_unique` (`referred_user_id`),
KEY `referrals_referred_role_id_foreign` (`referred_role_id`),
KEY `referrals_credited_role_id_foreign` (`credited_role_id`),
KEY `referrals_referrer_user_id_status_index` (`referrer_user_id`,`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `roles`
--
CREATE TABLE `roles` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`is_unlisted` tinyint(1) NOT NULL DEFAULT '0',
`design` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`use_24_hour_time` tinyint(1) NOT NULL DEFAULT '0',
`user_id` bigint(20) unsigned DEFAULT NULL,
`subdomain` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`type` enum('venue','curator','talent') COLLATE utf8mb4_unicode_ci NOT NULL,
`background` enum('gradient','solid','image') COLLATE utf8mb4_unicode_ci NOT NULL,
`accent_color` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '#007bff',
`background_colors` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`background_rotation` int(11) NOT NULL DEFAULT '150',
`font_color` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '#ffffff',
`font_family` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Roboto',
`name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`email_verified_at` timestamp NULL DEFAULT NULL,
`phone` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`website` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`address1` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`address2` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`city` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`state` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`postal_code` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`country_code` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`formatted_address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`google_place_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`geo_address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`geo_lat` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`geo_lon` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`timezone` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`language_code` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'en',
`description` text COLLATE utf8mb4_unicode_ci,
`description_html` text COLLATE utf8mb4_unicode_ci,
`social_links` text COLLATE utf8mb4_unicode_ci,
`payment_links` text COLLATE utf8mb4_unicode_ci,
`youtube_links` text COLLATE utf8mb4_unicode_ci,
`profile_image_url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`background_image_url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`show_email` tinyint(1) NOT NULL DEFAULT '0',
`show_phone` tinyint(1) NOT NULL DEFAULT '0',
`plan_expires` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`boost_credit` decimal(10,2) NOT NULL DEFAULT '0.00',
`boost_max_budget` decimal(10,2) DEFAULT NULL,
`is_subscribed` tinyint(1) NOT NULL DEFAULT '1',
`require_approval` tinyint(1) NOT NULL DEFAULT '1',
`accept_requests` tinyint(1) NOT NULL DEFAULT '1',
`event_request_form` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT 'import',
`require_account` tinyint(1) NOT NULL DEFAULT '1',
`direct_registration` tinyint(1) NOT NULL DEFAULT '0',
`feedback_enabled` tinyint(1) NOT NULL DEFAULT '0',
`feedback_delay_hours` tinyint(3) unsigned NOT NULL DEFAULT '24',
`first_day_of_week` tinyint(4) NOT NULL DEFAULT '0',
`approved_subdomains` text COLLATE utf8mb4_unicode_ci,
`default_curator_ids` json DEFAULT NULL,
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
`header_image_url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`background_color` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`background_image` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`header_image` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`default_tickets` text COLLATE utf8mb4_unicode_ci,
`plan_term` enum('month','year') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'year',
`plan_type` enum('free','pro','enterprise') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'free',
`caldav_settings` text COLLATE utf8mb4_unicode_ci,
`caldav_sync_direction` enum('to','from','both') COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`calendar_description_template` text COLLATE utf8mb4_unicode_ci,
`caldav_sync_token` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`caldav_last_sync_at` timestamp NULL DEFAULT NULL,
`phone_verified_at` timestamp NULL DEFAULT NULL,
`name_en` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`description_en` text COLLATE utf8mb4_unicode_ci,
`short_description` text COLLATE utf8mb4_unicode_ci,
`short_description_en` text COLLATE utf8mb4_unicode_ci,
`description_html_en` text COLLATE utf8mb4_unicode_ci,
`address1_en` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`address2_en` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`city_en` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`state_en` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`import_config` text COLLATE utf8mb4_unicode_ci,
`email_settings` text COLLATE utf8mb4_unicode_ci,
`custom_domain` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`custom_domain_mode` enum('redirect','direct') COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`custom_domain_host` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`custom_domain_status` enum('pending','active','failed') COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`event_layout` enum('calendar','list','grid') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'list',
`google_calendar_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`google_webhook_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`google_webhook_resource_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`google_webhook_expires_at` timestamp NULL DEFAULT NULL,
`sync_direction` enum('to','from','both') COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`request_terms` text COLLATE utf8mb4_unicode_ci,
`request_terms_en` text COLLATE utf8mb4_unicode_ci,
`last_notified_request_count` int(11) DEFAULT '0',
`last_notified_poll_option_count` int(11) DEFAULT '0',
`custom_css` text COLLATE utf8mb4_unicode_ci,
`event_custom_fields` text COLLATE utf8mb4_unicode_ci,
`custom_fields` text COLLATE utf8mb4_unicode_ci,
`stripe_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`pm_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`pm_last_four` varchar(4) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`trial_ends_at` timestamp NULL DEFAULT NULL,
`graphic_settings` text COLLATE utf8mb4_unicode_ci,
`slug_pattern` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`translation_attempts` smallint(5) unsigned NOT NULL DEFAULT '0',
`last_translated_at` timestamp NULL DEFAULT NULL,
`agenda_show_times` tinyint(1) DEFAULT NULL,
`agenda_show_description` tinyint(1) DEFAULT NULL,
`agenda_save_image` tinyint(1) DEFAULT NULL,
`trial_reminder_sent_at` timestamp NULL DEFAULT NULL,
`renewal_reminder_sent_at` timestamp NULL DEFAULT NULL,
`fan_comments_enabled` tinyint(1) NOT NULL DEFAULT '1',
`fan_photos_enabled` tinyint(1) NOT NULL DEFAULT '1',
`fan_videos_enabled` tinyint(1) NOT NULL DEFAULT '1',
`sponsor_logos` text COLLATE utf8mb4_unicode_ci,
`sponsor_section_title` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`sponsor_section_title_en` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`custom_labels` text COLLATE utf8mb4_unicode_ci,
`ai_style_instructions` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`ai_content_instructions` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`carpool_enabled` tinyint(1) NOT NULL DEFAULT '0',
`agenda_ai_prompt` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `roles_subdomain_unique` (`subdomain`),
UNIQUE KEY `roles_custom_domain_host_unique` (`custom_domain_host`),
KEY `roles_user_id_foreign` (`user_id`),
KEY `roles_type_index` (`type`),
KEY `roles_caldav_sync_direction_index` (`caldav_sync_direction`),
KEY `roles_stripe_id_index` (`stripe_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `role_user`
--
CREATE TABLE `role_user` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) unsigned NOT NULL,
`role_id` bigint(20) unsigned NOT NULL,
`level` enum('owner','admin','viewer','follower') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'follower',
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`dates_unavailable` text COLLATE utf8mb4_unicode_ci,
`notification_settings` json DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `role_user_user_id_role_id_unique` (`user_id`,`role_id`),
KEY `role_user_role_id_foreign` (`role_id`),
KEY `role_user_level_index` (`level`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `sales`
--
CREATE TABLE `sales` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`group_id` bigint(20) unsigned DEFAULT NULL,
`event_id` bigint(20) unsigned NOT NULL,
`user_id` bigint(20) unsigned DEFAULT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`phone` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`secret` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`transaction_reference` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`status` enum('unpaid','paid','cancelled','refunded','expired') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'unpaid',
`event_date` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`subdomain` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`payment_method` enum('cash','stripe','invoiceninja','payment_url','rsvp') COLLATE utf8mb4_unicode_ci DEFAULT 'cash',
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
`payment_amount` decimal(13,3) NOT NULL DEFAULT '0.000',
`utm_source` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`utm_medium` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`utm_campaign` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`boost_campaign_id` bigint(20) unsigned DEFAULT NULL,
`promo_code_id` bigint(20) unsigned DEFAULT NULL,
`discount_amount` decimal(13,3) DEFAULT NULL,
`feedback_sent_at` timestamp NULL DEFAULT NULL,
`newsletter_id` bigint(20) unsigned DEFAULT NULL,
`custom_value1` text COLLATE utf8mb4_unicode_ci,
`custom_value2` text COLLATE utf8mb4_unicode_ci,
`custom_value3` text COLLATE utf8mb4_unicode_ci,
`custom_value4` text COLLATE utf8mb4_unicode_ci,
`custom_value5` text COLLATE utf8mb4_unicode_ci,
`custom_value6` text COLLATE utf8mb4_unicode_ci,
`custom_value7` text COLLATE utf8mb4_unicode_ci,
`custom_value8` text COLLATE utf8mb4_unicode_ci,
`custom_value9` text COLLATE utf8mb4_unicode_ci,
`custom_value10` text COLLATE utf8mb4_unicode_ci,
PRIMARY KEY (`id`),
KEY `sales_user_id_foreign` (`user_id`),
KEY `sales_event_id_secret_index` (`event_id`,`secret`),
KEY `sales_status_index` (`status`),
KEY `sales_payment_method_transaction_reference_index` (`payment_method`,`transaction_reference`),
KEY `sales_event_date_index` (`event_date`),
KEY `sales_boost_campaign_id_index` (`boost_campaign_id`),
KEY `sales_newsletter_id_index` (`newsletter_id`),
KEY `sales_promo_code_id_foreign` (`promo_code_id`),
KEY `sales_group_id_index` (`group_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `sale_tickets`
--
CREATE TABLE `sale_tickets` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`sale_id` bigint(20) unsigned NOT NULL,
`ticket_id` bigint(20) unsigned NOT NULL,
`seats` text COLLATE utf8mb4_unicode_ci NOT NULL,
`quantity` int(11) NOT NULL DEFAULT '0',
`custom_value1` text COLLATE utf8mb4_unicode_ci,
`custom_value2` text COLLATE utf8mb4_unicode_ci,
`custom_value3` text COLLATE utf8mb4_unicode_ci,
`custom_value4` text COLLATE utf8mb4_unicode_ci,
`custom_value5` text COLLATE utf8mb4_unicode_ci,
`custom_value6` text COLLATE utf8mb4_unicode_ci,
`custom_value7` text COLLATE utf8mb4_unicode_ci,
`custom_value8` text COLLATE utf8mb4_unicode_ci,
`custom_value9` text COLLATE utf8mb4_unicode_ci,
`custom_value10` text COLLATE utf8mb4_unicode_ci,
PRIMARY KEY (`id`),
KEY `sale_tickets_sale_id_foreign` (`sale_id`),
KEY `sale_tickets_ticket_id_foreign` (`ticket_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `sessions`
--
CREATE TABLE `sessions` (
`id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`user_id` bigint(20) unsigned DEFAULT NULL,
`ip_address` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`user_agent` text COLLATE utf8mb4_unicode_ci,
`payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
`last_activity` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `sessions_user_id_index` (`user_id`),
KEY `sessions_last_activity_index` (`last_activity`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `subscriptions`
--
CREATE TABLE `subscriptions` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`role_id` bigint(20) unsigned NOT NULL,
`type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`stripe_id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`stripe_status` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`stripe_price` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`quantity` int(11) DEFAULT NULL,
`trial_ends_at` timestamp NULL DEFAULT NULL,
`ends_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `subscriptions_stripe_id_unique` (`stripe_id`),
KEY `subscriptions_role_id_stripe_status_index` (`role_id`,`stripe_status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `subscription_items`
--
CREATE TABLE `subscription_items` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`subscription_id` bigint(20) unsigned NOT NULL,
`stripe_id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`stripe_product` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`stripe_price` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`quantity` int(11) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `subscription_items_stripe_id_unique` (`stripe_id`),
KEY `subscription_items_subscription_id_stripe_price_index` (`subscription_id`,`stripe_price`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `tickets`
--
CREATE TABLE `tickets` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`event_id` bigint(20) unsigned NOT NULL,
`type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`quantity` int(11) DEFAULT NULL,
`price` decimal(13,3) DEFAULT NULL,
`description` text COLLATE utf8mb4_unicode_ci,
`sales_end_at` datetime DEFAULT NULL,
`description_html` text COLLATE utf8mb4_unicode_ci,
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`sold` text COLLATE utf8mb4_unicode_ci,
`custom_fields` text COLLATE utf8mb4_unicode_ci,
`invoiceninja_product_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `tickets_event_id_foreign` (`event_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `ticket_waitlists`
--
CREATE TABLE `ticket_waitlists` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`event_id` bigint(20) unsigned NOT NULL,
`event_date` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`subdomain` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`status` enum('waiting','notified','purchased','expired') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'waiting',
`locale` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`notified_at` timestamp NULL DEFAULT NULL,
`expires_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `ticket_waitlists_event_id_event_date_email_unique` (`event_id`,`event_date`,`email`),
KEY `ticket_waitlists_event_id_event_date_status_created_at_index` (`event_id`,`event_date`,`status`,`created_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `usage_daily`
--
CREATE TABLE `usage_daily` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`date` date NOT NULL,
`operation` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
`role_id` bigint(20) unsigned NOT NULL DEFAULT '0',
`count` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `usage_daily_date_operation_role_id_unique` (`date`,`operation`,`role_id`),
KEY `usage_daily_date_index` (`date`),
KEY `usage_daily_role_id_index` (`role_id`),
KEY `usage_daily_operation_index` (`operation`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`phone` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`phone_verified_at` timestamp NULL DEFAULT NULL,
`email_verified_at` timestamp NULL DEFAULT NULL,
`password` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`two_factor_secret` text COLLATE utf8mb4_unicode_ci,
`two_factor_recovery_codes` text COLLATE utf8mb4_unicode_ci,
`two_factor_confirmed_at` timestamp NULL DEFAULT NULL,
`timezone` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`language_code` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'en',
`use_24_hour_time` tinyint(1) DEFAULT NULL,
`utm_source` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`utm_medium` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`utm_campaign` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`utm_content` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`utm_term` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`referrer_url` varchar(2048) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`landing_page` varchar(2048) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`default_role_id` bigint(20) unsigned DEFAULT NULL,
`dashboard_config` json DEFAULT NULL,
`referral_code` varchar(8) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`referred_by_user_id` bigint(20) unsigned DEFAULT NULL,
`profile_image_url` text COLLATE utf8mb4_unicode_ci,
`remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`stripe_account_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`stripe_company_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`stripe_completed_at` timestamp NULL DEFAULT NULL,
`invoiceninja_api_key` text COLLATE utf8mb4_unicode_ci,
`invoiceninja_api_url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`invoiceninja_company_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`invoiceninja_webhook_secret` text COLLATE utf8mb4_unicode_ci,
`invoiceninja_mode` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'invoice',
`api_key` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`api_key_hash` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`api_key_expires_at` timestamp NULL DEFAULT NULL,
`payment_url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`payment_secret` text COLLATE utf8mb4_unicode_ci,
`is_subscribed` tinyint(1) NOT NULL DEFAULT '1',
`is_admin` tinyint(1) NOT NULL DEFAULT '0',
`google_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`google_oauth_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`google_token` text COLLATE utf8mb4_unicode_ci,
`google_refresh_token` text COLLATE utf8mb4_unicode_ci,
`google_token_expires_at` timestamp NULL DEFAULT NULL,
`facebook_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`facebook_token` text COLLATE utf8mb4_unicode_ci,
`facebook_token_expires_at` timestamp NULL DEFAULT NULL,
`stripe_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`pm_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`pm_last_four` varchar(4) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`trial_ends_at` timestamp NULL DEFAULT NULL,
`admin_newsletter_unsubscribed_at` timestamp NULL DEFAULT NULL,
`carpool_agreed_at` timestamp NULL DEFAULT NULL,
`carpool_notifications_enabled` tinyint(1) NOT NULL DEFAULT '1',
PRIMARY KEY (`id`),
UNIQUE KEY `users_email_unique` (`email`),
UNIQUE KEY `users_referral_code_unique` (`referral_code`),
KEY `users_google_oauth_id_index` (`google_oauth_id`),
KEY `users_stripe_id_index` (`stripe_id`),
KEY `users_utm_source_index` (`utm_source`),
KEY `users_utm_campaign_index` (`utm_campaign`),
KEY `users_referred_by_user_id_foreign` (`referred_by_user_id`),
KEY `users_default_role_id_foreign` (`default_role_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=2 ;
--
-- Dumping data for table `users`
--
INSERT INTO `users` VALUES
(1, '[[admin_username]]', '[[admin_email]]', NULL, NULL, '[[regtime]]', '[[admin_pass]]', NULL, NULL, NULL, 'Asia/Kolkata', 'en', 1, NULL, NULL, NULL, NULL, NULL, NULL, '/', NULL, NULL, NULL, NULL, NULL, '', '[[regtime]]', '[[regtime]]', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'invoice', NULL, NULL, NULL, NULL, NULL, 1, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1);
-- --------------------------------------------------------
--
-- Table structure for table `webhooks`
--
CREATE TABLE `webhooks` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) unsigned NOT NULL,
`url` varchar(2048) COLLATE utf8mb4_unicode_ci NOT NULL,
`secret` text COLLATE utf8mb4_unicode_ci NOT NULL,
`event_types` json DEFAULT NULL,
`is_active` tinyint(1) NOT NULL DEFAULT '1',
`description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`last_triggered_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `webhooks_user_id_foreign` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `webhook_deliveries`
--
CREATE TABLE `webhook_deliveries` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`webhook_id` bigint(20) unsigned NOT NULL,
`event_type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
`payload` json NOT NULL,
`response_status` smallint(5) unsigned DEFAULT NULL,
`response_body` text COLLATE utf8mb4_unicode_ci,
`success` tinyint(1) NOT NULL DEFAULT '0',
`duration_ms` int(10) unsigned DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `webhook_deliveries_webhook_id_created_at_index` (`webhook_id`,`created_at`),
KEY `webhook_deliveries_created_at_index` (`created_at`),
KEY `webhook_deliveries_event_type_index` (`event_type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `analytics_appearances_daily`
--
ALTER TABLE `analytics_appearances_daily`
ADD CONSTRAINT `analytics_appearances_daily_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `analytics_appearances_daily_schedule_role_id_foreign` FOREIGN KEY (`schedule_role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `analytics_daily`
--
ALTER TABLE `analytics_daily`
ADD CONSTRAINT `analytics_daily_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `analytics_events_daily`
--
ALTER TABLE `analytics_events_daily`
ADD CONSTRAINT `analytics_events_daily_event_id_foreign` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `analytics_referrers_daily`
--
ALTER TABLE `analytics_referrers_daily`
ADD CONSTRAINT `analytics_referrers_daily_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `audit_logs`
--
ALTER TABLE `audit_logs`
ADD CONSTRAINT `audit_logs_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL;
--
-- Constraints for table `backup_jobs`
--
ALTER TABLE `backup_jobs`
ADD CONSTRAINT `backup_jobs_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `boost_ads`
--
ALTER TABLE `boost_ads`
ADD CONSTRAINT `boost_ads_boost_campaign_id_foreign` FOREIGN KEY (`boost_campaign_id`) REFERENCES `boost_campaigns` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `boost_billing_records`
--
ALTER TABLE `boost_billing_records`
ADD CONSTRAINT `boost_billing_records_boost_campaign_id_foreign` FOREIGN KEY (`boost_campaign_id`) REFERENCES `boost_campaigns` (`id`) ON DELETE SET NULL;
--
-- Constraints for table `boost_campaigns`
--
ALTER TABLE `boost_campaigns`
ADD CONSTRAINT `boost_campaigns_event_id_foreign` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`) ON DELETE SET NULL,
ADD CONSTRAINT `boost_campaigns_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE SET NULL,
ADD CONSTRAINT `boost_campaigns_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL;
--
-- Constraints for table `carpool_offers`
--
ALTER TABLE `carpool_offers`
ADD CONSTRAINT `carpool_offers_event_id_foreign` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `carpool_offers_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE SET NULL,
ADD CONSTRAINT `carpool_offers_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `carpool_reports`
--
ALTER TABLE `carpool_reports`
ADD CONSTRAINT `carpool_reports_carpool_offer_id_foreign` FOREIGN KEY (`carpool_offer_id`) REFERENCES `carpool_offers` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `carpool_reports_reported_user_id_foreign` FOREIGN KEY (`reported_user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `carpool_reports_reporter_user_id_foreign` FOREIGN KEY (`reporter_user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `carpool_requests`
--
ALTER TABLE `carpool_requests`
ADD CONSTRAINT `carpool_requests_carpool_offer_id_foreign` FOREIGN KEY (`carpool_offer_id`) REFERENCES `carpool_offers` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `carpool_requests_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `carpool_reviews`
--
ALTER TABLE `carpool_reviews`
ADD CONSTRAINT `carpool_reviews_carpool_offer_id_foreign` FOREIGN KEY (`carpool_offer_id`) REFERENCES `carpool_offers` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `carpool_reviews_reviewed_user_id_foreign` FOREIGN KEY (`reviewed_user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `carpool_reviews_reviewer_user_id_foreign` FOREIGN KEY (`reviewer_user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `events`
--
ALTER TABLE `events`
ADD CONSTRAINT `events_creator_role_id_foreign` FOREIGN KEY (`creator_role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `events_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `event_comments`
--
ALTER TABLE `event_comments`
ADD CONSTRAINT `event_comments_event_id_foreign` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `event_comments_event_part_id_foreign` FOREIGN KEY (`event_part_id`) REFERENCES `event_parts` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `event_comments_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `event_feedbacks`
--
ALTER TABLE `event_feedbacks`
ADD CONSTRAINT `event_feedbacks_event_id_foreign` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `event_feedbacks_sale_id_foreign` FOREIGN KEY (`sale_id`) REFERENCES `sales` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `event_parts`
--
ALTER TABLE `event_parts`
ADD CONSTRAINT `event_parts_event_id_foreign` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `event_photos`
--
ALTER TABLE `event_photos`
ADD CONSTRAINT `event_photos_event_id_foreign` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `event_photos_event_part_id_foreign` FOREIGN KEY (`event_part_id`) REFERENCES `event_parts` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `event_photos_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `event_polls`
--
ALTER TABLE `event_polls`
ADD CONSTRAINT `event_polls_event_id_foreign` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `event_poll_votes`
--
ALTER TABLE `event_poll_votes`
ADD CONSTRAINT `event_poll_votes_event_poll_id_foreign` FOREIGN KEY (`event_poll_id`) REFERENCES `event_polls` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `event_poll_votes_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `event_role`
--
ALTER TABLE `event_role`
ADD CONSTRAINT `event_role_event_id_foreign` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `event_role_group_id_foreign` FOREIGN KEY (`group_id`) REFERENCES `groups` (`id`) ON DELETE SET NULL,
ADD CONSTRAINT `event_role_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `event_videos`
--
ALTER TABLE `event_videos`
ADD CONSTRAINT `event_videos_event_id_foreign` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `event_videos_event_part_id_foreign` FOREIGN KEY (`event_part_id`) REFERENCES `event_parts` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `event_videos_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `groups`
--
ALTER TABLE `groups`
ADD CONSTRAINT `groups_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `newsletters`
--
ALTER TABLE `newsletters`
ADD CONSTRAINT `newsletters_ab_test_id_foreign` FOREIGN KEY (`ab_test_id`) REFERENCES `newsletter_ab_tests` (`id`) ON DELETE SET NULL,
ADD CONSTRAINT `newsletters_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE SET NULL,
ADD CONSTRAINT `newsletters_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `newsletter_ab_tests`
--
ALTER TABLE `newsletter_ab_tests`
ADD CONSTRAINT `newsletter_ab_tests_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE SET NULL;
--
-- Constraints for table `newsletter_clicks`
--
ALTER TABLE `newsletter_clicks`
ADD CONSTRAINT `newsletter_clicks_newsletter_recipient_id_foreign` FOREIGN KEY (`newsletter_recipient_id`) REFERENCES `newsletter_recipients` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `newsletter_recipients`
--
ALTER TABLE `newsletter_recipients`
ADD CONSTRAINT `newsletter_recipients_newsletter_id_foreign` FOREIGN KEY (`newsletter_id`) REFERENCES `newsletters` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `newsletter_recipients_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL;
--
-- Constraints for table `newsletter_segments`
--
ALTER TABLE `newsletter_segments`
ADD CONSTRAINT `newsletter_segments_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE SET NULL;
--
-- Constraints for table `newsletter_segment_users`
--
ALTER TABLE `newsletter_segment_users`
ADD CONSTRAINT `newsletter_segment_users_newsletter_segment_id_foreign` FOREIGN KEY (`newsletter_segment_id`) REFERENCES `newsletter_segments` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `newsletter_segment_users_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL;
--
-- Constraints for table `newsletter_unsubscribes`
--
ALTER TABLE `newsletter_unsubscribes`
ADD CONSTRAINT `newsletter_unsubscribes_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `parsed_event_urls`
--
ALTER TABLE `parsed_event_urls`
ADD CONSTRAINT `parsed_event_urls_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `promo_codes`
--
ALTER TABLE `promo_codes`
ADD CONSTRAINT `promo_codes_event_id_foreign` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `referrals`
--
ALTER TABLE `referrals`
ADD CONSTRAINT `referrals_credited_role_id_foreign` FOREIGN KEY (`credited_role_id`) REFERENCES `roles` (`id`) ON DELETE SET NULL,
ADD CONSTRAINT `referrals_referred_role_id_foreign` FOREIGN KEY (`referred_role_id`) REFERENCES `roles` (`id`) ON DELETE SET NULL,
ADD CONSTRAINT `referrals_referred_user_id_foreign` FOREIGN KEY (`referred_user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `referrals_referrer_user_id_foreign` FOREIGN KEY (`referrer_user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `roles`
--
ALTER TABLE `roles`
ADD CONSTRAINT `roles_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `role_user`
--
ALTER TABLE `role_user`
ADD CONSTRAINT `role_user_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `role_user_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `sales`
--
ALTER TABLE `sales`
ADD CONSTRAINT `sales_boost_campaign_id_foreign` FOREIGN KEY (`boost_campaign_id`) REFERENCES `boost_campaigns` (`id`) ON DELETE SET NULL,
ADD CONSTRAINT `sales_event_id_foreign` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `sales_promo_code_id_foreign` FOREIGN KEY (`promo_code_id`) REFERENCES `promo_codes` (`id`) ON DELETE SET NULL,
ADD CONSTRAINT `sales_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `sale_tickets`
--
ALTER TABLE `sale_tickets`
ADD CONSTRAINT `sale_tickets_sale_id_foreign` FOREIGN KEY (`sale_id`) REFERENCES `sales` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `sale_tickets_ticket_id_foreign` FOREIGN KEY (`ticket_id`) REFERENCES `tickets` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `tickets`
--
ALTER TABLE `tickets`
ADD CONSTRAINT `tickets_event_id_foreign` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `ticket_waitlists`
--
ALTER TABLE `ticket_waitlists`
ADD CONSTRAINT `ticket_waitlists_event_id_foreign` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `users`
--
ALTER TABLE `users`
ADD CONSTRAINT `users_default_role_id_foreign` FOREIGN KEY (`default_role_id`) REFERENCES `roles` (`id`) ON DELETE SET NULL,
ADD CONSTRAINT `users_referred_by_user_id_foreign` FOREIGN KEY (`referred_by_user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL;
--
-- Constraints for table `webhooks`
--
ALTER TABLE `webhooks`
ADD CONSTRAINT `webhooks_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;
--
-- Constraints for table `webhook_deliveries`
--
ALTER TABLE `webhook_deliveries`
ADD CONSTRAINT `webhook_deliveries_webhook_id_foreign` FOREIGN KEY (`webhook_id`) REFERENCES `webhooks` (`id`) ON DELETE CASCADE;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|