========== SCHEMA DUMP ==========
Schema: digupdog_vibeeo
Generated at: 2025-08-22 17:25:21
Host: localhost
=================================

TABLE COUNT: 380

============================================================
TABLE: ab_testing
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:13:51 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	test_name	varchar(100)	NO	NULL			utf8mb4_unicode_ci	
3	test_description	text	YES	NULL			utf8mb4_unicode_ci	
4	feature	varchar(100)	YES	NULL		MUL	utf8mb4_unicode_ci	
5	variants	json	NO	NULL				
6	traffic_allocation	json	YES	NULL				
7	target_audience	json	YES	NULL				
8	success_metrics	json	YES	NULL				
9	status	enum('draft','running','paused','completed')	YES	draft		MUL	utf8mb4_unicode_ci	
10	results	json	YES	NULL				
11	winner_variant	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
12	statistical_significance	decimal(5,4)	YES	NULL				
13	start_date	timestamp	YES	NULL				
14	end_date	timestamp	YES	NULL				
15	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_feature	NON_UNIQUE	BTREE	feature	0
idx_status	NON_UNIQUE	BTREE	status	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `ab_testing` (
  `id` int NOT NULL AUTO_INCREMENT,
  `test_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `test_description` text COLLATE utf8mb4_unicode_ci,
  `feature` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `variants` json NOT NULL,
  `traffic_allocation` json DEFAULT NULL,
  `target_audience` json DEFAULT NULL,
  `success_metrics` json DEFAULT NULL,
  `status` enum('draft','running','paused','completed') COLLATE utf8mb4_unicode_ci DEFAULT 'draft',
  `results` json DEFAULT NULL,
  `winner_variant` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `statistical_significance` decimal(5,4) DEFAULT NULL,
  `start_date` timestamp NULL DEFAULT NULL,
  `end_date` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_status` (`status`),
  KEY `idx_feature` (`feature`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: abandoned_cart_recovery
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:52:35 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	store_id	int	NO	NULL		MUL		
3	cart_id	int	NO	NULL		MUL		
4	customer_email	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
5	cart_value	decimal(12,2)	YES	NULL				
6	recovery_email_sent	int	YES	0				
7	recovery_email_opened	tinyint(1)	YES	0				
8	recovery_link_clicked	tinyint(1)	YES	0				
9	recovered	tinyint(1)	YES	0		MUL		
10	recovered_amount	decimal(12,2)	YES	NULL				
11	discount_offered	decimal(10,2)	YES	NULL				
12	abandoned_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
13	last_email_sent	timestamp	YES	NULL				
14	recovered_at	timestamp	YES	NULL				

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_cart	NON_UNIQUE	BTREE	cart_id	0
idx_recovered	NON_UNIQUE	BTREE	recovered	0
idx_store	NON_UNIQUE	BTREE	store_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
abandoned_cart_recovery_ibfk_1	store_id	online_stores	id	NO ACTION	NO ACTION
abandoned_cart_recovery_ibfk_2	cart_id	shopping_carts	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `abandoned_cart_recovery` (
  `id` int NOT NULL AUTO_INCREMENT,
  `store_id` int NOT NULL,
  `cart_id` int NOT NULL,
  `customer_email` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cart_value` decimal(12,2) DEFAULT NULL,
  `recovery_email_sent` int DEFAULT '0',
  `recovery_email_opened` tinyint(1) DEFAULT '0',
  `recovery_link_clicked` tinyint(1) DEFAULT '0',
  `recovered` tinyint(1) DEFAULT '0',
  `recovered_amount` decimal(12,2) DEFAULT NULL,
  `discount_offered` decimal(10,2) DEFAULT NULL,
  `abandoned_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `last_email_sent` timestamp NULL DEFAULT NULL,
  `recovered_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_store` (`store_id`),
  KEY `idx_cart` (`cart_id`),
  KEY `idx_recovered` (`recovered`),
  CONSTRAINT `abandoned_cart_recovery_ibfk_1` FOREIGN KEY (`store_id`) REFERENCES `online_stores` (`id`),
  CONSTRAINT `abandoned_cart_recovery_ibfk_2` FOREIGN KEY (`cart_id`) REFERENCES `shopping_carts` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: achievements
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 10 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 11 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-07 01:09:42 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	code	varchar(50)	NO	NULL		UNI	utf8mb4_unicode_ci	
3	name	varchar(100)	NO	NULL			utf8mb4_unicode_ci	
4	description	text	YES	NULL			utf8mb4_unicode_ci	
5	icon	varchar(50)	YES	trophy			utf8mb4_unicode_ci	
6	xp_reward	int	YES	0				
7	coin_reward	int	YES	0				
8	category	varchar(50)	YES	general		MUL	utf8mb4_unicode_ci	
9	requirement_type	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
10	requirement_value	int	YES	NULL				
11	is_hidden	tinyint(1)	YES	0				
12	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	10
code	UNIQUE	BTREE	code	10
idx_category	NON_UNIQUE	BTREE	category	6
idx_code	NON_UNIQUE	BTREE	code	10

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `achievements` (
  `id` int NOT NULL AUTO_INCREMENT,
  `code` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `icon` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT 'trophy',
  `xp_reward` int DEFAULT '0',
  `coin_reward` int DEFAULT '0',
  `category` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT 'general',
  `requirement_type` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `requirement_value` int DEFAULT NULL,
  `is_hidden` tinyint(1) DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `code` (`code`),
  KEY `idx_code` (`code`),
  KEY `idx_category` (`category`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: active_matches
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 1 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 538 | COLLATION: utf8mb4_0900_ai_ci | CREATE: 2025-08-02 18:36:56 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	YES	NULL		UNI		
3	is_matched	tinyint(1)	YES	0		MUL		
4	matched_with	int	YES	NULL		MUL		
5	joined_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	1
idx_matching	NON_UNIQUE	BTREE	is_matched, joined_at	1
matched_with	NON_UNIQUE	BTREE	matched_with	1
user_id	UNIQUE	BTREE	user_id	1

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
active_matches_ibfk_1	user_id	users	id	NO ACTION	CASCADE
active_matches_ibfk_2	matched_with	users	id	NO ACTION	SET NULL

--- SHOW CREATE TABLE ---
CREATE TABLE `active_matches` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int DEFAULT NULL,
  `is_matched` tinyint(1) DEFAULT '0',
  `matched_with` int DEFAULT NULL,
  `joined_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_id` (`user_id`),
  KEY `matched_with` (`matched_with`),
  KEY `idx_matching` (`is_matched`,`joined_at`),
  CONSTRAINT `active_matches_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  CONSTRAINT `active_matches_ibfk_2` FOREIGN KEY (`matched_with`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=538 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;


============================================================
TABLE: affiliate_dashboard
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 16:04:26 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	affiliate_id	int	NO	NULL		UNI		
3	clicks_today	int	YES	0				
4	conversions_today	int	YES	0				
5	conversion_rate	decimal(5,2)	YES	0.00				
6	earnings_today	decimal(12,2)	YES	0.00				
7	earnings_month	decimal(12,2)	YES	0.00				
8	pending_commission	decimal(12,2)	YES	0.00				
9	active_referrals	int	YES	0				
10	total_referrals	int	YES	0				
11	active_links	int	YES	0				
12	top_performing_links	json	YES	NULL				
13	last_updated	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_affiliate	NON_UNIQUE	BTREE	affiliate_id	0
unique_affiliate	UNIQUE	BTREE	affiliate_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
affiliate_dashboard_ibfk_1	affiliate_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `affiliate_dashboard` (
  `id` int NOT NULL AUTO_INCREMENT,
  `affiliate_id` int NOT NULL,
  `clicks_today` int DEFAULT '0',
  `conversions_today` int DEFAULT '0',
  `conversion_rate` decimal(5,2) DEFAULT '0.00',
  `earnings_today` decimal(12,2) DEFAULT '0.00',
  `earnings_month` decimal(12,2) DEFAULT '0.00',
  `pending_commission` decimal(12,2) DEFAULT '0.00',
  `active_referrals` int DEFAULT '0',
  `total_referrals` int DEFAULT '0',
  `active_links` int DEFAULT '0',
  `top_performing_links` json DEFAULT NULL,
  `last_updated` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_affiliate` (`affiliate_id`),
  KEY `idx_affiliate` (`affiliate_id`),
  CONSTRAINT `affiliate_dashboard_ibfk_1` FOREIGN KEY (`affiliate_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: affiliate_program
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.08 | TOTAL_MB: 0.09 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 03:02:56 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	affiliate_id	int	NO	NULL		UNI		
3	affiliate_code	varchar(50)	NO	NULL		UNI	utf8mb4_unicode_ci	
4	tier	enum('bronze','silver','gold','platinum','diamond')	YES	bronze		MUL	utf8mb4_unicode_ci	
5	commission_rate	decimal(5,2)	YES	25.00				
6	cpa_amount	decimal(10,2)	YES	0.00				
7	revenue_share	decimal(5,2)	YES	0.00				
8	cookie_duration_days	int	YES	30				
9	referred_users	int	YES	0				
10	active_users	int	YES	0				
11	total_deposits	decimal(20,2)	YES	0.00				
12	total_commissions	decimal(20,2)	YES	0.00				
13	pending_commissions	decimal(20,2)	YES	0.00				
14	paid_commissions	decimal(20,2)	YES	0.00				
15	payment_method	json	YES	NULL				
16	payment_threshold	decimal(10,2)	YES	100.00				
17	custom_landing_page	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
18	tracking_links	json	YES	NULL				
19	is_approved	tinyint(1)	YES	0				
20	is_suspended	tinyint(1)	YES	0				
21	approved_at	timestamp	YES	NULL				
22	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
affiliate_code	UNIQUE	BTREE	affiliate_code	0
affiliate_id	UNIQUE	BTREE	affiliate_id	0
idx_affiliate	NON_UNIQUE	BTREE	affiliate_id	0
idx_code	NON_UNIQUE	BTREE	affiliate_code	0
idx_tier	NON_UNIQUE	BTREE	tier	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
affiliate_program_ibfk_1	affiliate_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `affiliate_program` (
  `id` int NOT NULL AUTO_INCREMENT,
  `affiliate_id` int NOT NULL,
  `affiliate_code` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `tier` enum('bronze','silver','gold','platinum','diamond') COLLATE utf8mb4_unicode_ci DEFAULT 'bronze',
  `commission_rate` decimal(5,2) DEFAULT '25.00',
  `cpa_amount` decimal(10,2) DEFAULT '0.00',
  `revenue_share` decimal(5,2) DEFAULT '0.00',
  `cookie_duration_days` int DEFAULT '30',
  `referred_users` int DEFAULT '0',
  `active_users` int DEFAULT '0',
  `total_deposits` decimal(20,2) DEFAULT '0.00',
  `total_commissions` decimal(20,2) DEFAULT '0.00',
  `pending_commissions` decimal(20,2) DEFAULT '0.00',
  `paid_commissions` decimal(20,2) DEFAULT '0.00',
  `payment_method` json DEFAULT NULL,
  `payment_threshold` decimal(10,2) DEFAULT '100.00',
  `custom_landing_page` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tracking_links` json DEFAULT NULL,
  `is_approved` tinyint(1) DEFAULT '0',
  `is_suspended` tinyint(1) DEFAULT '0',
  `approved_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `affiliate_id` (`affiliate_id`),
  UNIQUE KEY `affiliate_code` (`affiliate_code`),
  KEY `idx_affiliate` (`affiliate_id`),
  KEY `idx_code` (`affiliate_code`),
  KEY `idx_tier` (`tier`),
  CONSTRAINT `affiliate_program_ibfk_1` FOREIGN KEY (`affiliate_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: affiliate_referrals
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 03:03:08 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	affiliate_id	int	NO	NULL		MUL		
3	referred_user_id	int	NO	NULL		UNI		
4	tracking_code	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
5	source	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
6	landing_page	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
7	ip_address	varchar(45)	YES	NULL			utf8mb4_unicode_ci	
8	user_agent	text	YES	NULL			utf8mb4_unicode_ci	
9	first_deposit_amount	decimal(20,2)	YES	NULL				
10	total_deposits	decimal(20,2)	YES	0.00				
11	total_wagered	decimal(20,2)	YES	0.00				
12	commission_earned	decimal(20,2)	YES	0.00				
13	status	enum('pending','active','inactive','fraudulent')	YES	pending		MUL	utf8mb4_unicode_ci	
14	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_affiliate	NON_UNIQUE	BTREE	affiliate_id	0
idx_status	NON_UNIQUE	BTREE	status	0
unique_referral	UNIQUE	BTREE	referred_user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
affiliate_referrals_ibfk_1	affiliate_id	users	id	NO ACTION	NO ACTION
affiliate_referrals_ibfk_2	referred_user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `affiliate_referrals` (
  `id` int NOT NULL AUTO_INCREMENT,
  `affiliate_id` int NOT NULL,
  `referred_user_id` int NOT NULL,
  `tracking_code` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `source` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `landing_page` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ip_address` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_agent` text COLLATE utf8mb4_unicode_ci,
  `first_deposit_amount` decimal(20,2) DEFAULT NULL,
  `total_deposits` decimal(20,2) DEFAULT '0.00',
  `total_wagered` decimal(20,2) DEFAULT '0.00',
  `commission_earned` decimal(20,2) DEFAULT '0.00',
  `status` enum('pending','active','inactive','fraudulent') COLLATE utf8mb4_unicode_ci DEFAULT 'pending',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_referral` (`referred_user_id`),
  KEY `idx_affiliate` (`affiliate_id`),
  KEY `idx_status` (`status`),
  CONSTRAINT `affiliate_referrals_ibfk_1` FOREIGN KEY (`affiliate_id`) REFERENCES `users` (`id`),
  CONSTRAINT `affiliate_referrals_ibfk_2` FOREIGN KEY (`referred_user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: agency_contracts
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:49:26 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	agency_id	int	NO	NULL		MUL		
3	talent_id	int	NO	NULL		MUL		
4	contract_type	enum('exclusive','non-exclusive','trial')	YES	exclusive			utf8mb4_unicode_ci	
5	commission_rate	decimal(5,2)	NO	NULL				
6	duration_months	int	YES	12				
7	min_stream_hours	int	YES	60				
8	min_earnings_target	decimal(10,2)	YES	NULL				
9	benefits	json	YES	NULL				
10	status	enum('pending','active','expired','terminated')	YES	pending		MUL	utf8mb4_unicode_ci	
11	signed_at	timestamp	YES	NULL				
12	expires_at	timestamp	YES	NULL				
13	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_agency	NON_UNIQUE	BTREE	agency_id	0
idx_status	NON_UNIQUE	BTREE	status	0
idx_talent	NON_UNIQUE	BTREE	talent_id	0
unique_contract	UNIQUE	BTREE	agency_id, talent_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
agency_contracts_ibfk_1	agency_id	talent_agencies	id	NO ACTION	NO ACTION
agency_contracts_ibfk_2	talent_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `agency_contracts` (
  `id` int NOT NULL AUTO_INCREMENT,
  `agency_id` int NOT NULL,
  `talent_id` int NOT NULL,
  `contract_type` enum('exclusive','non-exclusive','trial') COLLATE utf8mb4_unicode_ci DEFAULT 'exclusive',
  `commission_rate` decimal(5,2) NOT NULL,
  `duration_months` int DEFAULT '12',
  `min_stream_hours` int DEFAULT '60',
  `min_earnings_target` decimal(10,2) DEFAULT NULL,
  `benefits` json DEFAULT NULL,
  `status` enum('pending','active','expired','terminated') COLLATE utf8mb4_unicode_ci DEFAULT 'pending',
  `signed_at` timestamp NULL DEFAULT NULL,
  `expires_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_contract` (`agency_id`,`talent_id`),
  KEY `idx_agency` (`agency_id`),
  KEY `idx_talent` (`talent_id`),
  KEY `idx_status` (`status`),
  CONSTRAINT `agency_contracts_ibfk_1` FOREIGN KEY (`agency_id`) REFERENCES `talent_agencies` (`id`),
  CONSTRAINT `agency_contracts_ibfk_2` FOREIGN KEY (`talent_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: ai_assistants
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.02 | TOTAL_MB: 0.03 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:11:15 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	assistant_name	varchar(100)	NO	NULL			utf8mb4_unicode_ci	
4	personality_type	enum('friendly','professional','romantic','funny','serious')	YES	friendly			utf8mb4_unicode_ci	
5	avatar_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
6	voice_model	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
7	language_model	varchar(100)	YES	gpt-4			utf8mb4_unicode_ci	
8	memory_context	json	YES	NULL				
9	conversation_style	json	YES	NULL				
10	knowledge_base	json	YES	NULL				
11	total_interactions	int	YES	0				
12	satisfaction_score	decimal(3,2)	YES	0.00				
13	monthly_token_usage	int	YES	0				
14	custom_training_data	text	YES	NULL			utf8mb4_unicode_ci	
15	is_nsfw_enabled	tinyint(1)	YES	0				
16	subscription_tier	enum('free','pro','unlimited')	YES	free			utf8mb4_unicode_ci	
17	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
ai_assistants_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `ai_assistants` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `assistant_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `personality_type` enum('friendly','professional','romantic','funny','serious') COLLATE utf8mb4_unicode_ci DEFAULT 'friendly',
  `avatar_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `voice_model` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `language_model` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'gpt-4',
  `memory_context` json DEFAULT NULL,
  `conversation_style` json DEFAULT NULL,
  `knowledge_base` json DEFAULT NULL,
  `total_interactions` int DEFAULT '0',
  `satisfaction_score` decimal(3,2) DEFAULT '0.00',
  `monthly_token_usage` int DEFAULT '0',
  `custom_training_data` text COLLATE utf8mb4_unicode_ci,
  `is_nsfw_enabled` tinyint(1) DEFAULT '0',
  `subscription_tier` enum('free','pro','unlimited') COLLATE utf8mb4_unicode_ci DEFAULT 'free',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  CONSTRAINT `ai_assistants_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: ai_chat_support
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.08 | TOTAL_MB: 0.09 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:53:23 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	session_id	varchar(100)	NO	NULL		UNI	utf8mb4_unicode_ci	
4	conversation	json	NO	NULL				
5	intent_detected	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
6	sentiment_score	decimal(5,4)	YES	NULL				
7	resolution_status	enum('resolved','escalated','abandoned','ongoing')	YES	ongoing		MUL	utf8mb4_unicode_ci	
8	escalation_reason	text	YES	NULL			utf8mb4_unicode_ci	
9	human_agent_id	int	YES	NULL		MUL		
10	satisfaction_rating	int	YES	NULL				
11	total_messages	int	YES	0				
12	ai_messages	int	YES	0				
13	human_messages	int	YES	0				
14	duration_seconds	int	YES	NULL				
15	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
16	ended_at	timestamp	YES	NULL				

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
human_agent_id	NON_UNIQUE	BTREE	human_agent_id	0
idx_session	NON_UNIQUE	BTREE	session_id	0
idx_status	NON_UNIQUE	BTREE	resolution_status	0
idx_user	NON_UNIQUE	BTREE	user_id	0
session_id	UNIQUE	BTREE	session_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
ai_chat_support_ibfk_1	user_id	users	id	NO ACTION	NO ACTION
ai_chat_support_ibfk_2	human_agent_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `ai_chat_support` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `session_id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `conversation` json NOT NULL,
  `intent_detected` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `sentiment_score` decimal(5,4) DEFAULT NULL,
  `resolution_status` enum('resolved','escalated','abandoned','ongoing') COLLATE utf8mb4_unicode_ci DEFAULT 'ongoing',
  `escalation_reason` text COLLATE utf8mb4_unicode_ci,
  `human_agent_id` int DEFAULT NULL,
  `satisfaction_rating` int DEFAULT NULL,
  `total_messages` int DEFAULT '0',
  `ai_messages` int DEFAULT '0',
  `human_messages` int DEFAULT '0',
  `duration_seconds` int DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `ended_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `session_id` (`session_id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_session` (`session_id`),
  KEY `idx_status` (`resolution_status`),
  KEY `human_agent_id` (`human_agent_id`),
  CONSTRAINT `ai_chat_support_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
  CONSTRAINT `ai_chat_support_ibfk_2` FOREIGN KEY (`human_agent_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: ai_competitor_monitoring
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:53:23 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	competitor_name	varchar(200)	NO	NULL		MUL	utf8mb4_unicode_ci	
3	competitor_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
4	product_matches	json	YES	NULL				
5	price_comparisons	json	YES	NULL				
6	promotion_tracking	json	YES	NULL				
7	inventory_status	json	YES	NULL				
8	review_comparison	json	YES	NULL				
9	market_share_estimate	decimal(5,2)	YES	NULL				
10	threat_level	enum('low','medium','high')	YES	medium		MUL	utf8mb4_unicode_ci	
11	recommended_actions	json	YES	NULL				
12	last_checked	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
13	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_competitor	NON_UNIQUE	BTREE	competitor_name	0
idx_threat	NON_UNIQUE	BTREE	threat_level	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `ai_competitor_monitoring` (
  `id` int NOT NULL AUTO_INCREMENT,
  `competitor_name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `competitor_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `product_matches` json DEFAULT NULL,
  `price_comparisons` json DEFAULT NULL,
  `promotion_tracking` json DEFAULT NULL,
  `inventory_status` json DEFAULT NULL,
  `review_comparison` json DEFAULT NULL,
  `market_share_estimate` decimal(5,2) DEFAULT NULL,
  `threat_level` enum('low','medium','high') COLLATE utf8mb4_unicode_ci DEFAULT 'medium',
  `recommended_actions` json DEFAULT NULL,
  `last_checked` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_competitor` (`competitor_name`),
  KEY `idx_threat` (`threat_level`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: ai_content_moderation
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:11:15 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	content_type	varchar(50)	NO	NULL		MUL	utf8mb4_unicode_ci	
3	content_id	int	NO	NULL				
4	user_id	int	NO	NULL		MUL		
5	ai_score_nsfw	decimal(5,4)	YES	NULL				
6	ai_score_violence	decimal(5,4)	YES	NULL				
7	ai_score_hate	decimal(5,4)	YES	NULL				
8	ai_score_harassment	decimal(5,4)	YES	NULL				
9	detected_objects	json	YES	NULL				
10	detected_text	json	YES	NULL				
11	detected_faces	int	YES	0				
12	age_estimation	json	YES	NULL				
13	action_taken	enum('approved','flagged','blocked','manual_review')	YES	approved		MUL	utf8mb4_unicode_ci	
14	confidence_level	decimal(5,4)	YES	NULL				
15	model_version	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
16	processing_time_ms	int	YES	NULL				
17	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_action	NON_UNIQUE	BTREE	action_taken	0
idx_content	NON_UNIQUE	BTREE	content_type, content_id	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
ai_content_moderation_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `ai_content_moderation` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `content_type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `content_id` int NOT NULL,
  `user_id` int NOT NULL,
  `ai_score_nsfw` decimal(5,4) DEFAULT NULL,
  `ai_score_violence` decimal(5,4) DEFAULT NULL,
  `ai_score_hate` decimal(5,4) DEFAULT NULL,
  `ai_score_harassment` decimal(5,4) DEFAULT NULL,
  `detected_objects` json DEFAULT NULL,
  `detected_text` json DEFAULT NULL,
  `detected_faces` int DEFAULT '0',
  `age_estimation` json DEFAULT NULL,
  `action_taken` enum('approved','flagged','blocked','manual_review') COLLATE utf8mb4_unicode_ci DEFAULT 'approved',
  `confidence_level` decimal(5,4) DEFAULT NULL,
  `model_version` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `processing_time_ms` int DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_content` (`content_type`,`content_id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_action` (`action_taken`),
  CONSTRAINT `ai_content_moderation_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: ai_conversations
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:11:15 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	assistant_id	int	NO	NULL		MUL		
3	user_id	int	NO	NULL		MUL		
4	session_id	varchar(100)	NO	NULL		UNI	utf8mb4_unicode_ci	
5	messages	json	YES	NULL				
6	context_summary	text	YES	NULL			utf8mb4_unicode_ci	
7	tokens_used	int	YES	0				
8	model_version	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
9	sentiment_analysis	json	YES	NULL				
10	topics_discussed	json	YES	NULL				
11	user_satisfaction	int	YES	NULL				
12	duration_seconds	int	YES	NULL				
13	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_assistant	NON_UNIQUE	BTREE	assistant_id	0
idx_session	NON_UNIQUE	BTREE	session_id	0
idx_user	NON_UNIQUE	BTREE	user_id	0
session_id	UNIQUE	BTREE	session_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
ai_conversations_ibfk_1	assistant_id	ai_assistants	id	NO ACTION	NO ACTION
ai_conversations_ibfk_2	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `ai_conversations` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `assistant_id` int NOT NULL,
  `user_id` int NOT NULL,
  `session_id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `messages` json DEFAULT NULL,
  `context_summary` text COLLATE utf8mb4_unicode_ci,
  `tokens_used` int DEFAULT '0',
  `model_version` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `sentiment_analysis` json DEFAULT NULL,
  `topics_discussed` json DEFAULT NULL,
  `user_satisfaction` int DEFAULT NULL,
  `duration_seconds` int DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `session_id` (`session_id`),
  KEY `idx_assistant` (`assistant_id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_session` (`session_id`),
  CONSTRAINT `ai_conversations_ibfk_1` FOREIGN KEY (`assistant_id`) REFERENCES `ai_assistants` (`id`),
  CONSTRAINT `ai_conversations_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: ai_customer_insights
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:53:23 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	customer_id	int	NO	NULL		MUL		
3	insight_type	enum('churn_risk','upsell_opportunity','lifecycle_stage','segment_change','behavior_anomaly')	NO	NULL		MUL	utf8mb4_unicode_ci	
4	insight_value	json	NO	NULL				
5	confidence_score	decimal(5,4)	YES	NULL				
6	recommended_actions	json	YES	NULL				
7	priority_level	enum('low','medium','high','critical')	YES	medium		MUL	utf8mb4_unicode_ci	
8	expires_at	timestamp	NO	NULL				
9	actioned	tinyint(1)	YES	0		MUL		
10	action_taken	text	YES	NULL			utf8mb4_unicode_ci	
11	outcome	json	YES	NULL				
12	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_actioned	NON_UNIQUE	BTREE	actioned	0
idx_customer	NON_UNIQUE	BTREE	customer_id	0
idx_priority	NON_UNIQUE	BTREE	priority_level	0
idx_type	NON_UNIQUE	BTREE	insight_type	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
ai_customer_insights_ibfk_1	customer_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `ai_customer_insights` (
  `id` int NOT NULL AUTO_INCREMENT,
  `customer_id` int NOT NULL,
  `insight_type` enum('churn_risk','upsell_opportunity','lifecycle_stage','segment_change','behavior_anomaly') COLLATE utf8mb4_unicode_ci NOT NULL,
  `insight_value` json NOT NULL,
  `confidence_score` decimal(5,4) DEFAULT NULL,
  `recommended_actions` json DEFAULT NULL,
  `priority_level` enum('low','medium','high','critical') COLLATE utf8mb4_unicode_ci DEFAULT 'medium',
  `expires_at` timestamp NOT NULL,
  `actioned` tinyint(1) DEFAULT '0',
  `action_taken` text COLLATE utf8mb4_unicode_ci,
  `outcome` json DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_customer` (`customer_id`),
  KEY `idx_type` (`insight_type`),
  KEY `idx_priority` (`priority_level`),
  KEY `idx_actioned` (`actioned`),
  CONSTRAINT `ai_customer_insights_ibfk_1` FOREIGN KEY (`customer_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: ai_fraud_detection
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:53:23 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	entity_type	enum('order','user','payment','review','return')	NO	NULL		MUL	utf8mb4_unicode_ci	
3	entity_id	bigint	NO	NULL				
4	risk_score	decimal(5,4)	NO	NULL		MUL		
5	risk_factors	json	NO	NULL				
6	ml_model_version	varchar(20)	YES	NULL			utf8mb4_unicode_ci	
7	rules_triggered	json	YES	NULL				
8	action_recommended	enum('approve','review','hold','reject')	NO	NULL			utf8mb4_unicode_ci	
9	action_taken	enum('approved','held','rejected','manual_review')	YES	manual_review		MUL	utf8mb4_unicode_ci	
10	reviewed_by	int	YES	NULL		MUL		
11	review_notes	text	YES	NULL			utf8mb4_unicode_ci	
12	was_fraud	tinyint(1)	YES	NULL				
13	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
14	reviewed_at	timestamp	YES	NULL				

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_action	NON_UNIQUE	BTREE	action_taken	0
idx_entity	NON_UNIQUE	BTREE	entity_type, entity_id	0
idx_risk_score	NON_UNIQUE	BTREE	risk_score	0
reviewed_by	NON_UNIQUE	BTREE	reviewed_by	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
ai_fraud_detection_ibfk_1	reviewed_by	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `ai_fraud_detection` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `entity_type` enum('order','user','payment','review','return') COLLATE utf8mb4_unicode_ci NOT NULL,
  `entity_id` bigint NOT NULL,
  `risk_score` decimal(5,4) NOT NULL,
  `risk_factors` json NOT NULL,
  `ml_model_version` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `rules_triggered` json DEFAULT NULL,
  `action_recommended` enum('approve','review','hold','reject') COLLATE utf8mb4_unicode_ci NOT NULL,
  `action_taken` enum('approved','held','rejected','manual_review') COLLATE utf8mb4_unicode_ci DEFAULT 'manual_review',
  `reviewed_by` int DEFAULT NULL,
  `review_notes` text COLLATE utf8mb4_unicode_ci,
  `was_fraud` tinyint(1) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `reviewed_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_entity` (`entity_type`,`entity_id`),
  KEY `idx_risk_score` (`risk_score`),
  KEY `idx_action` (`action_taken`),
  KEY `reviewed_by` (`reviewed_by`),
  CONSTRAINT `ai_fraud_detection_ibfk_1` FOREIGN KEY (`reviewed_by`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: ai_image_generation
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:11:15 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	prompt	text	NO	NULL			utf8mb4_unicode_ci	
4	negative_prompt	text	YES	NULL			utf8mb4_unicode_ci	
5	model_used	varchar(100)	YES	stable-diffusion			utf8mb4_unicode_ci	
6	style	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
7	resolution	varchar(20)	YES	1024x1024			utf8mb4_unicode_ci	
8	seed	bigint	YES	NULL				
9	steps	int	YES	50				
10	guidance_scale	decimal(4,2)	YES	7.50				
11	images_generated	json	YES	NULL				
12	generation_time_seconds	int	YES	NULL				
13	tokens_used	int	YES	NULL				
14	is_nsfw	tinyint(1)	YES	0				
15	is_public	tinyint(1)	YES	0		MUL		
16	likes_count	int	YES	0				
17	remix_count	int	YES	0				
18	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_public	NON_UNIQUE	BTREE	is_public	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
ai_image_generation_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `ai_image_generation` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `prompt` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `negative_prompt` text COLLATE utf8mb4_unicode_ci,
  `model_used` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'stable-diffusion',
  `style` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `resolution` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT '1024x1024',
  `seed` bigint DEFAULT NULL,
  `steps` int DEFAULT '50',
  `guidance_scale` decimal(4,2) DEFAULT '7.50',
  `images_generated` json DEFAULT NULL,
  `generation_time_seconds` int DEFAULT NULL,
  `tokens_used` int DEFAULT NULL,
  `is_nsfw` tinyint(1) DEFAULT '0',
  `is_public` tinyint(1) DEFAULT '0',
  `likes_count` int DEFAULT '0',
  `remix_count` int DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_public` (`is_public`),
  CONSTRAINT `ai_image_generation_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: ai_inventory_forecast
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:53:23 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	product_id	bigint	NO	NULL		MUL		
3	forecast_date	date	NO	NULL		MUL		
4	predicted_demand	int	NO	NULL				
5	confidence_interval_lower	int	YES	NULL				
6	confidence_interval_upper	int	YES	NULL				
7	seasonality_index	decimal(5,2)	YES	NULL				
8	trend_component	decimal(10,2)	YES	NULL				
9	external_factors	json	YES	NULL				
10	recommended_stock_level	int	YES	NULL				
11	reorder_point	int	YES	NULL				
12	reorder_quantity	int	YES	NULL				
13	stockout_probability	decimal(5,4)	YES	NULL				
14	overstock_probability	decimal(5,4)	YES	NULL				
15	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_date	NON_UNIQUE	BTREE	forecast_date	0
idx_product	NON_UNIQUE	BTREE	product_id	0
unique_forecast	UNIQUE	BTREE	product_id, forecast_date	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
ai_inventory_forecast_ibfk_1	product_id	products_catalog	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `ai_inventory_forecast` (
  `id` int NOT NULL AUTO_INCREMENT,
  `product_id` bigint NOT NULL,
  `forecast_date` date NOT NULL,
  `predicted_demand` int NOT NULL,
  `confidence_interval_lower` int DEFAULT NULL,
  `confidence_interval_upper` int DEFAULT NULL,
  `seasonality_index` decimal(5,2) DEFAULT NULL,
  `trend_component` decimal(10,2) DEFAULT NULL,
  `external_factors` json DEFAULT NULL,
  `recommended_stock_level` int DEFAULT NULL,
  `reorder_point` int DEFAULT NULL,
  `reorder_quantity` int DEFAULT NULL,
  `stockout_probability` decimal(5,4) DEFAULT NULL,
  `overstock_probability` decimal(5,4) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_forecast` (`product_id`,`forecast_date`),
  KEY `idx_product` (`product_id`),
  KEY `idx_date` (`forecast_date`),
  CONSTRAINT `ai_inventory_forecast_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `products_catalog` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: ai_marketing_automation
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:53:23 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	campaign_type	enum('email','sms','push','retargeting','social')	NO	NULL		MUL	utf8mb4_unicode_ci	
3	target_segment	json	NO	NULL				
4	content_generated	json	YES	NULL				
5	personalization_variables	json	YES	NULL				
6	optimal_send_time	timestamp	YES	NULL				
7	expected_open_rate	decimal(5,2)	YES	NULL				
8	expected_click_rate	decimal(5,2)	YES	NULL				
9	expected_conversion_rate	decimal(5,2)	YES	NULL				
10	actual_results	json	YES	NULL				
11	ab_test_variations	json	YES	NULL				
12	winning_variation	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
13	status	enum('draft','scheduled','running','completed')	YES	draft		MUL	utf8mb4_unicode_ci	
14	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
15	executed_at	timestamp	YES	NULL				

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_status	NON_UNIQUE	BTREE	status	0
idx_type	NON_UNIQUE	BTREE	campaign_type	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `ai_marketing_automation` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `campaign_type` enum('email','sms','push','retargeting','social') COLLATE utf8mb4_unicode_ci NOT NULL,
  `target_segment` json NOT NULL,
  `content_generated` json DEFAULT NULL,
  `personalization_variables` json DEFAULT NULL,
  `optimal_send_time` timestamp NULL DEFAULT NULL,
  `expected_open_rate` decimal(5,2) DEFAULT NULL,
  `expected_click_rate` decimal(5,2) DEFAULT NULL,
  `expected_conversion_rate` decimal(5,2) DEFAULT NULL,
  `actual_results` json DEFAULT NULL,
  `ab_test_variations` json DEFAULT NULL,
  `winning_variation` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` enum('draft','scheduled','running','completed') COLLATE utf8mb4_unicode_ci DEFAULT 'draft',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `executed_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_type` (`campaign_type`),
  KEY `idx_status` (`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: ai_pricing_engine
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:53:23 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	product_id	bigint	NO	NULL		MUL		
3	current_price	decimal(12,2)	NO	NULL				
4	suggested_price	decimal(12,2)	NO	NULL				
5	min_price	decimal(12,2)	YES	NULL				
6	max_price	decimal(12,2)	YES	NULL				
7	competitor_prices	json	YES	NULL				
8	demand_score	decimal(5,2)	YES	NULL				
9	seasonality_factor	decimal(5,2)	YES	NULL				
10	inventory_factor	decimal(5,2)	YES	NULL				
11	price_elasticity	decimal(10,4)	YES	NULL				
12	expected_revenue_change	decimal(10,2)	YES	NULL				
13	confidence_level	decimal(5,4)	YES	NULL				
14	valid_until	timestamp	NO	NULL		MUL		
15	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_product	NON_UNIQUE	BTREE	product_id	0
idx_valid_until	NON_UNIQUE	BTREE	valid_until	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
ai_pricing_engine_ibfk_1	product_id	products_catalog	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `ai_pricing_engine` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `product_id` bigint NOT NULL,
  `current_price` decimal(12,2) NOT NULL,
  `suggested_price` decimal(12,2) NOT NULL,
  `min_price` decimal(12,2) DEFAULT NULL,
  `max_price` decimal(12,2) DEFAULT NULL,
  `competitor_prices` json DEFAULT NULL,
  `demand_score` decimal(5,2) DEFAULT NULL,
  `seasonality_factor` decimal(5,2) DEFAULT NULL,
  `inventory_factor` decimal(5,2) DEFAULT NULL,
  `price_elasticity` decimal(10,4) DEFAULT NULL,
  `expected_revenue_change` decimal(10,2) DEFAULT NULL,
  `confidence_level` decimal(5,4) DEFAULT NULL,
  `valid_until` timestamp NOT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_product` (`product_id`),
  KEY `idx_valid_until` (`valid_until`),
  CONSTRAINT `ai_pricing_engine_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `products_catalog` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: ai_product_optimization
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:53:23 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	product_id	bigint	NO	NULL		MUL		
3	optimization_type	enum('title','description','images','pricing','keywords','category')	NO	NULL		MUL	utf8mb4_unicode_ci	
4	original_value	text	YES	NULL			utf8mb4_unicode_ci	
5	suggested_value	text	YES	NULL			utf8mb4_unicode_ci	
6	confidence_score	decimal(5,4)	YES	NULL				
7	expected_impact	json	YES	NULL				
8	a_b_test_results	json	YES	NULL				
9	applied	tinyint(1)	YES	0		MUL		
10	applied_at	timestamp	YES	NULL				
11	performance_change	decimal(10,2)	YES	NULL				
12	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_applied	NON_UNIQUE	BTREE	applied	0
idx_product	NON_UNIQUE	BTREE	product_id	0
idx_type	NON_UNIQUE	BTREE	optimization_type	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
ai_product_optimization_ibfk_1	product_id	products_catalog	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `ai_product_optimization` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `product_id` bigint NOT NULL,
  `optimization_type` enum('title','description','images','pricing','keywords','category') COLLATE utf8mb4_unicode_ci NOT NULL,
  `original_value` text COLLATE utf8mb4_unicode_ci,
  `suggested_value` text COLLATE utf8mb4_unicode_ci,
  `confidence_score` decimal(5,4) DEFAULT NULL,
  `expected_impact` json DEFAULT NULL,
  `a_b_test_results` json DEFAULT NULL,
  `applied` tinyint(1) DEFAULT '0',
  `applied_at` timestamp NULL DEFAULT NULL,
  `performance_change` decimal(10,2) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_product` (`product_id`),
  KEY `idx_type` (`optimization_type`),
  KEY `idx_applied` (`applied`),
  CONSTRAINT `ai_product_optimization_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `products_catalog` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: ai_recommendations
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:51:43 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	recommendation_type	enum('products','bundles','categories','stores','deals')	NO	NULL		MUL	utf8mb4_unicode_ci	
4	algorithm_version	varchar(20)	YES	NULL			utf8mb4_unicode_ci	
5	recommended_items	json	NO	NULL				
6	confidence_scores	json	YES	NULL				
7	reason_codes	json	YES	NULL				
8	context_data	json	YES	NULL				
9	impressions	int	YES	0				
10	clicks	int	YES	0				
11	conversions	int	YES	0				
12	revenue_generated	decimal(12,2)	YES	0.00				
13	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED	MUL		
14	expires_at	timestamp	YES	NULL				

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_created	NON_UNIQUE	BTREE	created_at	0
idx_type	NON_UNIQUE	BTREE	recommendation_type	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
ai_recommendations_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `ai_recommendations` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `recommendation_type` enum('products','bundles','categories','stores','deals') COLLATE utf8mb4_unicode_ci NOT NULL,
  `algorithm_version` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `recommended_items` json NOT NULL,
  `confidence_scores` json DEFAULT NULL,
  `reason_codes` json DEFAULT NULL,
  `context_data` json DEFAULT NULL,
  `impressions` int DEFAULT '0',
  `clicks` int DEFAULT '0',
  `conversions` int DEFAULT '0',
  `revenue_generated` decimal(12,2) DEFAULT '0.00',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `expires_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_type` (`recommendation_type`),
  KEY `idx_created` (`created_at`),
  CONSTRAINT `ai_recommendations_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: ai_review_analysis
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:53:23 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	review_id	bigint	NO	NULL		MUL		
3	sentiment	enum('very_negative','negative','neutral','positive','very_positive')	NO	NULL		MUL	utf8mb4_unicode_ci	
4	sentiment_score	decimal(5,4)	YES	NULL				
5	topics_extracted	json	YES	NULL				
6	key_phrases	json	YES	NULL				
7	product_aspects	json	YES	NULL				
8	emotions_detected	json	YES	NULL				
9	authenticity_score	decimal(5,4)	YES	NULL				
10	helpfulness_prediction	decimal(5,4)	YES	NULL				
11	response_suggested	text	YES	NULL			utf8mb4_unicode_ci	
12	requires_response	tinyint(1)	YES	0				
13	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_review	NON_UNIQUE	BTREE	review_id	0
idx_sentiment	NON_UNIQUE	BTREE	sentiment	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
ai_review_analysis_ibfk_1	review_id	product_reviews	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `ai_review_analysis` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `review_id` bigint NOT NULL,
  `sentiment` enum('very_negative','negative','neutral','positive','very_positive') COLLATE utf8mb4_unicode_ci NOT NULL,
  `sentiment_score` decimal(5,4) DEFAULT NULL,
  `topics_extracted` json DEFAULT NULL,
  `key_phrases` json DEFAULT NULL,
  `product_aspects` json DEFAULT NULL,
  `emotions_detected` json DEFAULT NULL,
  `authenticity_score` decimal(5,4) DEFAULT NULL,
  `helpfulness_prediction` decimal(5,4) DEFAULT NULL,
  `response_suggested` text COLLATE utf8mb4_unicode_ci,
  `requires_response` tinyint(1) DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_review` (`review_id`),
  KEY `idx_sentiment` (`sentiment`),
  CONSTRAINT `ai_review_analysis_ibfk_1` FOREIGN KEY (`review_id`) REFERENCES `product_reviews` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: ai_visual_search
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:53:23 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	search_image_url	varchar(500)	NO	NULL			utf8mb4_unicode_ci	
4	image_hash	varchar(64)	YES	NULL		MUL	utf8mb4_unicode_ci	
5	detected_objects	json	YES	NULL				
6	detected_brands	json	YES	NULL				
7	detected_text	json	YES	NULL				
8	color_palette	json	YES	NULL				
9	style_attributes	json	YES	NULL				
10	matching_products	json	YES	NULL				
11	similarity_scores	json	YES	NULL				
12	clicked_product_id	bigint	YES	NULL				
13	purchased_product_id	bigint	YES	NULL				
14	search_quality_rating	int	YES	NULL				
15	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_hash	NON_UNIQUE	BTREE	image_hash	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
ai_visual_search_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `ai_visual_search` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `search_image_url` varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL,
  `image_hash` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `detected_objects` json DEFAULT NULL,
  `detected_brands` json DEFAULT NULL,
  `detected_text` json DEFAULT NULL,
  `color_palette` json DEFAULT NULL,
  `style_attributes` json DEFAULT NULL,
  `matching_products` json DEFAULT NULL,
  `similarity_scores` json DEFAULT NULL,
  `clicked_product_id` bigint DEFAULT NULL,
  `purchased_product_id` bigint DEFAULT NULL,
  `search_quality_rating` int DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_hash` (`image_hash`),
  CONSTRAINT `ai_visual_search_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: ai_voice_cloning
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:11:15 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	voice_name	varchar(100)	NO	NULL			utf8mb4_unicode_ci	
4	sample_audio_urls	json	YES	NULL				
5	voice_model_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
6	voice_characteristics	json	YES	NULL				
7	language	varchar(10)	YES	en			utf8mb4_unicode_ci	
8	is_verified	tinyint(1)	YES	0				
9	is_celebrity	tinyint(1)	YES	0				
10	usage_rights	enum('personal','commercial','restricted')	YES	personal			utf8mb4_unicode_ci	
11	times_used	int	YES	0				
12	quality_score	decimal(3,2)	YES	NULL				
13	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_user	NON_UNIQUE	BTREE	user_id	0
unique_user_voice	UNIQUE	BTREE	user_id, voice_name	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
ai_voice_cloning_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `ai_voice_cloning` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `voice_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `sample_audio_urls` json DEFAULT NULL,
  `voice_model_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `voice_characteristics` json DEFAULT NULL,
  `language` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT 'en',
  `is_verified` tinyint(1) DEFAULT '0',
  `is_celebrity` tinyint(1) DEFAULT '0',
  `usage_rights` enum('personal','commercial','restricted') COLLATE utf8mb4_unicode_ci DEFAULT 'personal',
  `times_used` int DEFAULT '0',
  `quality_score` decimal(3,2) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_user_voice` (`user_id`,`voice_name`),
  KEY `idx_user` (`user_id`),
  CONSTRAINT `ai_voice_cloning_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: alert_configurations
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 16:03:29 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	alert_name	varchar(200)	NO	NULL			utf8mb4_unicode_ci	
3	alert_type	varchar(100)	NO	NULL		MUL	utf8mb4_unicode_ci	
4	module	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
5	condition_query	text	NO	NULL			utf8mb4_unicode_ci	
6	threshold_value	decimal(20,4)	YES	NULL				
7	comparison_operator	enum('>','<','>=','<=','=','!=')	NO	NULL			utf8mb4_unicode_ci	
8	check_frequency_minutes	int	YES	5				
9	notification_channels	json	YES	NULL				
10	recipients	json	YES	NULL				
11	escalation_rules	json	YES	NULL				
12	is_active	tinyint(1)	YES	1		MUL		
13	last_triggered	timestamp	YES	NULL				
14	trigger_count	int	YES	0				
15	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_active	NON_UNIQUE	BTREE	is_active	0
idx_type	NON_UNIQUE	BTREE	alert_type	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `alert_configurations` (
  `id` int NOT NULL AUTO_INCREMENT,
  `alert_name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `alert_type` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `module` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `condition_query` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `threshold_value` decimal(20,4) DEFAULT NULL,
  `comparison_operator` enum('>','<','>=','<=','=','!=') COLLATE utf8mb4_unicode_ci NOT NULL,
  `check_frequency_minutes` int DEFAULT '5',
  `notification_channels` json DEFAULT NULL,
  `recipients` json DEFAULT NULL,
  `escalation_rules` json DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT '1',
  `last_triggered` timestamp NULL DEFAULT NULL,
  `trigger_count` int DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_type` (`alert_type`),
  KEY `idx_active` (`is_active`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: alert_history
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 16:03:29 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	alert_id	int	NO	NULL		MUL		
3	triggered_value	decimal(20,4)	YES	NULL				
4	alert_message	text	YES	NULL			utf8mb4_unicode_ci	
5	severity	enum('info','warning','error','critical')	NO	NULL		MUL	utf8mb4_unicode_ci	
6	notified_users	json	YES	NULL				
7	acknowledged	tinyint(1)	YES	0		MUL		
8	acknowledged_by	int	YES	NULL		MUL		
9	acknowledged_at	timestamp	YES	NULL				
10	resolution_notes	text	YES	NULL			utf8mb4_unicode_ci	
11	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
acknowledged_by	NON_UNIQUE	BTREE	acknowledged_by	0
idx_acknowledged	NON_UNIQUE	BTREE	acknowledged	0
idx_alert	NON_UNIQUE	BTREE	alert_id	0
idx_severity	NON_UNIQUE	BTREE	severity	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
alert_history_ibfk_1	alert_id	alert_configurations	id	NO ACTION	NO ACTION
alert_history_ibfk_2	acknowledged_by	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `alert_history` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `alert_id` int NOT NULL,
  `triggered_value` decimal(20,4) DEFAULT NULL,
  `alert_message` text COLLATE utf8mb4_unicode_ci,
  `severity` enum('info','warning','error','critical') COLLATE utf8mb4_unicode_ci NOT NULL,
  `notified_users` json DEFAULT NULL,
  `acknowledged` tinyint(1) DEFAULT '0',
  `acknowledged_by` int DEFAULT NULL,
  `acknowledged_at` timestamp NULL DEFAULT NULL,
  `resolution_notes` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_alert` (`alert_id`),
  KEY `idx_severity` (`severity`),
  KEY `idx_acknowledged` (`acknowledged`),
  KEY `acknowledged_by` (`acknowledged_by`),
  CONSTRAINT `alert_history_ibfk_1` FOREIGN KEY (`alert_id`) REFERENCES `alert_configurations` (`id`),
  CONSTRAINT `alert_history_ibfk_2` FOREIGN KEY (`acknowledged_by`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: analytics_data
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-07 01:09:42 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	metric_type	varchar(50)	NO	NULL			utf8mb4_unicode_ci	
4	metric_value	json	NO	NULL				
5	date	date	NO	NULL		MUL		
6	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_date	NON_UNIQUE	BTREE	date	0
idx_user	NON_UNIQUE	BTREE	user_id	0
unique_user_metric_date	UNIQUE	BTREE	user_id, metric_type, date	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
analytics_data_ibfk_1	user_id	users	id	NO ACTION	CASCADE

--- SHOW CREATE TABLE ---
CREATE TABLE `analytics_data` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `metric_type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `metric_value` json NOT NULL,
  `date` date NOT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_user_metric_date` (`user_id`,`metric_type`,`date`),
  KEY `idx_user` (`user_id`),
  KEY `idx_date` (`date`),
  CONSTRAINT `analytics_data_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: anomaly_detection
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 16:04:49 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	metric_name	varchar(200)	NO	NULL		MUL	utf8mb4_unicode_ci	
3	expected_value	decimal(20,4)	YES	NULL				
4	actual_value	decimal(20,4)	YES	NULL				
5	deviation_percentage	decimal(10,2)	YES	NULL				
6	standard_deviations	decimal(10,2)	YES	NULL				
7	anomaly_score	decimal(5,2)	YES	NULL				
8	is_anomaly	tinyint(1)	YES	0		MUL		
9	possible_causes	json	YES	NULL				
10	affected_users	int	YES	NULL				
11	business_impact	decimal(20,2)	YES	NULL				
12	alert_sent	tinyint(1)	YES	0				
13	investigated	tinyint(1)	YES	0				
14	resolution	text	YES	NULL			utf8mb4_unicode_ci	
15	detected_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED	MUL		

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_anomaly	NON_UNIQUE	BTREE	is_anomaly	0
idx_detected	NON_UNIQUE	BTREE	detected_at	0
idx_metric	NON_UNIQUE	BTREE	metric_name	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `anomaly_detection` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `metric_name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `expected_value` decimal(20,4) DEFAULT NULL,
  `actual_value` decimal(20,4) DEFAULT NULL,
  `deviation_percentage` decimal(10,2) DEFAULT NULL,
  `standard_deviations` decimal(10,2) DEFAULT NULL,
  `anomaly_score` decimal(5,2) DEFAULT NULL,
  `is_anomaly` tinyint(1) DEFAULT '0',
  `possible_causes` json DEFAULT NULL,
  `affected_users` int DEFAULT NULL,
  `business_impact` decimal(20,2) DEFAULT NULL,
  `alert_sent` tinyint(1) DEFAULT '0',
  `investigated` tinyint(1) DEFAULT '0',
  `resolution` text COLLATE utf8mb4_unicode_ci,
  `detected_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_metric` (`metric_name`),
  KEY `idx_anomaly` (`is_anomaly`),
  KEY `idx_detected` (`detected_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: api_endpoints
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 7 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 8 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 03:07:04 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	endpoint_path	varchar(255)	NO	NULL		MUL	utf8mb4_unicode_ci	
3	http_method	varchar(10)	NO	NULL			utf8mb4_unicode_ci	
4	module	varchar(50)	NO	NULL		MUL	utf8mb4_unicode_ci	
5	required_permissions	json	YES	NULL				
6	rate_limit_per_minute	int	YES	60				
7	cache_ttl_seconds	int	YES	0				
8	is_public	tinyint(1)	YES	0		MUL		
9	requires_kyc	tinyint(1)	YES	0				
10	min_vip_level	int	YES	0				
11	is_active	tinyint(1)	YES	1				
12	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	7
idx_module	NON_UNIQUE	BTREE	module	7
idx_public	NON_UNIQUE	BTREE	is_public	1
unique_endpoint	UNIQUE	BTREE	endpoint_path, http_method	7

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `api_endpoints` (
  `id` int NOT NULL AUTO_INCREMENT,
  `endpoint_path` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `http_method` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
  `module` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `required_permissions` json DEFAULT NULL,
  `rate_limit_per_minute` int DEFAULT '60',
  `cache_ttl_seconds` int DEFAULT '0',
  `is_public` tinyint(1) DEFAULT '0',
  `requires_kyc` tinyint(1) DEFAULT '0',
  `min_vip_level` int DEFAULT '0',
  `is_active` tinyint(1) DEFAULT '1',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_endpoint` (`endpoint_path`,`http_method`),
  KEY `idx_module` (`module`),
  KEY `idx_public` (`is_public`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: api_rate_limits
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:53:41 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	platform	varchar(100)	NO	NULL		MUL	utf8mb4_unicode_ci	
3	endpoint	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
4	requests_per_minute	int	YES	60				
5	requests_per_hour	int	YES	3600				
6	requests_per_day	int	YES	86400				
7	current_minute_count	int	YES	0				
8	current_hour_count	int	YES	0				
9	current_day_count	int	YES	0				
10	last_request	timestamp	YES	NULL				
11	reset_minute	timestamp	YES	NULL				
12	reset_hour	timestamp	YES	NULL				
13	reset_day	timestamp	YES	NULL				

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_platform	NON_UNIQUE	BTREE	platform	0
unique_endpoint	UNIQUE	BTREE	platform, endpoint	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `api_rate_limits` (
  `id` int NOT NULL AUTO_INCREMENT,
  `platform` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `endpoint` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `requests_per_minute` int DEFAULT '60',
  `requests_per_hour` int DEFAULT '3600',
  `requests_per_day` int DEFAULT '86400',
  `current_minute_count` int DEFAULT '0',
  `current_hour_count` int DEFAULT '0',
  `current_day_count` int DEFAULT '0',
  `last_request` timestamp NULL DEFAULT NULL,
  `reset_minute` timestamp NULL DEFAULT NULL,
  `reset_hour` timestamp NULL DEFAULT NULL,
  `reset_day` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_endpoint` (`platform`,`endpoint`),
  KEY `idx_platform` (`platform`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: asks
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:28:08 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	blog_id	int	NO	NULL		MUL		
3	asker_id	int	YES	NULL		MUL		
4	question	text	NO	NULL			utf8mb4_unicode_ci	
5	answer	text	YES	NULL			utf8mb4_unicode_ci	
6	is_anonymous	tinyint(1)	YES	0				
7	is_private	tinyint(1)	YES	0				
8	is_answered	tinyint(1)	YES	0		MUL		
9	answered_at	timestamp	YES	NULL				
10	post_id	bigint	YES	NULL				
11	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_answered	NON_UNIQUE	BTREE	is_answered	0
idx_asker	NON_UNIQUE	BTREE	asker_id	0
idx_blog	NON_UNIQUE	BTREE	blog_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
asks_ibfk_1	blog_id	blogs	id	NO ACTION	NO ACTION
asks_ibfk_2	asker_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `asks` (
  `id` int NOT NULL AUTO_INCREMENT,
  `blog_id` int NOT NULL,
  `asker_id` int DEFAULT NULL,
  `question` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `answer` text COLLATE utf8mb4_unicode_ci,
  `is_anonymous` tinyint(1) DEFAULT '0',
  `is_private` tinyint(1) DEFAULT '0',
  `is_answered` tinyint(1) DEFAULT '0',
  `answered_at` timestamp NULL DEFAULT NULL,
  `post_id` bigint DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_blog` (`blog_id`),
  KEY `idx_asker` (`asker_id`),
  KEY `idx_answered` (`is_answered`),
  CONSTRAINT `asks_ibfk_1` FOREIGN KEY (`blog_id`) REFERENCES `blogs` (`id`),
  CONSTRAINT `asks_ibfk_2` FOREIGN KEY (`asker_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: attribution_modeling
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:53:58 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	conversion_id	varchar(100)	NO	NULL		MUL	utf8mb4_unicode_ci	
3	conversion_value	decimal(20,2)	NO	NULL				
4	touchpoints	json	NO	NULL				
5	attribution_model	varchar(50)	NO	NULL		MUL	utf8mb4_unicode_ci	
6	channel_credits	json	NO	NULL				
7	first_touch_channel	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
8	last_touch_channel	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
9	conversion_path_length	int	YES	NULL				
10	time_to_conversion_hours	int	YES	NULL				
11	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_conversion	NON_UNIQUE	BTREE	conversion_id	0
idx_model	NON_UNIQUE	BTREE	attribution_model	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `attribution_modeling` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `conversion_id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `conversion_value` decimal(20,2) NOT NULL,
  `touchpoints` json NOT NULL,
  `attribution_model` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `channel_credits` json NOT NULL,
  `first_touch_channel` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `last_touch_channel` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `conversion_path_length` int DEFAULT NULL,
  `time_to_conversion_hours` int DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_conversion` (`conversion_id`),
  KEY `idx_model` (`attribution_model`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: auction_bids
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:52:02 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	auction_id	bigint	NO	NULL		MUL		
3	bidder_id	int	NO	NULL		MUL		
4	bid_amount	decimal(12,2)	NO	NULL		MUL		
5	max_bid	decimal(12,2)	YES	NULL				
6	is_auto_bid	tinyint(1)	YES	0				
7	ip_address	varchar(45)	YES	NULL			utf8mb4_unicode_ci	
8	user_agent	text	YES	NULL			utf8mb4_unicode_ci	
9	is_winning	tinyint(1)	YES	0		MUL		
10	is_retracted	tinyint(1)	YES	0				
11	retraction_reason	text	YES	NULL			utf8mb4_unicode_ci	
12	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_amount	NON_UNIQUE	BTREE	bid_amount	0
idx_auction	NON_UNIQUE	BTREE	auction_id	0
idx_bidder	NON_UNIQUE	BTREE	bidder_id	0
idx_winning	NON_UNIQUE	BTREE	is_winning	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
auction_bids_ibfk_1	auction_id	auction_listings	id	NO ACTION	NO ACTION
auction_bids_ibfk_2	bidder_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `auction_bids` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `auction_id` bigint NOT NULL,
  `bidder_id` int NOT NULL,
  `bid_amount` decimal(12,2) NOT NULL,
  `max_bid` decimal(12,2) DEFAULT NULL,
  `is_auto_bid` tinyint(1) DEFAULT '0',
  `ip_address` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_agent` text COLLATE utf8mb4_unicode_ci,
  `is_winning` tinyint(1) DEFAULT '0',
  `is_retracted` tinyint(1) DEFAULT '0',
  `retraction_reason` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_auction` (`auction_id`),
  KEY `idx_bidder` (`bidder_id`),
  KEY `idx_amount` (`bid_amount`),
  KEY `idx_winning` (`is_winning`),
  CONSTRAINT `auction_bids_ibfk_1` FOREIGN KEY (`auction_id`) REFERENCES `auction_listings` (`id`),
  CONSTRAINT `auction_bids_ibfk_2` FOREIGN KEY (`bidder_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: auction_listings
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.11 | TOTAL_MB: 0.13 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:52:02 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	seller_id	int	NO	NULL		MUL		
3	product_id	bigint	YES	NULL				
4	listing_type	enum('auction','buy_now','both')	YES	auction			utf8mb4_unicode_ci	
5	title	varchar(500)	NO	NULL		MUL	utf8mb4_unicode_ci	
6	description	text	YES	NULL			utf8mb4_unicode_ci	
7	condition_type	enum('new','refurbished','used_like_new','used_good','used_acceptable','for_parts')	NO	NULL			utf8mb4_unicode_ci	
8	category_path	json	YES	NULL				
9	images	json	YES	NULL				
10	starting_bid	decimal(12,2)	NO	NULL				
11	current_bid	decimal(12,2)	YES	NULL		MUL		
12	buy_now_price	decimal(12,2)	YES	NULL				
13	reserve_price	decimal(12,2)	YES	NULL				
14	reserve_met	tinyint(1)	YES	0				
15	bid_increment	decimal(10,2)	YES	1.00				
16	quantity	int	YES	1				
17	shipping_options	json	YES	NULL				
18	international_shipping	tinyint(1)	YES	0				
19	returns_accepted	tinyint(1)	YES	1				
20	return_window_days	int	YES	30				
21	start_time	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
22	end_time	timestamp	NO	NULL		MUL		
23	auto_relist	tinyint(1)	YES	0				
24	relist_count	int	YES	0				
25	bid_count	int	YES	0				
26	unique_bidders	int	YES	0				
27	watch_count	int	YES	0				
28	view_count	bigint	YES	0				
29	question_count	int	YES	0				
30	status	enum('scheduled','active','ended','sold','unsold','cancelled')	YES	active		MUL	utf8mb4_unicode_ci	
31	winner_id	int	YES	NULL		MUL		
32	final_price	decimal(12,2)	YES	NULL				
33	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_current_bid	NON_UNIQUE	BTREE	current_bid	0
idx_end_time	NON_UNIQUE	BTREE	end_time	0
idx_search	NON_UNIQUE	FULLTEXT	title, description	0
idx_seller	NON_UNIQUE	BTREE	seller_id	0
idx_status	NON_UNIQUE	BTREE	status	0
winner_id	NON_UNIQUE	BTREE	winner_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
auction_listings_ibfk_1	seller_id	users	id	NO ACTION	NO ACTION
auction_listings_ibfk_2	winner_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `auction_listings` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `seller_id` int NOT NULL,
  `product_id` bigint DEFAULT NULL,
  `listing_type` enum('auction','buy_now','both') COLLATE utf8mb4_unicode_ci DEFAULT 'auction',
  `title` varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `condition_type` enum('new','refurbished','used_like_new','used_good','used_acceptable','for_parts') COLLATE utf8mb4_unicode_ci NOT NULL,
  `category_path` json DEFAULT NULL,
  `images` json DEFAULT NULL,
  `starting_bid` decimal(12,2) NOT NULL,
  `current_bid` decimal(12,2) DEFAULT NULL,
  `buy_now_price` decimal(12,2) DEFAULT NULL,
  `reserve_price` decimal(12,2) DEFAULT NULL,
  `reserve_met` tinyint(1) DEFAULT '0',
  `bid_increment` decimal(10,2) DEFAULT '1.00',
  `quantity` int DEFAULT '1',
  `shipping_options` json DEFAULT NULL,
  `international_shipping` tinyint(1) DEFAULT '0',
  `returns_accepted` tinyint(1) DEFAULT '1',
  `return_window_days` int DEFAULT '30',
  `start_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `end_time` timestamp NOT NULL,
  `auto_relist` tinyint(1) DEFAULT '0',
  `relist_count` int DEFAULT '0',
  `bid_count` int DEFAULT '0',
  `unique_bidders` int DEFAULT '0',
  `watch_count` int DEFAULT '0',
  `view_count` bigint DEFAULT '0',
  `question_count` int DEFAULT '0',
  `status` enum('scheduled','active','ended','sold','unsold','cancelled') COLLATE utf8mb4_unicode_ci DEFAULT 'active',
  `winner_id` int DEFAULT NULL,
  `final_price` decimal(12,2) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_seller` (`seller_id`),
  KEY `idx_status` (`status`),
  KEY `idx_end_time` (`end_time`),
  KEY `idx_current_bid` (`current_bid`),
  KEY `winner_id` (`winner_id`),
  FULLTEXT KEY `idx_search` (`title`,`description`),
  CONSTRAINT `auction_listings_ibfk_1` FOREIGN KEY (`seller_id`) REFERENCES `users` (`id`),
  CONSTRAINT `auction_listings_ibfk_2` FOREIGN KEY (`winner_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: auction_sniping
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:52:02 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	auction_id	bigint	NO	NULL		UNI		
3	extension_count	int	YES	0				
4	original_end_time	timestamp	NO	NULL				
5	current_end_time	timestamp	NO	NULL		MUL		
6	last_bid_time	timestamp	YES	NULL				
7	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_end_time	NON_UNIQUE	BTREE	current_end_time	0
unique_auction	UNIQUE	BTREE	auction_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
auction_sniping_ibfk_1	auction_id	auction_listings	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `auction_sniping` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `auction_id` bigint NOT NULL,
  `extension_count` int DEFAULT '0',
  `original_end_time` timestamp NOT NULL,
  `current_end_time` timestamp NOT NULL,
  `last_bid_time` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_auction` (`auction_id`),
  KEY `idx_end_time` (`current_end_time`),
  CONSTRAINT `auction_sniping_ibfk_1` FOREIGN KEY (`auction_id`) REFERENCES `auction_listings` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: audit_log
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 03:06:45 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	user_id	int	YES	NULL		MUL		
3	action	varchar(100)	NO	NULL		MUL	utf8mb4_unicode_ci	
4	module	varchar(50)	NO	NULL		MUL	utf8mb4_unicode_ci	
5	table_name	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
6	record_id	int	YES	NULL				
7	old_values	json	YES	NULL				
8	new_values	json	YES	NULL				
9	ip_address	varchar(45)	YES	NULL			utf8mb4_unicode_ci	
10	user_agent	text	YES	NULL			utf8mb4_unicode_ci	
11	risk_score	decimal(5,2)	YES	NULL				
12	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED	MUL		

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_action	NON_UNIQUE	BTREE	action	0
idx_created	NON_UNIQUE	BTREE	created_at	0
idx_module	NON_UNIQUE	BTREE	module	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `audit_log` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `user_id` int DEFAULT NULL,
  `action` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `module` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `table_name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `record_id` int DEFAULT NULL,
  `old_values` json DEFAULT NULL,
  `new_values` json DEFAULT NULL,
  `ip_address` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_agent` text COLLATE utf8mb4_unicode_ci,
  `risk_score` decimal(5,2) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_action` (`action`),
  KEY `idx_module` (`module`),
  KEY `idx_created` (`created_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: automod_rules
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:28:29 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	community_id	int	NO	NULL		MUL		
3	rule_name	varchar(100)	NO	NULL			utf8mb4_unicode_ci	
4	rule_type	varchar(50)	NO	NULL			utf8mb4_unicode_ci	
5	conditions	json	NO	NULL				
6	actions	json	NO	NULL				
7	is_active	tinyint(1)	YES	1		MUL		
8	priority	int	YES	0				
9	created_by	int	NO	NULL		MUL		
10	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
created_by	NON_UNIQUE	BTREE	created_by	0
idx_active	NON_UNIQUE	BTREE	is_active	0
idx_community	NON_UNIQUE	BTREE	community_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
automod_rules_ibfk_1	community_id	communities	id	NO ACTION	NO ACTION
automod_rules_ibfk_2	created_by	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `automod_rules` (
  `id` int NOT NULL AUTO_INCREMENT,
  `community_id` int NOT NULL,
  `rule_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `rule_type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `conditions` json NOT NULL,
  `actions` json NOT NULL,
  `is_active` tinyint(1) DEFAULT '1',
  `priority` int DEFAULT '0',
  `created_by` int NOT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_community` (`community_id`),
  KEY `idx_active` (`is_active`),
  KEY `created_by` (`created_by`),
  CONSTRAINT `automod_rules_ibfk_1` FOREIGN KEY (`community_id`) REFERENCES `communities` (`id`),
  CONSTRAINT `automod_rules_ibfk_2` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: awarded_content
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:28:29 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	award_id	int	NO	NULL		MUL		
3	giver_id	int	NO	NULL		MUL		
4	content_type	enum('post','comment')	NO	NULL		MUL	utf8mb4_unicode_ci	
5	content_id	bigint	NO	NULL				
6	message	text	YES	NULL			utf8mb4_unicode_ci	
7	is_anonymous	tinyint(1)	YES	0				
8	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
award_id	NON_UNIQUE	BTREE	award_id	0
idx_content	NON_UNIQUE	BTREE	content_type, content_id	0
idx_giver	NON_UNIQUE	BTREE	giver_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
awarded_content_ibfk_1	award_id	awards	id	NO ACTION	NO ACTION
awarded_content_ibfk_2	giver_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `awarded_content` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `award_id` int NOT NULL,
  `giver_id` int NOT NULL,
  `content_type` enum('post','comment') COLLATE utf8mb4_unicode_ci NOT NULL,
  `content_id` bigint NOT NULL,
  `message` text COLLATE utf8mb4_unicode_ci,
  `is_anonymous` tinyint(1) DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_content` (`content_type`,`content_id`),
  KEY `idx_giver` (`giver_id`),
  KEY `award_id` (`award_id`),
  CONSTRAINT `awarded_content_ibfk_1` FOREIGN KEY (`award_id`) REFERENCES `awards` (`id`),
  CONSTRAINT `awarded_content_ibfk_2` FOREIGN KEY (`giver_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: awards
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.00 | TOTAL_MB: 0.02 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:28:29 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	award_name	varchar(100)	NO	NULL			utf8mb4_unicode_ci	
3	award_icon	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
4	award_description	text	YES	NULL			utf8mb4_unicode_ci	
5	coin_cost	int	NO	NULL				
6	gives_premium_days	int	YES	0				
7	gives_coins	int	YES	0				
8	is_available	tinyint(1)	YES	1				
9	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `awards` (
  `id` int NOT NULL AUTO_INCREMENT,
  `award_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `award_icon` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `award_description` text COLLATE utf8mb4_unicode_ci,
  `coin_cost` int NOT NULL,
  `gives_premium_days` int DEFAULT '0',
  `gives_coins` int DEFAULT '0',
  `is_available` tinyint(1) DEFAULT '1',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: backup_history
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.02 | TOTAL_MB: 0.03 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-07 01:09:42 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	backup_type	enum('manual','automatic','cloud')	YES	manual			utf8mb4_unicode_ci	
4	file_name	varchar(255)	YES	NULL			utf8mb4_unicode_ci	
5	file_size	bigint	YES	NULL				
6	storage_location	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
7	status	enum('pending','completed','failed')	YES	pending			utf8mb4_unicode_ci	
8	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
backup_history_ibfk_1	user_id	users	id	NO ACTION	CASCADE

--- SHOW CREATE TABLE ---
CREATE TABLE `backup_history` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `backup_type` enum('manual','automatic','cloud') COLLATE utf8mb4_unicode_ci DEFAULT 'manual',
  `file_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `file_size` bigint DEFAULT NULL,
  `storage_location` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` enum('pending','completed','failed') COLLATE utf8mb4_unicode_ci DEFAULT 'pending',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  CONSTRAINT `backup_history_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: barter_trades
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:52:18 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	trader_id	int	NO	NULL		MUL		
3	offering_title	varchar(300)	NO	NULL			utf8mb4_unicode_ci	
4	offering_description	text	YES	NULL			utf8mb4_unicode_ci	
5	offering_value	decimal(10,2)	YES	NULL				
6	offering_images	json	YES	NULL				
7	wanted_items	text	YES	NULL			utf8mb4_unicode_ci	
8	wanted_categories	json	YES	NULL				
9	trade_location	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
10	shipping_available	tinyint(1)	YES	0				
11	view_count	int	YES	0				
12	offer_count	int	YES	0				
13	status	enum('active','pending','completed','removed')	YES	active		MUL	utf8mb4_unicode_ci	
14	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_status	NON_UNIQUE	BTREE	status	0
idx_trader	NON_UNIQUE	BTREE	trader_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
barter_trades_ibfk_1	trader_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `barter_trades` (
  `id` int NOT NULL AUTO_INCREMENT,
  `trader_id` int NOT NULL,
  `offering_title` varchar(300) COLLATE utf8mb4_unicode_ci NOT NULL,
  `offering_description` text COLLATE utf8mb4_unicode_ci,
  `offering_value` decimal(10,2) DEFAULT NULL,
  `offering_images` json DEFAULT NULL,
  `wanted_items` text COLLATE utf8mb4_unicode_ci,
  `wanted_categories` json DEFAULT NULL,
  `trade_location` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `shipping_available` tinyint(1) DEFAULT '0',
  `view_count` int DEFAULT '0',
  `offer_count` int DEFAULT '0',
  `status` enum('active','pending','completed','removed') COLLATE utf8mb4_unicode_ci DEFAULT 'active',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_trader` (`trader_id`),
  KEY `idx_status` (`status`),
  CONSTRAINT `barter_trades_ibfk_1` FOREIGN KEY (`trader_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: bid_watchers
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:52:02 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	auction_id	bigint	NO	NULL		MUL		
3	user_id	int	NO	NULL		MUL		
4	max_bid_alert	decimal(12,2)	YES	NULL				
5	ending_soon_alert	tinyint(1)	YES	1				
6	outbid_alert	tinyint(1)	YES	1				
7	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_auction	NON_UNIQUE	BTREE	auction_id	0
idx_user	NON_UNIQUE	BTREE	user_id	0
unique_watcher	UNIQUE	BTREE	auction_id, user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
bid_watchers_ibfk_1	auction_id	auction_listings	id	NO ACTION	NO ACTION
bid_watchers_ibfk_2	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `bid_watchers` (
  `id` int NOT NULL AUTO_INCREMENT,
  `auction_id` bigint NOT NULL,
  `user_id` int NOT NULL,
  `max_bid_alert` decimal(12,2) DEFAULT NULL,
  `ending_soon_alert` tinyint(1) DEFAULT '1',
  `outbid_alert` tinyint(1) DEFAULT '1',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_watcher` (`auction_id`,`user_id`),
  KEY `idx_auction` (`auction_id`),
  KEY `idx_user` (`user_id`),
  CONSTRAINT `bid_watchers_ibfk_1` FOREIGN KEY (`auction_id`) REFERENCES `auction_listings` (`id`),
  CONSTRAINT `bid_watchers_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: bitmoji_avatars
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:28:58 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		UNI		
3	avatar_id	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
4	avatar_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
5	outfit_id	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
6	accessories	json	YES	NULL				
7	expressions	json	YES	NULL				
8	poses	json	YES	NULL				
9	backgrounds	json	YES	NULL				
10	is_3d	tinyint(1)	YES	0				
11	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
12	updated_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_user	NON_UNIQUE	BTREE	user_id	0
user_id	UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
bitmoji_avatars_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `bitmoji_avatars` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `avatar_id` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `avatar_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `outfit_id` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `accessories` json DEFAULT NULL,
  `expressions` json DEFAULT NULL,
  `poses` json DEFAULT NULL,
  `backgrounds` json DEFAULT NULL,
  `is_3d` tinyint(1) DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_id` (`user_id`),
  KEY `idx_user` (`user_id`),
  CONSTRAINT `bitmoji_avatars_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: blog_followers
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:28:08 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	blog_id	int	NO	NULL		MUL		
3	follower_id	int	NO	NULL		MUL		
4	is_mutual	tinyint(1)	YES	0				
5	notifications_enabled	tinyint(1)	YES	1				
6	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_blog	NON_UNIQUE	BTREE	blog_id	0
idx_follower	NON_UNIQUE	BTREE	follower_id	0
unique_follow	UNIQUE	BTREE	blog_id, follower_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
blog_followers_ibfk_1	blog_id	blogs	id	NO ACTION	NO ACTION
blog_followers_ibfk_2	follower_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `blog_followers` (
  `id` int NOT NULL AUTO_INCREMENT,
  `blog_id` int NOT NULL,
  `follower_id` int NOT NULL,
  `is_mutual` tinyint(1) DEFAULT '0',
  `notifications_enabled` tinyint(1) DEFAULT '1',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_follow` (`blog_id`,`follower_id`),
  KEY `idx_blog` (`blog_id`),
  KEY `idx_follower` (`follower_id`),
  CONSTRAINT `blog_followers_ibfk_1` FOREIGN KEY (`blog_id`) REFERENCES `blogs` (`id`),
  CONSTRAINT `blog_followers_ibfk_2` FOREIGN KEY (`follower_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: blog_posts
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:28:08 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	blog_id	int	NO	NULL		MUL		
3	post_type	enum('text','photo','quote','link','chat','audio','video','answer')	NO	NULL			utf8mb4_unicode_ci	
4	title	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
5	content	text	YES	NULL			utf8mb4_unicode_ci	
6	media_urls	json	YES	NULL				
7	embed_code	text	YES	NULL			utf8mb4_unicode_ci	
8	source_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
9	tags	json	YES	NULL				
10	custom_url	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
11	state	enum('published','draft','queue','private')	YES	published		MUL	utf8mb4_unicode_ci	
12	scheduled_publish	timestamp	YES	NULL				
13	reblogged_from_id	bigint	YES	NULL				
14	original_post_id	bigint	YES	NULL				
15	reblog_tree	json	YES	NULL				
16	note_count	int	YES	0		MUL		
17	like_count	int	YES	0				
18	reblog_count	int	YES	0				
19	is_pinned	tinyint(1)	YES	0				
20	can_reblog	tinyint(1)	YES	1				
21	can_reply	tinyint(1)	YES	1				
22	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED	MUL		

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_blog	NON_UNIQUE	BTREE	blog_id	0
idx_created	NON_UNIQUE	BTREE	created_at	0
idx_notes	NON_UNIQUE	BTREE	note_count	0
idx_state	NON_UNIQUE	BTREE	state	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
blog_posts_ibfk_1	blog_id	blogs	id	NO ACTION	CASCADE

--- SHOW CREATE TABLE ---
CREATE TABLE `blog_posts` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `blog_id` int NOT NULL,
  `post_type` enum('text','photo','quote','link','chat','audio','video','answer') COLLATE utf8mb4_unicode_ci NOT NULL,
  `title` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `content` text COLLATE utf8mb4_unicode_ci,
  `media_urls` json DEFAULT NULL,
  `embed_code` text COLLATE utf8mb4_unicode_ci,
  `source_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tags` json DEFAULT NULL,
  `custom_url` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `state` enum('published','draft','queue','private') COLLATE utf8mb4_unicode_ci DEFAULT 'published',
  `scheduled_publish` timestamp NULL DEFAULT NULL,
  `reblogged_from_id` bigint DEFAULT NULL,
  `original_post_id` bigint DEFAULT NULL,
  `reblog_tree` json DEFAULT NULL,
  `note_count` int DEFAULT '0',
  `like_count` int DEFAULT '0',
  `reblog_count` int DEFAULT '0',
  `is_pinned` tinyint(1) DEFAULT '0',
  `can_reblog` tinyint(1) DEFAULT '1',
  `can_reply` tinyint(1) DEFAULT '1',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_blog` (`blog_id`),
  KEY `idx_state` (`state`),
  KEY `idx_created` (`created_at`),
  KEY `idx_notes` (`note_count`),
  CONSTRAINT `blog_posts_ibfk_1` FOREIGN KEY (`blog_id`) REFERENCES `blogs` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: blog_queue
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:28:08 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	blog_id	int	NO	NULL		MUL		
3	post_id	bigint	NO	NULL		MUL		
4	scheduled_time	timestamp	NO	NULL		MUL		
5	queue_position	int	NO	NULL				
6	is_recurring	tinyint(1)	YES	0				
7	recurrence_pattern	json	YES	NULL				
8	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_blog	NON_UNIQUE	BTREE	blog_id	0
idx_scheduled	NON_UNIQUE	BTREE	scheduled_time	0
post_id	NON_UNIQUE	BTREE	post_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
blog_queue_ibfk_1	blog_id	blogs	id	NO ACTION	NO ACTION
blog_queue_ibfk_2	post_id	blog_posts	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `blog_queue` (
  `id` int NOT NULL AUTO_INCREMENT,
  `blog_id` int NOT NULL,
  `post_id` bigint NOT NULL,
  `scheduled_time` timestamp NOT NULL,
  `queue_position` int NOT NULL,
  `is_recurring` tinyint(1) DEFAULT '0',
  `recurrence_pattern` json DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_blog` (`blog_id`),
  KEY `idx_scheduled` (`scheduled_time`),
  KEY `post_id` (`post_id`),
  CONSTRAINT `blog_queue_ibfk_1` FOREIGN KEY (`blog_id`) REFERENCES `blogs` (`id`),
  CONSTRAINT `blog_queue_ibfk_2` FOREIGN KEY (`post_id`) REFERENCES `blog_posts` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: blog_submissions
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:28:08 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	blog_id	int	NO	NULL		MUL		
3	submitter_id	int	NO	NULL		MUL		
4	submission_type	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
5	content	text	YES	NULL			utf8mb4_unicode_ci	
6	media_urls	json	YES	NULL				
7	tags	json	YES	NULL				
8	status	enum('pending','approved','rejected','published')	YES	pending		MUL	utf8mb4_unicode_ci	
9	reviewer_notes	text	YES	NULL			utf8mb4_unicode_ci	
10	published_post_id	bigint	YES	NULL				
11	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
12	reviewed_at	timestamp	YES	NULL				

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_blog	NON_UNIQUE	BTREE	blog_id	0
idx_status	NON_UNIQUE	BTREE	status	0
idx_submitter	NON_UNIQUE	BTREE	submitter_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
blog_submissions_ibfk_1	blog_id	blogs	id	NO ACTION	NO ACTION
blog_submissions_ibfk_2	submitter_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `blog_submissions` (
  `id` int NOT NULL AUTO_INCREMENT,
  `blog_id` int NOT NULL,
  `submitter_id` int NOT NULL,
  `submission_type` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `content` text COLLATE utf8mb4_unicode_ci,
  `media_urls` json DEFAULT NULL,
  `tags` json DEFAULT NULL,
  `status` enum('pending','approved','rejected','published') COLLATE utf8mb4_unicode_ci DEFAULT 'pending',
  `reviewer_notes` text COLLATE utf8mb4_unicode_ci,
  `published_post_id` bigint DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `reviewed_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_blog` (`blog_id`),
  KEY `idx_submitter` (`submitter_id`),
  KEY `idx_status` (`status`),
  CONSTRAINT `blog_submissions_ibfk_1` FOREIGN KEY (`blog_id`) REFERENCES `blogs` (`id`),
  CONSTRAINT `blog_submissions_ibfk_2` FOREIGN KEY (`submitter_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: blog_themes
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:28:08 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	creator_id	int	YES	NULL		MUL		
3	theme_name	varchar(100)	NO	NULL			utf8mb4_unicode_ci	
4	theme_description	text	YES	NULL			utf8mb4_unicode_ci	
5	preview_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
6	html_template	text	YES	NULL			utf8mb4_unicode_ci	
7	css_code	text	YES	NULL			utf8mb4_unicode_ci	
8	javascript_code	text	YES	NULL			utf8mb4_unicode_ci	
9	customizable_options	json	YES	NULL				
10	price	decimal(10,2)	YES	0.00				
11	downloads	int	YES	0		MUL		
12	rating	decimal(3,2)	YES	0.00				
13	is_official	tinyint(1)	YES	0				
14	is_featured	tinyint(1)	YES	0				
15	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_creator	NON_UNIQUE	BTREE	creator_id	0
idx_downloads	NON_UNIQUE	BTREE	downloads	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
blog_themes_ibfk_1	creator_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `blog_themes` (
  `id` int NOT NULL AUTO_INCREMENT,
  `creator_id` int DEFAULT NULL,
  `theme_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `theme_description` text COLLATE utf8mb4_unicode_ci,
  `preview_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `html_template` text COLLATE utf8mb4_unicode_ci,
  `css_code` text COLLATE utf8mb4_unicode_ci,
  `javascript_code` text COLLATE utf8mb4_unicode_ci,
  `customizable_options` json DEFAULT NULL,
  `price` decimal(10,2) DEFAULT '0.00',
  `downloads` int DEFAULT '0',
  `rating` decimal(3,2) DEFAULT '0.00',
  `is_official` tinyint(1) DEFAULT '0',
  `is_featured` tinyint(1) DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_creator` (`creator_id`),
  KEY `idx_downloads` (`downloads`),
  CONSTRAINT `blog_themes_ibfk_1` FOREIGN KEY (`creator_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: blogs
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:28:08 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	blog_url	varchar(100)	NO	NULL		UNI	utf8mb4_unicode_ci	
4	blog_title	varchar(200)	NO	NULL			utf8mb4_unicode_ci	
5	blog_description	text	YES	NULL			utf8mb4_unicode_ci	
6	theme_id	int	YES	NULL				
7	custom_css	text	YES	NULL			utf8mb4_unicode_ci	
8	custom_html	text	YES	NULL			utf8mb4_unicode_ci	
9	header_image	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
10	avatar_image	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
11	background_image	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
12	color_scheme	json	YES	NULL				
13	font_settings	json	YES	NULL				
14	layout_type	varchar(50)	YES	standard			utf8mb4_unicode_ci	
15	is_nsfw	tinyint(1)	YES	0				
16	is_private	tinyint(1)	YES	0				
17	password_hash	varchar(255)	YES	NULL			utf8mb4_unicode_ci	
18	follower_count	int	YES	0		MUL		
19	post_count	int	YES	0				
20	total_notes	bigint	YES	0				
21	asks_enabled	tinyint(1)	YES	1				
22	anonymous_asks	tinyint(1)	YES	1				
23	submissions_enabled	tinyint(1)	YES	0				
24	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
blog_url	UNIQUE	BTREE	blog_url	0
idx_followers	NON_UNIQUE	BTREE	follower_count	0
idx_url	NON_UNIQUE	BTREE	blog_url	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
blogs_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `blogs` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `blog_url` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `blog_title` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `blog_description` text COLLATE utf8mb4_unicode_ci,
  `theme_id` int DEFAULT NULL,
  `custom_css` text COLLATE utf8mb4_unicode_ci,
  `custom_html` text COLLATE utf8mb4_unicode_ci,
  `header_image` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `avatar_image` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `background_image` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `color_scheme` json DEFAULT NULL,
  `font_settings` json DEFAULT NULL,
  `layout_type` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT 'standard',
  `is_nsfw` tinyint(1) DEFAULT '0',
  `is_private` tinyint(1) DEFAULT '0',
  `password_hash` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `follower_count` int DEFAULT '0',
  `post_count` int DEFAULT '0',
  `total_notes` bigint DEFAULT '0',
  `asks_enabled` tinyint(1) DEFAULT '1',
  `anonymous_asks` tinyint(1) DEFAULT '1',
  `submissions_enabled` tinyint(1) DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `blog_url` (`blog_url`),
  KEY `idx_user` (`user_id`),
  KEY `idx_url` (`blog_url`),
  KEY `idx_followers` (`follower_count`),
  CONSTRAINT `blogs_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: boards
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:30:33 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	board_name	varchar(200)	NO	NULL			utf8mb4_unicode_ci	
4	board_description	text	YES	NULL			utf8mb4_unicode_ci	
5	cover_image	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
6	category	varchar(100)	YES	NULL		MUL	utf8mb4_unicode_ci	
7	is_secret	tinyint(1)	YES	0				
8	is_archived	tinyint(1)	YES	0				
9	collaborators	json	YES	NULL				
10	pin_count	int	YES	0				
11	follower_count	int	YES	0				
12	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
13	updated_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_category	NON_UNIQUE	BTREE	category	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
boards_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `boards` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `board_name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `board_description` text COLLATE utf8mb4_unicode_ci,
  `cover_image` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `category` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_secret` tinyint(1) DEFAULT '0',
  `is_archived` tinyint(1) DEFAULT '0',
  `collaborators` json DEFAULT NULL,
  `pin_count` int DEFAULT '0',
  `follower_count` int DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_category` (`category`),
  CONSTRAINT `boards_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: bonus_campaigns
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:59:52 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	campaign_code	varchar(50)	NO	NULL		UNI	utf8mb4_unicode_ci	
3	name	varchar(200)	NO	NULL			utf8mb4_unicode_ci	
4	description	text	YES	NULL			utf8mb4_unicode_ci	
5	bonus_type	enum('deposit','no_deposit','free_spins','cashback','reload','vip','referral','birthday')	NO	NULL		MUL	utf8mb4_unicode_ci	
6	bonus_amount	decimal(20,2)	YES	NULL				
7	bonus_percentage	int	YES	NULL				
8	max_bonus	decimal(20,2)	YES	NULL				
9	free_spins_count	int	YES	NULL				
10	wagering_requirement	int	YES	1				
11	eligible_games	json	YES	NULL				
12	min_deposit	decimal(10,2)	YES	NULL				
13	max_bet_allowed	decimal(10,2)	YES	NULL				
14	expiry_days	int	YES	30				
15	max_redemptions	int	YES	NULL				
16	redemptions_count	int	YES	0				
17	user_conditions	json	YES	NULL				
18	valid_from	timestamp	YES	NULL				
19	valid_until	timestamp	YES	NULL				
20	is_active	tinyint(1)	YES	1		MUL		
21	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
campaign_code	UNIQUE	BTREE	campaign_code	0
idx_active	NON_UNIQUE	BTREE	is_active	0
idx_code	NON_UNIQUE	BTREE	campaign_code	0
idx_type	NON_UNIQUE	BTREE	bonus_type	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `bonus_campaigns` (
  `id` int NOT NULL AUTO_INCREMENT,
  `campaign_code` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `bonus_type` enum('deposit','no_deposit','free_spins','cashback','reload','vip','referral','birthday') COLLATE utf8mb4_unicode_ci NOT NULL,
  `bonus_amount` decimal(20,2) DEFAULT NULL,
  `bonus_percentage` int DEFAULT NULL,
  `max_bonus` decimal(20,2) DEFAULT NULL,
  `free_spins_count` int DEFAULT NULL,
  `wagering_requirement` int DEFAULT '1',
  `eligible_games` json DEFAULT NULL,
  `min_deposit` decimal(10,2) DEFAULT NULL,
  `max_bet_allowed` decimal(10,2) DEFAULT NULL,
  `expiry_days` int DEFAULT '30',
  `max_redemptions` int DEFAULT NULL,
  `redemptions_count` int DEFAULT '0',
  `user_conditions` json DEFAULT NULL,
  `valid_from` timestamp NULL DEFAULT NULL,
  `valid_until` timestamp NULL DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT '1',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `campaign_code` (`campaign_code`),
  KEY `idx_type` (`bonus_type`),
  KEY `idx_code` (`campaign_code`),
  KEY `idx_active` (`is_active`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: bookmark_folders
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:27:53 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	folder_name	varchar(100)	NO	NULL			utf8mb4_unicode_ci	
4	folder_icon	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
5	parent_folder_id	int	YES	NULL		MUL		
6	is_private	tinyint(1)	YES	1				
7	item_count	int	YES	0				
8	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_parent	NON_UNIQUE	BTREE	parent_folder_id	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
bookmark_folders_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `bookmark_folders` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `folder_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `folder_icon` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `parent_folder_id` int DEFAULT NULL,
  `is_private` tinyint(1) DEFAULT '1',
  `item_count` int DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_parent` (`parent_folder_id`),
  CONSTRAINT `bookmark_folders_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: bookmarks
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:27:53 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	content_type	varchar(50)	NO	NULL		MUL	utf8mb4_unicode_ci	
4	content_id	bigint	NO	NULL				
5	folder_id	int	YES	NULL		MUL		
6	notes	text	YES	NULL			utf8mb4_unicode_ci	
7	tags	json	YES	NULL				
8	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_content	NON_UNIQUE	BTREE	content_type, content_id	0
idx_folder	NON_UNIQUE	BTREE	folder_id	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
bookmarks_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `bookmarks` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `content_type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `content_id` bigint NOT NULL,
  `folder_id` int DEFAULT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `tags` json DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_content` (`content_type`,`content_id`),
  KEY `idx_folder` (`folder_id`),
  CONSTRAINT `bookmarks_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: bulk_listings
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.02 | TOTAL_MB: 0.03 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:52:02 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	seller_id	int	NO	NULL		MUL		
3	template_name	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
4	template_data	json	YES	NULL				
5	category_defaults	json	YES	NULL				
6	shipping_defaults	json	YES	NULL				
7	return_policy_defaults	json	YES	NULL				
8	pricing_rules	json	YES	NULL				
9	auto_relist_settings	json	YES	NULL				
10	is_active	tinyint(1)	YES	1				
11	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_seller	NON_UNIQUE	BTREE	seller_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
bulk_listings_ibfk_1	seller_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `bulk_listings` (
  `id` int NOT NULL AUTO_INCREMENT,
  `seller_id` int NOT NULL,
  `template_name` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `template_data` json DEFAULT NULL,
  `category_defaults` json DEFAULT NULL,
  `shipping_defaults` json DEFAULT NULL,
  `return_policy_defaults` json DEFAULT NULL,
  `pricing_rules` json DEFAULT NULL,
  `auto_relist_settings` json DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT '1',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_seller` (`seller_id`),
  CONSTRAINT `bulk_listings_ibfk_1` FOREIGN KEY (`seller_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: business_metrics
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:53:58 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	metric_date	date	NO	NULL		MUL		
3	metric_type	varchar(100)	NO	NULL		MUL	utf8mb4_unicode_ci	
4	platform	varchar(100)	YES	NULL		MUL	utf8mb4_unicode_ci	
5	metric_value	decimal(20,4)	NO	NULL				
6	previous_value	decimal(20,4)	YES	NULL				
7	change_percentage	decimal(10,4)	YES	NULL				
8	year_over_year	decimal(10,4)	YES	NULL				
9	month_over_month	decimal(10,4)	YES	NULL				
10	dimensions	json	YES	NULL				
11	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_date	NON_UNIQUE	BTREE	metric_date	0
idx_platform	NON_UNIQUE	BTREE	platform	0
idx_type	NON_UNIQUE	BTREE	metric_type	0
unique_metric	UNIQUE	BTREE	metric_date, metric_type, platform	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `business_metrics` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `metric_date` date NOT NULL,
  `metric_type` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `platform` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `metric_value` decimal(20,4) NOT NULL,
  `previous_value` decimal(20,4) DEFAULT NULL,
  `change_percentage` decimal(10,4) DEFAULT NULL,
  `year_over_year` decimal(10,4) DEFAULT NULL,
  `month_over_month` decimal(10,4) DEFAULT NULL,
  `dimensions` json DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_metric` (`metric_date`,`metric_type`,`platform`),
  KEY `idx_date` (`metric_date`),
  KEY `idx_type` (`metric_type`),
  KEY `idx_platform` (`platform`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: carpooling
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:13:35 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	driver_id	int	NO	NULL		MUL		
3	route_from	json	NO	NULL				
4	route_from_address	text	NO	NULL			utf8mb4_unicode_ci	
5	route_to	json	NO	NULL				
6	route_to_address	text	NO	NULL			utf8mb4_unicode_ci	
7	waypoints	json	YES	NULL				
8	departure_date	date	NO	NULL		MUL		
9	departure_time	time	NO	NULL				
10	arrival_time	time	YES	NULL				
11	available_seats	int	NO	NULL				
12	booked_seats	int	YES	0				
13	price_per_seat	decimal(10,2)	NO	NULL				
14	car_model	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
15	car_comfort_level	enum('basic','comfort','luxury')	YES	comfort			utf8mb4_unicode_ci	
16	luggage_space	enum('none','small','medium','large')	YES	medium			utf8mb4_unicode_ci	
17	rules	text	YES	NULL			utf8mb4_unicode_ci	
18	amenities	json	YES	NULL				
19	is_recurring	tinyint(1)	YES	0				
20	recurrence_pattern	json	YES	NULL				
21	status	enum('active','full','completed','cancelled')	YES	active		MUL	utf8mb4_unicode_ci	
22	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_departure	NON_UNIQUE	BTREE	departure_date	0
idx_driver	NON_UNIQUE	BTREE	driver_id	0
idx_status	NON_UNIQUE	BTREE	status	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
carpooling_ibfk_1	driver_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `carpooling` (
  `id` int NOT NULL AUTO_INCREMENT,
  `driver_id` int NOT NULL,
  `route_from` json NOT NULL,
  `route_from_address` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `route_to` json NOT NULL,
  `route_to_address` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `waypoints` json DEFAULT NULL,
  `departure_date` date NOT NULL,
  `departure_time` time NOT NULL,
  `arrival_time` time DEFAULT NULL,
  `available_seats` int NOT NULL,
  `booked_seats` int DEFAULT '0',
  `price_per_seat` decimal(10,2) NOT NULL,
  `car_model` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `car_comfort_level` enum('basic','comfort','luxury') COLLATE utf8mb4_unicode_ci DEFAULT 'comfort',
  `luggage_space` enum('none','small','medium','large') COLLATE utf8mb4_unicode_ci DEFAULT 'medium',
  `rules` text COLLATE utf8mb4_unicode_ci,
  `amenities` json DEFAULT NULL,
  `is_recurring` tinyint(1) DEFAULT '0',
  `recurrence_pattern` json DEFAULT NULL,
  `status` enum('active','full','completed','cancelled') COLLATE utf8mb4_unicode_ci DEFAULT 'active',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_driver` (`driver_id`),
  KEY `idx_departure` (`departure_date`),
  KEY `idx_status` (`status`),
  CONSTRAINT `carpooling_ibfk_1` FOREIGN KEY (`driver_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: casino_games
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.08 | TOTAL_MB: 0.09 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:57:02 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	game_code	varchar(50)	NO	NULL		UNI	utf8mb4_unicode_ci	
3	name	varchar(100)	NO	NULL			utf8mb4_unicode_ci	
4	description	text	YES	NULL			utf8mb4_unicode_ci	
5	category	enum('slots','poker','blackjack','roulette','baccarat','craps','bingo','lottery','crash','mines','dice','plinko','wheel','cards','arcade')	NO	NULL		MUL	utf8mb4_unicode_ci	
6	provider	varchar(100)	YES	NULL		MUL	utf8mb4_unicode_ci	
7	thumbnail_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
8	game_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
9	min_bet	decimal(10,2)	YES	0.10				
10	max_bet	decimal(10,2)	YES	10000.00				
11	max_win_multiplier	decimal(10,2)	YES	10000.00				
12	rtp_percentage	decimal(5,2)	YES	96.00				
13	volatility	enum('low','medium','high','very-high')	YES	medium			utf8mb4_unicode_ci	
14	features	json	YES	NULL				
15	paylines	int	YES	NULL				
16	reels	int	YES	NULL				
17	is_live	tinyint(1)	YES	0				
18	is_multiplayer	tinyint(1)	YES	0				
19	is_progressive	tinyint(1)	YES	0				
20	jackpot_contribution	decimal(5,2)	YES	0.00				
21	mobile_compatible	tinyint(1)	YES	1				
22	demo_available	tinyint(1)	YES	1				
23	popularity_score	int	YES	0		MUL		
24	is_featured	tinyint(1)	YES	0		MUL		
25	is_new	tinyint(1)	YES	0				
26	is_hot	tinyint(1)	YES	0				
27	tags	json	YES	NULL				
28	is_active	tinyint(1)	YES	1				
29	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
game_code	UNIQUE	BTREE	game_code	0
idx_category	NON_UNIQUE	BTREE	category	0
idx_featured	NON_UNIQUE	BTREE	is_featured	0
idx_popularity	NON_UNIQUE	BTREE	popularity_score	0
idx_provider	NON_UNIQUE	BTREE	provider	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `casino_games` (
  `id` int NOT NULL AUTO_INCREMENT,
  `game_code` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `category` enum('slots','poker','blackjack','roulette','baccarat','craps','bingo','lottery','crash','mines','dice','plinko','wheel','cards','arcade') COLLATE utf8mb4_unicode_ci NOT NULL,
  `provider` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `thumbnail_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `game_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `min_bet` decimal(10,2) DEFAULT '0.10',
  `max_bet` decimal(10,2) DEFAULT '10000.00',
  `max_win_multiplier` decimal(10,2) DEFAULT '10000.00',
  `rtp_percentage` decimal(5,2) DEFAULT '96.00',
  `volatility` enum('low','medium','high','very-high') COLLATE utf8mb4_unicode_ci DEFAULT 'medium',
  `features` json DEFAULT NULL,
  `paylines` int DEFAULT NULL,
  `reels` int DEFAULT NULL,
  `is_live` tinyint(1) DEFAULT '0',
  `is_multiplayer` tinyint(1) DEFAULT '0',
  `is_progressive` tinyint(1) DEFAULT '0',
  `jackpot_contribution` decimal(5,2) DEFAULT '0.00',
  `mobile_compatible` tinyint(1) DEFAULT '1',
  `demo_available` tinyint(1) DEFAULT '1',
  `popularity_score` int DEFAULT '0',
  `is_featured` tinyint(1) DEFAULT '0',
  `is_new` tinyint(1) DEFAULT '0',
  `is_hot` tinyint(1) DEFAULT '0',
  `tags` json DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT '1',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `game_code` (`game_code`),
  KEY `idx_category` (`category`),
  KEY `idx_provider` (`provider`),
  KEY `idx_featured` (`is_featured`),
  KEY `idx_popularity` (`popularity_score`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: channel_posts
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:46:34 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	channel_id	int	NO	NULL		MUL		
3	author_id	int	NO	NULL		MUL		
4	content	text	YES	NULL			utf8mb4_unicode_ci	
5	media_type	enum('none','image','video','audio','document','poll','location')	YES	NULL			utf8mb4_unicode_ci	
6	media_urls	json	YES	NULL				
7	thumbnail_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
8	views_count	int	YES	0				
9	forwards_count	int	YES	0				
10	reactions	json	YES	NULL				
11	comments_enabled	tinyint(1)	YES	1				
12	is_pinned	tinyint(1)	YES	0				
13	is_scheduled	tinyint(1)	YES	0				
14	scheduled_time	timestamp	YES	NULL				
15	edited_at	timestamp	YES	NULL				
16	deleted_at	timestamp	YES	NULL				
17	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED	MUL		

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_author	NON_UNIQUE	BTREE	author_id	0
idx_channel	NON_UNIQUE	BTREE	channel_id	0
idx_created	NON_UNIQUE	BTREE	created_at	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
channel_posts_ibfk_1	channel_id	channels	id	NO ACTION	CASCADE
channel_posts_ibfk_2	author_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `channel_posts` (
  `id` int NOT NULL AUTO_INCREMENT,
  `channel_id` int NOT NULL,
  `author_id` int NOT NULL,
  `content` text COLLATE utf8mb4_unicode_ci,
  `media_type` enum('none','image','video','audio','document','poll','location') COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `media_urls` json DEFAULT NULL,
  `thumbnail_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `views_count` int DEFAULT '0',
  `forwards_count` int DEFAULT '0',
  `reactions` json DEFAULT NULL,
  `comments_enabled` tinyint(1) DEFAULT '1',
  `is_pinned` tinyint(1) DEFAULT '0',
  `is_scheduled` tinyint(1) DEFAULT '0',
  `scheduled_time` timestamp NULL DEFAULT NULL,
  `edited_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_channel` (`channel_id`),
  KEY `idx_author` (`author_id`),
  KEY `idx_created` (`created_at`),
  CONSTRAINT `channel_posts_ibfk_1` FOREIGN KEY (`channel_id`) REFERENCES `channels` (`id`) ON DELETE CASCADE,
  CONSTRAINT `channel_posts_ibfk_2` FOREIGN KEY (`author_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: channels
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.08 | TOTAL_MB: 0.09 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:46:19 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	channel_username	varchar(50)	NO	NULL		UNI	utf8mb4_unicode_ci	
3	name	varchar(100)	NO	NULL			utf8mb4_unicode_ci	
4	description	text	YES	NULL			utf8mb4_unicode_ci	
5	avatar_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
6	cover_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
7	owner_id	int	NO	NULL		MUL		
8	admins	json	YES	NULL				
9	subscriber_count	int	YES	0				
10	post_count	int	YES	0				
11	is_verified	tinyint(1)	YES	0		MUL		
12	is_private	tinyint(1)	YES	0				
13	invite_link	varchar(100)	YES	NULL		UNI	utf8mb4_unicode_ci	
14	join_approval_required	tinyint(1)	YES	0				
15	can_members_post	tinyint(1)	YES	0				
16	linked_chat_group	int	YES	NULL				
17	is_nsfw	tinyint(1)	YES	0				
18	monetization_enabled	tinyint(1)	YES	0				
19	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
channel_username	UNIQUE	BTREE	channel_username	0
idx_owner	NON_UNIQUE	BTREE	owner_id	0
idx_username	NON_UNIQUE	BTREE	channel_username	0
idx_verified	NON_UNIQUE	BTREE	is_verified	0
invite_link	UNIQUE	BTREE	invite_link	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
channels_ibfk_1	owner_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `channels` (
  `id` int NOT NULL AUTO_INCREMENT,
  `channel_username` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `avatar_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cover_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `owner_id` int NOT NULL,
  `admins` json DEFAULT NULL,
  `subscriber_count` int DEFAULT '0',
  `post_count` int DEFAULT '0',
  `is_verified` tinyint(1) DEFAULT '0',
  `is_private` tinyint(1) DEFAULT '0',
  `invite_link` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `join_approval_required` tinyint(1) DEFAULT '0',
  `can_members_post` tinyint(1) DEFAULT '0',
  `linked_chat_group` int DEFAULT NULL,
  `is_nsfw` tinyint(1) DEFAULT '0',
  `monetization_enabled` tinyint(1) DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `channel_username` (`channel_username`),
  UNIQUE KEY `invite_link` (`invite_link`),
  KEY `idx_owner` (`owner_id`),
  KEY `idx_username` (`channel_username`),
  KEY `idx_verified` (`is_verified`),
  CONSTRAINT `channels_ibfk_1` FOREIGN KEY (`owner_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: chat_rooms
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:36:20 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	room_code	varchar(20)	NO	NULL		UNI	utf8mb4_unicode_ci	
3	name	varchar(100)	NO	NULL			utf8mb4_unicode_ci	
4	description	text	YES	NULL			utf8mb4_unicode_ci	
5	owner_id	int	NO	NULL		MUL		
6	category	varchar(50)	YES	general		MUL	utf8mb4_unicode_ci	
7	max_users	int	YES	50				
8	current_users	int	YES	0				
9	is_private	tinyint(1)	YES	0				
10	password_hash	varchar(255)	YES	NULL			utf8mb4_unicode_ci	
11	room_type	enum('text','video','audio','mixed')	YES	mixed			utf8mb4_unicode_ci	
12	thumbnail_url	varchar(255)	YES	NULL			utf8mb4_unicode_ci	
13	tags	json	YES	NULL				
14	min_level	int	YES	1				
15	min_age	int	YES	18				
16	language	varchar(10)	YES	en			utf8mb4_unicode_ci	
17	is_nsfw	tinyint(1)	YES	0				
18	is_featured	tinyint(1)	YES	0				
19	is_active	tinyint(1)	YES	1		MUL		
20	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
21	updated_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_active_featured	NON_UNIQUE	BTREE	is_active, is_featured	0
idx_category	NON_UNIQUE	BTREE	category	0
idx_owner	NON_UNIQUE	BTREE	owner_id	0
room_code	UNIQUE	BTREE	room_code	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
chat_rooms_ibfk_1	owner_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `chat_rooms` (
  `id` int NOT NULL AUTO_INCREMENT,
  `room_code` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `owner_id` int NOT NULL,
  `category` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT 'general',
  `max_users` int DEFAULT '50',
  `current_users` int DEFAULT '0',
  `is_private` tinyint(1) DEFAULT '0',
  `password_hash` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `room_type` enum('text','video','audio','mixed') COLLATE utf8mb4_unicode_ci DEFAULT 'mixed',
  `thumbnail_url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tags` json DEFAULT NULL,
  `min_level` int DEFAULT '1',
  `min_age` int DEFAULT '18',
  `language` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT 'en',
  `is_nsfw` tinyint(1) DEFAULT '0',
  `is_featured` tinyint(1) DEFAULT '0',
  `is_active` tinyint(1) DEFAULT '1',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `room_code` (`room_code`),
  KEY `idx_category` (`category`),
  KEY `idx_active_featured` (`is_active`,`is_featured`),
  KEY `idx_owner` (`owner_id`),
  CONSTRAINT `chat_rooms_ibfk_1` FOREIGN KEY (`owner_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: chat_sessions
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 66 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 68 | COLLATION: utf8mb4_0900_ai_ci | CREATE: 2025-08-02 17:22:28 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user1_id	int	YES	NULL		MUL		
3	user2_id	int	YES	NULL		MUL		
4	started_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
5	ended_at	timestamp	YES	NULL				
6	duration	int	YES	0				
7	rating_user1	int	YES	NULL				
8	rating_user2	int	YES	NULL				

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	66
idx_sessions_users	NON_UNIQUE	BTREE	user1_id, user2_id	3
user2_id	NON_UNIQUE	BTREE	user2_id	2

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
chat_sessions_ibfk_1	user1_id	users	id	NO ACTION	NO ACTION
chat_sessions_ibfk_2	user2_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `chat_sessions` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user1_id` int DEFAULT NULL,
  `user2_id` int DEFAULT NULL,
  `started_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `ended_at` timestamp NULL DEFAULT NULL,
  `duration` int DEFAULT '0',
  `rating_user1` int DEFAULT NULL,
  `rating_user2` int DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `user2_id` (`user2_id`),
  KEY `idx_sessions_users` (`user1_id`,`user2_id`),
  CONSTRAINT `chat_sessions_ibfk_1` FOREIGN KEY (`user1_id`) REFERENCES `users` (`id`),
  CONSTRAINT `chat_sessions_ibfk_2` FOREIGN KEY (`user2_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=68 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;


============================================================
TABLE: check_ins
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:39:42 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	place_name	varchar(200)	NO	NULL			utf8mb4_unicode_ci	
4	place_type	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
5	place_id	varchar(100)	YES	NULL		MUL	utf8mb4_unicode_ci	
6	coordinates	json	YES	NULL				
7	address	text	YES	NULL			utf8mb4_unicode_ci	
8	with_users	json	YES	NULL				
9	photo_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
10	content	text	YES	NULL			utf8mb4_unicode_ci	
11	privacy	enum('public','friends','only_me')	YES	friends			utf8mb4_unicode_ci	
12	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED	MUL		

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_created	NON_UNIQUE	BTREE	created_at	0
idx_place	NON_UNIQUE	BTREE	place_id	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
check_ins_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `check_ins` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `place_name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `place_type` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `place_id` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `coordinates` json DEFAULT NULL,
  `address` text COLLATE utf8mb4_unicode_ci,
  `with_users` json DEFAULT NULL,
  `photo_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `content` text COLLATE utf8mb4_unicode_ci,
  `privacy` enum('public','friends','only_me') COLLATE utf8mb4_unicode_ci DEFAULT 'friends',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_place` (`place_id`),
  KEY `idx_created` (`created_at`),
  CONSTRAINT `check_ins_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: chirp_threads
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:27:53 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	thread_title	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
4	first_chirp_id	bigint	NO	NULL		MUL		
5	chirp_ids	json	YES	NULL				
6	total_chirps	int	YES	1				
7	is_complete	tinyint(1)	YES	0				
8	view_count	bigint	YES	0				
9	share_count	int	YES	0				
10	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
11	completed_at	timestamp	YES	NULL				

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_first_chirp	NON_UNIQUE	BTREE	first_chirp_id	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
chirp_threads_ibfk_1	user_id	users	id	NO ACTION	NO ACTION
chirp_threads_ibfk_2	first_chirp_id	chirps	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `chirp_threads` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `thread_title` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `first_chirp_id` bigint NOT NULL,
  `chirp_ids` json DEFAULT NULL,
  `total_chirps` int DEFAULT '1',
  `is_complete` tinyint(1) DEFAULT '0',
  `view_count` bigint DEFAULT '0',
  `share_count` int DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `completed_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_first_chirp` (`first_chirp_id`),
  CONSTRAINT `chirp_threads_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
  CONSTRAINT `chirp_threads_ibfk_2` FOREIGN KEY (`first_chirp_id`) REFERENCES `chirps` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: chirps
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.09 | TOTAL_MB: 0.11 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:27:52 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	chirp_text	text	NO	NULL		MUL	utf8mb4_unicode_ci	
4	chirp_type	enum('original','reply','rechirp','quote')	YES	original			utf8mb4_unicode_ci	
5	parent_chirp_id	bigint	YES	NULL		MUL		
6	original_chirp_id	bigint	YES	NULL				
7	media_urls	json	YES	NULL				
8	media_types	json	YES	NULL				
9	poll_data	json	YES	NULL				
10	poll_end_time	timestamp	YES	NULL				
11	mentioned_users	json	YES	NULL				
12	hashtags	json	YES	NULL				
13	urls	json	YES	NULL				
14	geo_location	json	YES	NULL				
15	language	varchar(10)	YES	NULL			utf8mb4_unicode_ci	
16	is_sensitive	tinyint(1)	YES	0				
17	is_promoted	tinyint(1)	YES	0				
18	view_count	bigint	YES	0				
19	reply_count	int	YES	0				
20	rechirp_count	int	YES	0				
21	like_count	int	YES	0				
22	bookmark_count	int	YES	0				
23	quote_count	int	YES	0				
24	impression_count	bigint	YES	0				
25	engagement_rate	decimal(10,4)	YES	0.0000		MUL		
26	reply_settings	enum('everyone','following','mentioned','none')	YES	everyone			utf8mb4_unicode_ci	
27	is_edited	tinyint(1)	YES	0				
28	edited_at	timestamp	YES	NULL				
29	is_deleted	tinyint(1)	YES	0				
30	deleted_at	timestamp	YES	NULL				
31	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED	MUL		

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_chirp_text	NON_UNIQUE	FULLTEXT	chirp_text	0
idx_created	NON_UNIQUE	BTREE	created_at	0
idx_engagement	NON_UNIQUE	BTREE	engagement_rate	0
idx_parent	NON_UNIQUE	BTREE	parent_chirp_id	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
chirps_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `chirps` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `chirp_text` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `chirp_type` enum('original','reply','rechirp','quote') COLLATE utf8mb4_unicode_ci DEFAULT 'original',
  `parent_chirp_id` bigint DEFAULT NULL,
  `original_chirp_id` bigint DEFAULT NULL,
  `media_urls` json DEFAULT NULL,
  `media_types` json DEFAULT NULL,
  `poll_data` json DEFAULT NULL,
  `poll_end_time` timestamp NULL DEFAULT NULL,
  `mentioned_users` json DEFAULT NULL,
  `hashtags` json DEFAULT NULL,
  `urls` json DEFAULT NULL,
  `geo_location` json DEFAULT NULL,
  `language` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_sensitive` tinyint(1) DEFAULT '0',
  `is_promoted` tinyint(1) DEFAULT '0',
  `view_count` bigint DEFAULT '0',
  `reply_count` int DEFAULT '0',
  `rechirp_count` int DEFAULT '0',
  `like_count` int DEFAULT '0',
  `bookmark_count` int DEFAULT '0',
  `quote_count` int DEFAULT '0',
  `impression_count` bigint DEFAULT '0',
  `engagement_rate` decimal(10,4) DEFAULT '0.0000',
  `reply_settings` enum('everyone','following','mentioned','none') COLLATE utf8mb4_unicode_ci DEFAULT 'everyone',
  `is_edited` tinyint(1) DEFAULT '0',
  `edited_at` timestamp NULL DEFAULT NULL,
  `is_deleted` tinyint(1) DEFAULT '0',
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_parent` (`parent_chirp_id`),
  KEY `idx_created` (`created_at`),
  KEY `idx_engagement` (`engagement_rate`),
  FULLTEXT KEY `idx_chirp_text` (`chirp_text`),
  CONSTRAINT `chirps_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: classified_flags
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:52:18 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	content_type	varchar(50)	NO	NULL		MUL	utf8mb4_unicode_ci	
3	content_id	bigint	NO	NULL				
4	flagger_id	int	YES	NULL		MUL		
5	flag_reason	enum('spam','scam','prohibited','wrong_category','offensive','duplicate','expired','other')	NO	NULL			utf8mb4_unicode_ci	
6	description	text	YES	NULL			utf8mb4_unicode_ci	
7	status	enum('pending','reviewed','actioned','dismissed')	YES	pending		MUL	utf8mb4_unicode_ci	
8	action_taken	text	YES	NULL			utf8mb4_unicode_ci	
9	reviewed_by	int	YES	NULL		MUL		
10	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
11	reviewed_at	timestamp	YES	NULL				

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
flagger_id	NON_UNIQUE	BTREE	flagger_id	0
idx_content	NON_UNIQUE	BTREE	content_type, content_id	0
idx_status	NON_UNIQUE	BTREE	status	0
reviewed_by	NON_UNIQUE	BTREE	reviewed_by	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
classified_flags_ibfk_1	flagger_id	users	id	NO ACTION	NO ACTION
classified_flags_ibfk_2	reviewed_by	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `classified_flags` (
  `id` int NOT NULL AUTO_INCREMENT,
  `content_type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `content_id` bigint NOT NULL,
  `flagger_id` int DEFAULT NULL,
  `flag_reason` enum('spam','scam','prohibited','wrong_category','offensive','duplicate','expired','other') COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `status` enum('pending','reviewed','actioned','dismissed') COLLATE utf8mb4_unicode_ci DEFAULT 'pending',
  `action_taken` text COLLATE utf8mb4_unicode_ci,
  `reviewed_by` int DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `reviewed_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_content` (`content_type`,`content_id`),
  KEY `idx_status` (`status`),
  KEY `flagger_id` (`flagger_id`),
  KEY `reviewed_by` (`reviewed_by`),
  CONSTRAINT `classified_flags_ibfk_1` FOREIGN KEY (`flagger_id`) REFERENCES `users` (`id`),
  CONSTRAINT `classified_flags_ibfk_2` FOREIGN KEY (`reviewed_by`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: cloud_files
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.09 | TOTAL_MB: 0.11 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:29:18 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	parent_folder_id	bigint	YES	NULL		MUL		
4	file_name	varchar(255)	NO	NULL		MUL	utf8mb4_unicode_ci	
5	file_type	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
6	mime_type	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
7	file_size	bigint	NO	NULL				
8	file_hash	varchar(64)	YES	NULL		MUL	utf8mb4_unicode_ci	
9	storage_path	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
10	cdn_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
11	thumbnail_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
12	encryption_key	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
13	is_encrypted	tinyint(1)	YES	0				
14	is_compressed	tinyint(1)	YES	0				
15	compression_ratio	decimal(5,2)	YES	NULL				
16	metadata	json	YES	NULL				
17	tags	json	YES	NULL				
18	version	int	YES	1				
19	is_favorite	tinyint(1)	YES	0				
20	is_trashed	tinyint(1)	YES	0		MUL		
21	trashed_at	timestamp	YES	NULL				
22	is_shared	tinyint(1)	YES	0				
23	share_link	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
24	download_count	int	YES	0				
25	last_accessed	timestamp	YES	NULL				
26	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
27	modified_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_hash	NON_UNIQUE	BTREE	file_hash	0
idx_parent	NON_UNIQUE	BTREE	parent_folder_id	0
idx_search	NON_UNIQUE	FULLTEXT	file_name	0
idx_trashed	NON_UNIQUE	BTREE	is_trashed	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
cloud_files_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `cloud_files` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `parent_folder_id` bigint DEFAULT NULL,
  `file_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `file_type` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `mime_type` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `file_size` bigint NOT NULL,
  `file_hash` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `storage_path` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cdn_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `thumbnail_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `encryption_key` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_encrypted` tinyint(1) DEFAULT '0',
  `is_compressed` tinyint(1) DEFAULT '0',
  `compression_ratio` decimal(5,2) DEFAULT NULL,
  `metadata` json DEFAULT NULL,
  `tags` json DEFAULT NULL,
  `version` int DEFAULT '1',
  `is_favorite` tinyint(1) DEFAULT '0',
  `is_trashed` tinyint(1) DEFAULT '0',
  `trashed_at` timestamp NULL DEFAULT NULL,
  `is_shared` tinyint(1) DEFAULT '0',
  `share_link` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `download_count` int DEFAULT '0',
  `last_accessed` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `modified_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_parent` (`parent_folder_id`),
  KEY `idx_hash` (`file_hash`),
  KEY `idx_trashed` (`is_trashed`),
  FULLTEXT KEY `idx_search` (`file_name`),
  CONSTRAINT `cloud_files_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: cloud_folders
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:36:41 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	parent_folder_id	bigint	YES	NULL		MUL		
4	folder_name	varchar(255)	NO	NULL			utf8mb4_unicode_ci	
5	folder_path	varchar(1000)	YES	NULL		MUL	utf8mb4_unicode_ci	
6	path_hash	varchar(64)	YES	NULL	STORED GENERATED	MUL	utf8mb4_unicode_ci	
7	color_label	varchar(20)	YES	NULL			utf8mb4_unicode_ci	
8	icon	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
9	total_size	bigint	YES	0				
10	file_count	int	YES	0				
11	subfolder_count	int	YES	0				
12	is_shared	tinyint(1)	YES	0				
13	is_favorite	tinyint(1)	YES	0				
14	is_trashed	tinyint(1)	YES	0				
15	is_system	tinyint(1)	YES	0				
16	permissions	json	YES	NULL				
17	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
18	modified_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_parent	NON_UNIQUE	BTREE	parent_folder_id	0
idx_path_hash	NON_UNIQUE	BTREE	path_hash	0
idx_path_partial	NON_UNIQUE	BTREE	folder_path(255)	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
cloud_folders_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `cloud_folders` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `parent_folder_id` bigint DEFAULT NULL,
  `folder_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `folder_path` varchar(1000) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `path_hash` varchar(64) COLLATE utf8mb4_unicode_ci GENERATED ALWAYS AS (sha2(`folder_path`,256)) STORED,
  `color_label` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `icon` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `total_size` bigint DEFAULT '0',
  `file_count` int DEFAULT '0',
  `subfolder_count` int DEFAULT '0',
  `is_shared` tinyint(1) DEFAULT '0',
  `is_favorite` tinyint(1) DEFAULT '0',
  `is_trashed` tinyint(1) DEFAULT '0',
  `is_system` tinyint(1) DEFAULT '0',
  `permissions` json DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `modified_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_parent` (`parent_folder_id`),
  KEY `idx_path_partial` (`folder_path`(255)),
  KEY `idx_path_hash` (`path_hash`),
  CONSTRAINT `cloud_folders_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: cohort_analysis
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:53:58 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	cohort_month	date	NO	NULL		MUL		
3	cohort_size	int	NO	NULL				
4	period_number	int	NO	NULL		MUL		
5	retained_users	int	NO	NULL				
6	retention_rate	decimal(5,2)	YES	NULL				
7	revenue	decimal(20,2)	YES	NULL				
8	average_revenue_per_user	decimal(12,2)	YES	NULL				
9	churn_rate	decimal(5,2)	YES	NULL				
10	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_cohort	NON_UNIQUE	BTREE	cohort_month	0
idx_period	NON_UNIQUE	BTREE	period_number	0
unique_cohort	UNIQUE	BTREE	cohort_month, period_number	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `cohort_analysis` (
  `id` int NOT NULL AUTO_INCREMENT,
  `cohort_month` date NOT NULL,
  `cohort_size` int NOT NULL,
  `period_number` int NOT NULL,
  `retained_users` int NOT NULL,
  `retention_rate` decimal(5,2) DEFAULT NULL,
  `revenue` decimal(20,2) DEFAULT NULL,
  `average_revenue_per_user` decimal(12,2) DEFAULT NULL,
  `churn_rate` decimal(5,2) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_cohort` (`cohort_month`,`period_number`),
  KEY `idx_cohort` (`cohort_month`),
  KEY `idx_period` (`period_number`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: coin_transactions
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-07 01:09:42 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	type	enum('purchase','gift_sent','gift_received','achievement','daily_bonus','referral')	NO	NULL		MUL	utf8mb4_unicode_ci	
4	amount	int	NO	NULL				
5	balance_after	int	NO	NULL				
6	description	text	YES	NULL			utf8mb4_unicode_ci	
7	reference_id	int	YES	NULL				
8	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_type	NON_UNIQUE	BTREE	type	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
coin_transactions_ibfk_1	user_id	users	id	NO ACTION	CASCADE

--- SHOW CREATE TABLE ---
CREATE TABLE `coin_transactions` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `type` enum('purchase','gift_sent','gift_received','achievement','daily_bonus','referral') COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount` int NOT NULL,
  `balance_after` int NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `reference_id` int DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_type` (`type`),
  CONSTRAINT `coin_transactions_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: communities
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:28:29 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	community_name	varchar(50)	NO	NULL		UNI	utf8mb4_unicode_ci	
3	display_name	varchar(100)	NO	NULL			utf8mb4_unicode_ci	
4	description	text	YES	NULL			utf8mb4_unicode_ci	
5	detailed_description	text	YES	NULL			utf8mb4_unicode_ci	
6	icon_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
7	banner_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
8	community_type	enum('public','restricted','private')	YES	public			utf8mb4_unicode_ci	
9	nsfw	tinyint(1)	YES	0				
10	creator_id	int	NO	NULL		MUL		
11	moderators	json	YES	NULL				
12	rules	json	YES	NULL				
13	flairs	json	YES	NULL				
14	auto_mod_config	json	YES	NULL				
15	member_count	int	YES	0		MUL		
16	active_users	int	YES	0				
17	post_count	int	YES	0				
18	daily_posts_avg	int	YES	0				
19	karma_threshold	int	YES	0				
20	account_age_required	int	YES	0				
21	is_banned	tinyint(1)	YES	0				
22	is_quarantined	tinyint(1)	YES	0				
23	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
community_name	UNIQUE	BTREE	community_name	0
idx_creator	NON_UNIQUE	BTREE	creator_id	0
idx_members	NON_UNIQUE	BTREE	member_count	0
idx_name	NON_UNIQUE	BTREE	community_name	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
communities_ibfk_1	creator_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `communities` (
  `id` int NOT NULL AUTO_INCREMENT,
  `community_name` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `display_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `detailed_description` text COLLATE utf8mb4_unicode_ci,
  `icon_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `banner_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `community_type` enum('public','restricted','private') COLLATE utf8mb4_unicode_ci DEFAULT 'public',
  `nsfw` tinyint(1) DEFAULT '0',
  `creator_id` int NOT NULL,
  `moderators` json DEFAULT NULL,
  `rules` json DEFAULT NULL,
  `flairs` json DEFAULT NULL,
  `auto_mod_config` json DEFAULT NULL,
  `member_count` int DEFAULT '0',
  `active_users` int DEFAULT '0',
  `post_count` int DEFAULT '0',
  `daily_posts_avg` int DEFAULT '0',
  `karma_threshold` int DEFAULT '0',
  `account_age_required` int DEFAULT '0',
  `is_banned` tinyint(1) DEFAULT '0',
  `is_quarantined` tinyint(1) DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `community_name` (`community_name`),
  KEY `idx_name` (`community_name`),
  KEY `idx_members` (`member_count`),
  KEY `idx_creator` (`creator_id`),
  CONSTRAINT `communities_ibfk_1` FOREIGN KEY (`creator_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: community_events
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:52:18 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	organizer_id	int	NO	NULL		MUL		
3	event_type	varchar(100)	YES	NULL		MUL	utf8mb4_unicode_ci	
4	title	varchar(300)	NO	NULL			utf8mb4_unicode_ci	
5	description	text	YES	NULL			utf8mb4_unicode_ci	
6	venue_name	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
7	address	text	YES	NULL			utf8mb4_unicode_ci	
8	coordinates	json	YES	NULL				
9	event_date	date	NO	NULL		MUL		
10	start_time	time	YES	NULL				
11	end_time	time	YES	NULL				
12	admission_fee	decimal(10,2)	YES	0.00				
13	age_restriction	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
14	capacity	int	YES	NULL				
15	rsvp_required	tinyint(1)	YES	0				
16	rsvp_count	int	YES	0				
17	images	json	YES	NULL				
18	contact_info	json	YES	NULL				
19	website_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
20	is_recurring	tinyint(1)	YES	0				
21	recurrence_pattern	json	YES	NULL				
22	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_date	NON_UNIQUE	BTREE	event_date	0
idx_organizer	NON_UNIQUE	BTREE	organizer_id	0
idx_type	NON_UNIQUE	BTREE	event_type	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
community_events_ibfk_1	organizer_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `community_events` (
  `id` int NOT NULL AUTO_INCREMENT,
  `organizer_id` int NOT NULL,
  `event_type` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `title` varchar(300) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `venue_name` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address` text COLLATE utf8mb4_unicode_ci,
  `coordinates` json DEFAULT NULL,
  `event_date` date NOT NULL,
  `start_time` time DEFAULT NULL,
  `end_time` time DEFAULT NULL,
  `admission_fee` decimal(10,2) DEFAULT '0.00',
  `age_restriction` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `capacity` int DEFAULT NULL,
  `rsvp_required` tinyint(1) DEFAULT '0',
  `rsvp_count` int DEFAULT '0',
  `images` json DEFAULT NULL,
  `contact_info` json DEFAULT NULL,
  `website_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_recurring` tinyint(1) DEFAULT '0',
  `recurrence_pattern` json DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_organizer` (`organizer_id`),
  KEY `idx_date` (`event_date`),
  KEY `idx_type` (`event_type`),
  CONSTRAINT `community_events_ibfk_1` FOREIGN KEY (`organizer_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: community_group_members
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.08 | TOTAL_MB: 0.09 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:39:42 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	group_id	int	NO	NULL		MUL		
3	user_id	int	NO	NULL		MUL		
4	role	enum('member','moderator','admin')	YES	member		MUL	utf8mb4_unicode_ci	
5	invited_by	int	YES	NULL		MUL		
6	join_answers	json	YES	NULL				
7	is_muted	tinyint(1)	YES	0				
8	joined_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_group	NON_UNIQUE	BTREE	group_id	0
idx_role	NON_UNIQUE	BTREE	role	0
idx_user	NON_UNIQUE	BTREE	user_id	0
invited_by	NON_UNIQUE	BTREE	invited_by	0
unique_member	UNIQUE	BTREE	group_id, user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
community_group_members_ibfk_1	group_id	community_groups	id	NO ACTION	NO ACTION
community_group_members_ibfk_2	user_id	users	id	NO ACTION	NO ACTION
community_group_members_ibfk_3	invited_by	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `community_group_members` (
  `id` int NOT NULL AUTO_INCREMENT,
  `group_id` int NOT NULL,
  `user_id` int NOT NULL,
  `role` enum('member','moderator','admin') COLLATE utf8mb4_unicode_ci DEFAULT 'member',
  `invited_by` int DEFAULT NULL,
  `join_answers` json DEFAULT NULL,
  `is_muted` tinyint(1) DEFAULT '0',
  `joined_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_member` (`group_id`,`user_id`),
  KEY `idx_group` (`group_id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_role` (`role`),
  KEY `invited_by` (`invited_by`),
  CONSTRAINT `community_group_members_ibfk_1` FOREIGN KEY (`group_id`) REFERENCES `community_groups` (`id`),
  CONSTRAINT `community_group_members_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
  CONSTRAINT `community_group_members_ibfk_3` FOREIGN KEY (`invited_by`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: community_groups
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:39:42 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	group_name	varchar(200)	NO	NULL		MUL	utf8mb4_unicode_ci	
3	group_type	enum('public','closed','secret')	YES	public		MUL	utf8mb4_unicode_ci	
4	category	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
5	description	text	YES	NULL			utf8mb4_unicode_ci	
6	rules	text	YES	NULL			utf8mb4_unicode_ci	
7	cover_photo	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
8	location	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
9	tags	json	YES	NULL				
10	creator_id	int	NO	NULL		MUL		
11	admins	json	YES	NULL				
12	moderators	json	YES	NULL				
13	member_count	int	YES	0		MUL		
14	post_count	int	YES	0				
15	pending_members	json	YES	NULL				
16	banned_members	json	YES	NULL				
17	posting_permission	enum('anyone','members','admins')	YES	members			utf8mb4_unicode_ci	
18	approval_required	tinyint(1)	YES	0				
19	questions	json	YES	NULL				
20	is_archived	tinyint(1)	YES	0				
21	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_creator	NON_UNIQUE	BTREE	creator_id	0
idx_members	NON_UNIQUE	BTREE	member_count	0
idx_name	NON_UNIQUE	BTREE	group_name	0
idx_type	NON_UNIQUE	BTREE	group_type	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
community_groups_ibfk_1	creator_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `community_groups` (
  `id` int NOT NULL AUTO_INCREMENT,
  `group_name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `group_type` enum('public','closed','secret') COLLATE utf8mb4_unicode_ci DEFAULT 'public',
  `category` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `rules` text COLLATE utf8mb4_unicode_ci,
  `cover_photo` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `location` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tags` json DEFAULT NULL,
  `creator_id` int NOT NULL,
  `admins` json DEFAULT NULL,
  `moderators` json DEFAULT NULL,
  `member_count` int DEFAULT '0',
  `post_count` int DEFAULT '0',
  `pending_members` json DEFAULT NULL,
  `banned_members` json DEFAULT NULL,
  `posting_permission` enum('anyone','members','admins') COLLATE utf8mb4_unicode_ci DEFAULT 'members',
  `approval_required` tinyint(1) DEFAULT '0',
  `questions` json DEFAULT NULL,
  `is_archived` tinyint(1) DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_name` (`group_name`),
  KEY `idx_type` (`group_type`),
  KEY `idx_creator` (`creator_id`),
  KEY `idx_members` (`member_count`),
  CONSTRAINT `community_groups_ibfk_1` FOREIGN KEY (`creator_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: community_members
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:28:29 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	community_id	int	NO	NULL		MUL		
3	user_id	int	NO	NULL		MUL		
4	role	enum('member','approved','moderator','admin')	YES	member		MUL	utf8mb4_unicode_ci	
5	joined_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
6	is_banned	tinyint(1)	YES	0				
7	ban_reason	text	YES	NULL			utf8mb4_unicode_ci	
8	ban_expires	timestamp	YES	NULL				
9	user_flair	text	YES	NULL			utf8mb4_unicode_ci	

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_community	NON_UNIQUE	BTREE	community_id	0
idx_role	NON_UNIQUE	BTREE	role	0
idx_user	NON_UNIQUE	BTREE	user_id	0
unique_member	UNIQUE	BTREE	community_id, user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
community_members_ibfk_1	community_id	communities	id	NO ACTION	NO ACTION
community_members_ibfk_2	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `community_members` (
  `id` int NOT NULL AUTO_INCREMENT,
  `community_id` int NOT NULL,
  `user_id` int NOT NULL,
  `role` enum('member','approved','moderator','admin') COLLATE utf8mb4_unicode_ci DEFAULT 'member',
  `joined_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `is_banned` tinyint(1) DEFAULT '0',
  `ban_reason` text COLLATE utf8mb4_unicode_ci,
  `ban_expires` timestamp NULL DEFAULT NULL,
  `user_flair` text COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_member` (`community_id`,`user_id`),
  KEY `idx_community` (`community_id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_role` (`role`),
  CONSTRAINT `community_members_ibfk_1` FOREIGN KEY (`community_id`) REFERENCES `communities` (`id`),
  CONSTRAINT `community_members_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: community_posts
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.11 | TOTAL_MB: 0.13 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:28:29 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	community_id	int	NO	NULL		MUL		
3	author_id	int	NO	NULL		MUL		
4	post_type	enum('text','link','image','video','poll','crosspost')	NO	NULL			utf8mb4_unicode_ci	
5	title	varchar(300)	NO	NULL		MUL	utf8mb4_unicode_ci	
6	content	text	YES	NULL			utf8mb4_unicode_ci	
7	url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
8	media_urls	json	YES	NULL				
9	poll_options	json	YES	NULL				
10	flair_id	int	YES	NULL				
11	is_spoiler	tinyint(1)	YES	0				
12	is_nsfw	tinyint(1)	YES	0				
13	is_oc	tinyint(1)	YES	0				
14	is_pinned	tinyint(1)	YES	0				
15	is_locked	tinyint(1)	YES	0				
16	is_archived	tinyint(1)	YES	0				
17	is_removed	tinyint(1)	YES	0				
18	removal_reason	text	YES	NULL			utf8mb4_unicode_ci	
19	upvotes	int	YES	1				
20	downvotes	int	YES	0				
21	score	int	YES	1		MUL		
22	comment_count	int	YES	0				
23	view_count	bigint	YES	0				
24	hot_score	decimal(20,10)	YES	0.0000000000		MUL		
25	controversial_score	decimal(10,4)	YES	0.0000				
26	awards	json	YES	NULL				
27	crosspost_parent_id	bigint	YES	NULL				
28	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED	MUL		
29	edited_at	timestamp	YES	NULL				

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_author	NON_UNIQUE	BTREE	author_id	0
idx_community	NON_UNIQUE	BTREE	community_id	0
idx_created	NON_UNIQUE	BTREE	created_at	0
idx_hot	NON_UNIQUE	BTREE	hot_score	0
idx_score	NON_UNIQUE	BTREE	score	0
idx_search	NON_UNIQUE	FULLTEXT	title, content	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
community_posts_ibfk_1	community_id	communities	id	NO ACTION	NO ACTION
community_posts_ibfk_2	author_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `community_posts` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `community_id` int NOT NULL,
  `author_id` int NOT NULL,
  `post_type` enum('text','link','image','video','poll','crosspost') COLLATE utf8mb4_unicode_ci NOT NULL,
  `title` varchar(300) COLLATE utf8mb4_unicode_ci NOT NULL,
  `content` text COLLATE utf8mb4_unicode_ci,
  `url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `media_urls` json DEFAULT NULL,
  `poll_options` json DEFAULT NULL,
  `flair_id` int DEFAULT NULL,
  `is_spoiler` tinyint(1) DEFAULT '0',
  `is_nsfw` tinyint(1) DEFAULT '0',
  `is_oc` tinyint(1) DEFAULT '0',
  `is_pinned` tinyint(1) DEFAULT '0',
  `is_locked` tinyint(1) DEFAULT '0',
  `is_archived` tinyint(1) DEFAULT '0',
  `is_removed` tinyint(1) DEFAULT '0',
  `removal_reason` text COLLATE utf8mb4_unicode_ci,
  `upvotes` int DEFAULT '1',
  `downvotes` int DEFAULT '0',
  `score` int DEFAULT '1',
  `comment_count` int DEFAULT '0',
  `view_count` bigint DEFAULT '0',
  `hot_score` decimal(20,10) DEFAULT '0.0000000000',
  `controversial_score` decimal(10,4) DEFAULT '0.0000',
  `awards` json DEFAULT NULL,
  `crosspost_parent_id` bigint DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `edited_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_community` (`community_id`),
  KEY `idx_author` (`author_id`),
  KEY `idx_score` (`score` DESC),
  KEY `idx_hot` (`hot_score` DESC),
  KEY `idx_created` (`created_at`),
  FULLTEXT KEY `idx_search` (`title`,`content`),
  CONSTRAINT `community_posts_ibfk_1` FOREIGN KEY (`community_id`) REFERENCES `communities` (`id`),
  CONSTRAINT `community_posts_ibfk_2` FOREIGN KEY (`author_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: compatibility_questions
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.00 | TOTAL_MB: 0.02 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:12:06 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	question_text	text	NO	NULL			utf8mb4_unicode_ci	
3	category	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
4	importance_level	enum('low','medium','high','dealbreaker')	YES	medium			utf8mb4_unicode_ci	
5	question_type	enum('multiple_choice','scale','yes_no','open')	YES	multiple_choice			utf8mb4_unicode_ci	
6	options	json	YES	NULL				
7	is_active	tinyint(1)	YES	1				
8	times_answered	int	YES	0				
9	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `compatibility_questions` (
  `id` int NOT NULL AUTO_INCREMENT,
  `question_text` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `category` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `importance_level` enum('low','medium','high','dealbreaker') COLLATE utf8mb4_unicode_ci DEFAULT 'medium',
  `question_type` enum('multiple_choice','scale','yes_no','open') COLLATE utf8mb4_unicode_ci DEFAULT 'multiple_choice',
  `options` json DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT '1',
  `times_answered` int DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: compliance_tracking
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 16:03:29 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	compliance_type	enum('GDPR','CCPA','PCI','SOC2','ISO27001','HIPAA','AML','KYC')	NO	NULL		MUL	utf8mb4_unicode_ci	
3	requirement	varchar(500)	NO	NULL			utf8mb4_unicode_ci	
4	status	enum('compliant','non_compliant','partial','pending')	NO	NULL		MUL	utf8mb4_unicode_ci	
5	evidence	json	YES	NULL				
6	last_audit_date	date	YES	NULL				
7	next_audit_date	date	YES	NULL				
8	auditor	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
9	findings	text	YES	NULL			utf8mb4_unicode_ci	
10	remediation_plan	text	YES	NULL			utf8mb4_unicode_ci	
11	risk_level	enum('low','medium','high','critical')	YES	medium		MUL	utf8mb4_unicode_ci	
12	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
13	updated_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_risk	NON_UNIQUE	BTREE	risk_level	0
idx_status	NON_UNIQUE	BTREE	status	0
idx_type	NON_UNIQUE	BTREE	compliance_type	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `compliance_tracking` (
  `id` int NOT NULL AUTO_INCREMENT,
  `compliance_type` enum('GDPR','CCPA','PCI','SOC2','ISO27001','HIPAA','AML','KYC') COLLATE utf8mb4_unicode_ci NOT NULL,
  `requirement` varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` enum('compliant','non_compliant','partial','pending') COLLATE utf8mb4_unicode_ci NOT NULL,
  `evidence` json DEFAULT NULL,
  `last_audit_date` date DEFAULT NULL,
  `next_audit_date` date DEFAULT NULL,
  `auditor` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `findings` text COLLATE utf8mb4_unicode_ci,
  `remediation_plan` text COLLATE utf8mb4_unicode_ci,
  `risk_level` enum('low','medium','high','critical') COLLATE utf8mb4_unicode_ci DEFAULT 'medium',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_type` (`compliance_type`),
  KEY `idx_status` (`status`),
  KEY `idx_risk` (`risk_level`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: connection_quality_logs
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-04 00:00:20 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	session_id	int	YES	NULL		MUL		
3	user_id	int	YES	NULL		MUL		
4	partner_id	int	YES	NULL				
5	quality_score	decimal(3,2)	YES	NULL				
6	latency_ms	int	YES	NULL				
7	packet_loss	decimal(5,2)	YES	NULL				
8	jitter_ms	int	YES	NULL				
9	video_bitrate	int	YES	NULL				
10	audio_bitrate	int	YES	NULL				
11	resolution	varchar(20)	YES	NULL			utf8mb4_unicode_ci	
12	fps	int	YES	NULL				
13	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED	MUL		

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_created	NON_UNIQUE	BTREE	created_at	0
idx_session	NON_UNIQUE	BTREE	session_id	0
user_id	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
connection_quality_logs_ibfk_1	session_id	chat_sessions	id	NO ACTION	NO ACTION
connection_quality_logs_ibfk_2	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `connection_quality_logs` (
  `id` int NOT NULL AUTO_INCREMENT,
  `session_id` int DEFAULT NULL,
  `user_id` int DEFAULT NULL,
  `partner_id` int DEFAULT NULL,
  `quality_score` decimal(3,2) DEFAULT NULL,
  `latency_ms` int DEFAULT NULL,
  `packet_loss` decimal(5,2) DEFAULT NULL,
  `jitter_ms` int DEFAULT NULL,
  `video_bitrate` int DEFAULT NULL,
  `audio_bitrate` int DEFAULT NULL,
  `resolution` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `fps` int DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `idx_session` (`session_id`),
  KEY `idx_created` (`created_at`),
  CONSTRAINT `connection_quality_logs_ibfk_1` FOREIGN KEY (`session_id`) REFERENCES `chat_sessions` (`id`),
  CONSTRAINT `connection_quality_logs_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: connections
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_0900_ai_ci | CREATE: 2025-08-02 17:22:28 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user1_id	int	YES	NULL		MUL		
3	user2_id	int	YES	NULL		MUL		
4	status	enum('pending','accepted','blocked')	YES	pending			utf8mb4_0900_ai_ci	
5	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
unique_connection	UNIQUE	BTREE	user1_id, user2_id	0
user2_id	NON_UNIQUE	BTREE	user2_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
connections_ibfk_1	user1_id	users	id	NO ACTION	NO ACTION
connections_ibfk_2	user2_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `connections` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user1_id` int DEFAULT NULL,
  `user2_id` int DEFAULT NULL,
  `status` enum('pending','accepted','blocked') DEFAULT 'pending',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_connection` (`user1_id`,`user2_id`),
  KEY `user2_id` (`user2_id`),
  CONSTRAINT `connections_ibfk_1` FOREIGN KEY (`user1_id`) REFERENCES `users` (`id`),
  CONSTRAINT `connections_ibfk_2` FOREIGN KEY (`user2_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;


============================================================
TABLE: content_categories
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:30:09 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	category_name	varchar(100)	NO	NULL			utf8mb4_unicode_ci	
3	category_slug	varchar(100)	NO	NULL		UNI	utf8mb4_unicode_ci	
4	parent_category_id	int	YES	NULL		MUL		
5	description	text	YES	NULL			utf8mb4_unicode_ci	
6	icon_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
7	banner_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
8	display_order	int	YES	0		MUL		
9	is_featured	tinyint(1)	YES	0				
10	is_adult	tinyint(1)	YES	0				
11	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
category_slug	UNIQUE	BTREE	category_slug	0
idx_order	NON_UNIQUE	BTREE	display_order	0
idx_parent	NON_UNIQUE	BTREE	parent_category_id	0
idx_slug	NON_UNIQUE	BTREE	category_slug	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `content_categories` (
  `id` int NOT NULL AUTO_INCREMENT,
  `category_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `category_slug` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `parent_category_id` int DEFAULT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `icon_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `banner_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `display_order` int DEFAULT '0',
  `is_featured` tinyint(1) DEFAULT '0',
  `is_adult` tinyint(1) DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `category_slug` (`category_slug`),
  KEY `idx_slug` (`category_slug`),
  KEY `idx_parent` (`parent_category_id`),
  KEY `idx_order` (`display_order`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: content_discovery
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:31:20 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	discovery_type	enum('recommended','trending','viral','friends','nearby','interests')	NO	NULL		MUL	utf8mb4_unicode_ci	
4	content_items	json	NO	NULL				
5	algorithm_version	varchar(20)	YES	NULL			utf8mb4_unicode_ci	
6	relevance_scores	json	YES	NULL				
7	displayed_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
8	interactions	json	YES	NULL				
9	feedback	varchar(50)	YES	NULL			utf8mb4_unicode_ci	

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_type	NON_UNIQUE	BTREE	discovery_type	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
content_discovery_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `content_discovery` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `discovery_type` enum('recommended','trending','viral','friends','nearby','interests') COLLATE utf8mb4_unicode_ci NOT NULL,
  `content_items` json NOT NULL,
  `algorithm_version` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `relevance_scores` json DEFAULT NULL,
  `displayed_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `interactions` json DEFAULT NULL,
  `feedback` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_type` (`discovery_type`),
  CONSTRAINT `content_discovery_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: content_moderation
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:45:39 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	content_type	enum('message','image','video','audio','profile','stream')	NO	NULL		MUL	utf8mb4_unicode_ci	
3	content_id	int	NO	NULL				
4	user_id	int	NO	NULL		MUL		
5	moderation_status	enum('pending','approved','rejected','flagged','escalated')	YES	pending		MUL	utf8mb4_unicode_ci	
6	auto_moderation_score	decimal(3,2)	YES	NULL				
7	detected_issues	json	YES	NULL				
8	moderator_id	int	YES	NULL		MUL		
9	moderation_reason	text	YES	NULL			utf8mb4_unicode_ci	
10	action_taken	enum('none','warning','delete','suspend','ban')	YES	NULL			utf8mb4_unicode_ci	
11	appeal_status	enum('none','pending','approved','rejected')	YES	NULL			utf8mb4_unicode_ci	
12	appeal_reason	text	YES	NULL			utf8mb4_unicode_ci	
13	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
14	reviewed_at	timestamp	YES	NULL				

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_content	NON_UNIQUE	BTREE	content_type, content_id	0
idx_moderator	NON_UNIQUE	BTREE	moderator_id	0
idx_status	NON_UNIQUE	BTREE	moderation_status	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
content_moderation_ibfk_1	user_id	users	id	NO ACTION	NO ACTION
content_moderation_ibfk_2	moderator_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `content_moderation` (
  `id` int NOT NULL AUTO_INCREMENT,
  `content_type` enum('message','image','video','audio','profile','stream') COLLATE utf8mb4_unicode_ci NOT NULL,
  `content_id` int NOT NULL,
  `user_id` int NOT NULL,
  `moderation_status` enum('pending','approved','rejected','flagged','escalated') COLLATE utf8mb4_unicode_ci DEFAULT 'pending',
  `auto_moderation_score` decimal(3,2) DEFAULT NULL,
  `detected_issues` json DEFAULT NULL,
  `moderator_id` int DEFAULT NULL,
  `moderation_reason` text COLLATE utf8mb4_unicode_ci,
  `action_taken` enum('none','warning','delete','suspend','ban') COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `appeal_status` enum('none','pending','approved','rejected') COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `appeal_reason` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `reviewed_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_content` (`content_type`,`content_id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_status` (`moderation_status`),
  KEY `idx_moderator` (`moderator_id`),
  CONSTRAINT `content_moderation_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
  CONSTRAINT `content_moderation_ibfk_2` FOREIGN KEY (`moderator_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: content_moderation_queue
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.08 | TOTAL_MB: 0.09 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 16:03:29 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	content_type	varchar(100)	NO	NULL			utf8mb4_unicode_ci	
3	content_id	varchar(200)	NO	NULL			utf8mb4_unicode_ci	
4	user_id	int	NO	NULL		MUL		
5	reported_by	int	YES	NULL		MUL		
6	reason	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
7	ai_risk_score	decimal(5,4)	YES	NULL				
8	ai_categories_detected	json	YES	NULL				
9	priority	enum('urgent','high','medium','low')	YES	medium		MUL	utf8mb4_unicode_ci	
10	status	enum('pending','reviewing','approved','rejected','escalated')	YES	pending		MUL	utf8mb4_unicode_ci	
11	assigned_to	int	YES	NULL		MUL		
12	action_taken	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
13	notes	text	YES	NULL			utf8mb4_unicode_ci	
14	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
15	reviewed_at	timestamp	YES	NULL				

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
assigned_to	NON_UNIQUE	BTREE	assigned_to	0
idx_priority	NON_UNIQUE	BTREE	priority	0
idx_status	NON_UNIQUE	BTREE	status	0
idx_user	NON_UNIQUE	BTREE	user_id	0
reported_by	NON_UNIQUE	BTREE	reported_by	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
content_moderation_queue_ibfk_1	user_id	users	id	NO ACTION	NO ACTION
content_moderation_queue_ibfk_2	reported_by	users	id	NO ACTION	NO ACTION
content_moderation_queue_ibfk_3	assigned_to	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `content_moderation_queue` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `content_type` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `content_id` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` int NOT NULL,
  `reported_by` int DEFAULT NULL,
  `reason` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ai_risk_score` decimal(5,4) DEFAULT NULL,
  `ai_categories_detected` json DEFAULT NULL,
  `priority` enum('urgent','high','medium','low') COLLATE utf8mb4_unicode_ci DEFAULT 'medium',
  `status` enum('pending','reviewing','approved','rejected','escalated') COLLATE utf8mb4_unicode_ci DEFAULT 'pending',
  `assigned_to` int DEFAULT NULL,
  `action_taken` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `reviewed_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_status` (`status`),
  KEY `idx_priority` (`priority`),
  KEY `idx_user` (`user_id`),
  KEY `reported_by` (`reported_by`),
  KEY `assigned_to` (`assigned_to`),
  CONSTRAINT `content_moderation_queue_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
  CONSTRAINT `content_moderation_queue_ibfk_2` FOREIGN KEY (`reported_by`) REFERENCES `users` (`id`),
  CONSTRAINT `content_moderation_queue_ibfk_3` FOREIGN KEY (`assigned_to`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: content_purchases
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:48:21 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	buyer_id	int	NO	NULL		MUL		
3	content_id	int	NO	NULL		MUL		
4	creator_id	int	NO	NULL		MUL		
5	purchase_type	enum('ppv','tip','unlock','subscription')	NO	NULL			utf8mb4_unicode_ci	
6	amount	decimal(10,2)	NO	NULL				
7	currency	varchar(3)	YES	USD			utf8mb4_unicode_ci	
8	payment_method	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
9	transaction_id	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
10	commission_amount	decimal(10,2)	YES	NULL				
11	creator_earnings	decimal(10,2)	YES	NULL				
12	purchased_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_buyer	NON_UNIQUE	BTREE	buyer_id	0
idx_content	NON_UNIQUE	BTREE	content_id	0
idx_creator	NON_UNIQUE	BTREE	creator_id	0
unique_purchase	UNIQUE	BTREE	buyer_id, content_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
content_purchases_ibfk_1	buyer_id	users	id	NO ACTION	NO ACTION
content_purchases_ibfk_2	content_id	premium_content	id	NO ACTION	NO ACTION
content_purchases_ibfk_3	creator_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `content_purchases` (
  `id` int NOT NULL AUTO_INCREMENT,
  `buyer_id` int NOT NULL,
  `content_id` int NOT NULL,
  `creator_id` int NOT NULL,
  `purchase_type` enum('ppv','tip','unlock','subscription') COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount` decimal(10,2) NOT NULL,
  `currency` varchar(3) COLLATE utf8mb4_unicode_ci DEFAULT 'USD',
  `payment_method` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `transaction_id` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `commission_amount` decimal(10,2) DEFAULT NULL,
  `creator_earnings` decimal(10,2) DEFAULT NULL,
  `purchased_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_purchase` (`buyer_id`,`content_id`),
  KEY `idx_buyer` (`buyer_id`),
  KEY `idx_content` (`content_id`),
  KEY `idx_creator` (`creator_id`),
  CONSTRAINT `content_purchases_ibfk_1` FOREIGN KEY (`buyer_id`) REFERENCES `users` (`id`),
  CONSTRAINT `content_purchases_ibfk_2` FOREIGN KEY (`content_id`) REFERENCES `premium_content` (`id`),
  CONSTRAINT `content_purchases_ibfk_3` FOREIGN KEY (`creator_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: content_reviews
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:30:09 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	content_id	int	NO	NULL		MUL		
3	user_id	int	NO	NULL		MUL		
4	rating	int	NO	NULL		MUL		
5	review_title	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
6	review_text	text	YES	NULL			utf8mb4_unicode_ci	
7	likes_count	int	YES	0				
8	dislikes_count	int	YES	0				
9	is_spoiler	tinyint(1)	YES	0				
10	is_featured	tinyint(1)	YES	0				
11	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_content	NON_UNIQUE	BTREE	content_id	0
idx_rating	NON_UNIQUE	BTREE	rating	0
idx_user	NON_UNIQUE	BTREE	user_id	0
unique_review	UNIQUE	BTREE	content_id, user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
content_reviews_ibfk_1	content_id	media_content	id	NO ACTION	NO ACTION
content_reviews_ibfk_2	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `content_reviews` (
  `id` int NOT NULL AUTO_INCREMENT,
  `content_id` int NOT NULL,
  `user_id` int NOT NULL,
  `rating` int NOT NULL,
  `review_title` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `review_text` text COLLATE utf8mb4_unicode_ci,
  `likes_count` int DEFAULT '0',
  `dislikes_count` int DEFAULT '0',
  `is_spoiler` tinyint(1) DEFAULT '0',
  `is_featured` tinyint(1) DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_review` (`content_id`,`user_id`),
  KEY `idx_content` (`content_id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_rating` (`rating`),
  CONSTRAINT `content_reviews_ibfk_1` FOREIGN KEY (`content_id`) REFERENCES `media_content` (`id`),
  CONSTRAINT `content_reviews_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
  CONSTRAINT `content_reviews_chk_1` CHECK ((`rating` between 1 and 10))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: conversion_funnels
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:53:58 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	session_id	varchar(100)	NO	NULL		MUL	utf8mb4_unicode_ci	
4	funnel_name	varchar(100)	NO	NULL		MUL	utf8mb4_unicode_ci	
5	steps_completed	json	NO	NULL				
6	current_step	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
7	completed	tinyint(1)	YES	0		MUL		
8	abandoned_at_step	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
9	time_spent_seconds	int	YES	NULL				
10	device_type	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
11	traffic_source	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
12	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
13	completed_at	timestamp	YES	NULL				

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_completed	NON_UNIQUE	BTREE	completed	0
idx_funnel	NON_UNIQUE	BTREE	funnel_name	0
idx_session	NON_UNIQUE	BTREE	session_id	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
conversion_funnels_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `conversion_funnels` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `session_id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `funnel_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `steps_completed` json NOT NULL,
  `current_step` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `completed` tinyint(1) DEFAULT '0',
  `abandoned_at_step` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `time_spent_seconds` int DEFAULT NULL,
  `device_type` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `traffic_source` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `completed_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_session` (`session_id`),
  KEY `idx_funnel` (`funnel_name`),
  KEY `idx_completed` (`completed`),
  CONSTRAINT `conversion_funnels_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: course_enrollments
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:11:42 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	course_id	int	NO	NULL		MUL		
3	student_id	int	NO	NULL		MUL		
4	enrollment_type	enum('free','paid','scholarship','corporate')	YES	paid			utf8mb4_unicode_ci	
5	price_paid	decimal(10,2)	YES	0.00				
6	progress_percentage	decimal(5,2)	YES	0.00		MUL		
7	current_lesson_id	int	YES	NULL				
8	completed_lessons	json	YES	NULL				
9	quiz_scores	json	YES	NULL				
10	assignment_grades	json	YES	NULL				
11	time_spent_minutes	int	YES	0				
12	last_accessed	timestamp	YES	NULL				
13	completion_date	timestamp	YES	NULL				
14	certificate_issued	tinyint(1)	YES	0				
15	certificate_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
16	rating	int	YES	NULL				
17	review	text	YES	NULL			utf8mb4_unicode_ci	
18	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_course	NON_UNIQUE	BTREE	course_id	0
idx_progress	NON_UNIQUE	BTREE	progress_percentage	0
idx_student	NON_UNIQUE	BTREE	student_id	0
unique_enrollment	UNIQUE	BTREE	course_id, student_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
course_enrollments_ibfk_1	course_id	courses	id	NO ACTION	NO ACTION
course_enrollments_ibfk_2	student_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `course_enrollments` (
  `id` int NOT NULL AUTO_INCREMENT,
  `course_id` int NOT NULL,
  `student_id` int NOT NULL,
  `enrollment_type` enum('free','paid','scholarship','corporate') COLLATE utf8mb4_unicode_ci DEFAULT 'paid',
  `price_paid` decimal(10,2) DEFAULT '0.00',
  `progress_percentage` decimal(5,2) DEFAULT '0.00',
  `current_lesson_id` int DEFAULT NULL,
  `completed_lessons` json DEFAULT NULL,
  `quiz_scores` json DEFAULT NULL,
  `assignment_grades` json DEFAULT NULL,
  `time_spent_minutes` int DEFAULT '0',
  `last_accessed` timestamp NULL DEFAULT NULL,
  `completion_date` timestamp NULL DEFAULT NULL,
  `certificate_issued` tinyint(1) DEFAULT '0',
  `certificate_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `rating` int DEFAULT NULL,
  `review` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_enrollment` (`course_id`,`student_id`),
  KEY `idx_course` (`course_id`),
  KEY `idx_student` (`student_id`),
  KEY `idx_progress` (`progress_percentage`),
  CONSTRAINT `course_enrollments_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`),
  CONSTRAINT `course_enrollments_ibfk_2` FOREIGN KEY (`student_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: course_lessons
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:11:42 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	course_id	int	NO	NULL		MUL		
3	section_name	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
4	lesson_title	varchar(200)	NO	NULL			utf8mb4_unicode_ci	
5	lesson_type	enum('video','text','quiz','assignment','live','interactive')	NO	NULL			utf8mb4_unicode_ci	
6	content_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
7	content_text	text	YES	NULL			utf8mb4_unicode_ci	
8	duration_minutes	int	YES	NULL				
9	order_index	int	NO	NULL		MUL		
10	is_preview	tinyint(1)	YES	0				
11	is_mandatory	tinyint(1)	YES	1				
12	resources	json	YES	NULL				
13	quiz_questions	json	YES	NULL				
14	assignment_details	json	YES	NULL				
15	completion_criteria	json	YES	NULL				
16	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_course	NON_UNIQUE	BTREE	course_id	0
idx_order	NON_UNIQUE	BTREE	order_index	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
course_lessons_ibfk_1	course_id	courses	id	NO ACTION	CASCADE

--- SHOW CREATE TABLE ---
CREATE TABLE `course_lessons` (
  `id` int NOT NULL AUTO_INCREMENT,
  `course_id` int NOT NULL,
  `section_name` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `lesson_title` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `lesson_type` enum('video','text','quiz','assignment','live','interactive') COLLATE utf8mb4_unicode_ci NOT NULL,
  `content_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `content_text` text COLLATE utf8mb4_unicode_ci,
  `duration_minutes` int DEFAULT NULL,
  `order_index` int NOT NULL,
  `is_preview` tinyint(1) DEFAULT '0',
  `is_mandatory` tinyint(1) DEFAULT '1',
  `resources` json DEFAULT NULL,
  `quiz_questions` json DEFAULT NULL,
  `assignment_details` json DEFAULT NULL,
  `completion_criteria` json DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_course` (`course_id`),
  KEY `idx_order` (`order_index`),
  CONSTRAINT `course_lessons_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: courses
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:11:42 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	instructor_id	int	NO	NULL		MUL		
3	title	varchar(200)	NO	NULL			utf8mb4_unicode_ci	
4	description	text	YES	NULL			utf8mb4_unicode_ci	
5	category	varchar(100)	YES	NULL		MUL	utf8mb4_unicode_ci	
6	subcategory	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
7	thumbnail_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
8	preview_video_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
9	price	decimal(10,2)	YES	0.00		MUL		
10	discount_percentage	int	YES	0				
11	language	varchar(10)	YES	en			utf8mb4_unicode_ci	
12	difficulty_level	enum('beginner','intermediate','advanced','expert')	YES	beginner			utf8mb4_unicode_ci	
13	duration_hours	decimal(5,2)	YES	NULL				
14	total_lessons	int	YES	0				
15	total_students	int	YES	0				
16	average_rating	decimal(3,2)	YES	0.00		MUL		
17	completion_rate	decimal(5,2)	YES	0.00				
18	certificate_available	tinyint(1)	YES	1				
19	requirements	text	YES	NULL			utf8mb4_unicode_ci	
20	what_will_learn	json	YES	NULL				
21	target_audience	text	YES	NULL			utf8mb4_unicode_ci	
22	is_accredited	tinyint(1)	YES	0				
23	accreditation_body	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
24	is_featured	tinyint(1)	YES	0				
25	is_bestseller	tinyint(1)	YES	0				
26	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
27	updated_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_category	NON_UNIQUE	BTREE	category	0
idx_instructor	NON_UNIQUE	BTREE	instructor_id	0
idx_price	NON_UNIQUE	BTREE	price	0
idx_rating	NON_UNIQUE	BTREE	average_rating	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
courses_ibfk_1	instructor_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `courses` (
  `id` int NOT NULL AUTO_INCREMENT,
  `instructor_id` int NOT NULL,
  `title` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `category` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `subcategory` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `thumbnail_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `preview_video_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `price` decimal(10,2) DEFAULT '0.00',
  `discount_percentage` int DEFAULT '0',
  `language` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT 'en',
  `difficulty_level` enum('beginner','intermediate','advanced','expert') COLLATE utf8mb4_unicode_ci DEFAULT 'beginner',
  `duration_hours` decimal(5,2) DEFAULT NULL,
  `total_lessons` int DEFAULT '0',
  `total_students` int DEFAULT '0',
  `average_rating` decimal(3,2) DEFAULT '0.00',
  `completion_rate` decimal(5,2) DEFAULT '0.00',
  `certificate_available` tinyint(1) DEFAULT '1',
  `requirements` text COLLATE utf8mb4_unicode_ci,
  `what_will_learn` json DEFAULT NULL,
  `target_audience` text COLLATE utf8mb4_unicode_ci,
  `is_accredited` tinyint(1) DEFAULT '0',
  `accreditation_body` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_featured` tinyint(1) DEFAULT '0',
  `is_bestseller` tinyint(1) DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_instructor` (`instructor_id`),
  KEY `idx_category` (`category`),
  KEY `idx_price` (`price`),
  KEY `idx_rating` (`average_rating`),
  CONSTRAINT `courses_ibfk_1` FOREIGN KEY (`instructor_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: creator_dashboard
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 16:04:26 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	creator_id	int	NO	NULL		UNI		
3	content_published	int	YES	0				
4	total_views	bigint	YES	0				
5	total_likes	int	YES	0				
6	subscribers_count	int	YES	0				
7	subscribers_growth_week	decimal(10,2)	YES	0.00				
8	streams_this_month	int	YES	0				
9	average_viewers	int	YES	0				
10	peak_viewers	int	YES	0				
11	earnings_month	decimal(12,2)	YES	0.00				
12	tips_received	decimal(12,2)	YES	0.00				
13	subscription_revenue	decimal(12,2)	YES	0.00				
14	engagement_rate	decimal(5,2)	YES	0.00				
15	comments_to_reply	int	YES	0				
16	last_updated	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_creator	NON_UNIQUE	BTREE	creator_id	0
unique_creator	UNIQUE	BTREE	creator_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
creator_dashboard_ibfk_1	creator_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `creator_dashboard` (
  `id` int NOT NULL AUTO_INCREMENT,
  `creator_id` int NOT NULL,
  `content_published` int DEFAULT '0',
  `total_views` bigint DEFAULT '0',
  `total_likes` int DEFAULT '0',
  `subscribers_count` int DEFAULT '0',
  `subscribers_growth_week` decimal(10,2) DEFAULT '0.00',
  `streams_this_month` int DEFAULT '0',
  `average_viewers` int DEFAULT '0',
  `peak_viewers` int DEFAULT '0',
  `earnings_month` decimal(12,2) DEFAULT '0.00',
  `tips_received` decimal(12,2) DEFAULT '0.00',
  `subscription_revenue` decimal(12,2) DEFAULT '0.00',
  `engagement_rate` decimal(5,2) DEFAULT '0.00',
  `comments_to_reply` int DEFAULT '0',
  `last_updated` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_creator` (`creator_id`),
  KEY `idx_creator` (`creator_id`),
  CONSTRAINT `creator_dashboard_ibfk_1` FOREIGN KEY (`creator_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: creator_profiles
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:47:23 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		UNI		
3	display_name	varchar(100)	NO	NULL			utf8mb4_unicode_ci	
4	bio	text	YES	NULL			utf8mb4_unicode_ci	
5	cover_photo	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
6	subscription_price	decimal(10,2)	YES	0.00				
7	discount_percentage	int	YES	0				
8	bundle_discount	json	YES	NULL				
9	free_trial_days	int	YES	0				
10	content_categories	json	YES	NULL				
11	content_count	int	YES	0				
12	subscriber_count	int	YES	0				
13	total_earnings	decimal(15,2)	YES	0.00				
14	commission_rate	decimal(5,2)	YES	20.00				
15	payout_method	json	YES	NULL				
16	min_tip_amount	decimal(10,2)	YES	1.00				
17	custom_requests_enabled	tinyint(1)	YES	1				
18	custom_request_price	decimal(10,2)	YES	NULL				
19	is_verified	tinyint(1)	YES	0		MUL		
20	is_featured	tinyint(1)	YES	0		MUL		
21	welcome_message	text	YES	NULL			utf8mb4_unicode_ci	
22	auto_reply_enabled	tinyint(1)	YES	0				
23	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_featured	NON_UNIQUE	BTREE	is_featured	0
idx_user	NON_UNIQUE	BTREE	user_id	0
idx_verified	NON_UNIQUE	BTREE	is_verified	0
user_id	UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
creator_profiles_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `creator_profiles` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `display_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `bio` text COLLATE utf8mb4_unicode_ci,
  `cover_photo` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `subscription_price` decimal(10,2) DEFAULT '0.00',
  `discount_percentage` int DEFAULT '0',
  `bundle_discount` json DEFAULT NULL,
  `free_trial_days` int DEFAULT '0',
  `content_categories` json DEFAULT NULL,
  `content_count` int DEFAULT '0',
  `subscriber_count` int DEFAULT '0',
  `total_earnings` decimal(15,2) DEFAULT '0.00',
  `commission_rate` decimal(5,2) DEFAULT '20.00',
  `payout_method` json DEFAULT NULL,
  `min_tip_amount` decimal(10,2) DEFAULT '1.00',
  `custom_requests_enabled` tinyint(1) DEFAULT '1',
  `custom_request_price` decimal(10,2) DEFAULT NULL,
  `is_verified` tinyint(1) DEFAULT '0',
  `is_featured` tinyint(1) DEFAULT '0',
  `welcome_message` text COLLATE utf8mb4_unicode_ci,
  `auto_reply_enabled` tinyint(1) DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_id` (`user_id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_verified` (`is_verified`),
  KEY `idx_featured` (`is_featured`),
  CONSTRAINT `creator_profiles_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: creator_tips
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:48:33 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	tipper_id	int	NO	NULL		MUL		
3	creator_id	int	NO	NULL		MUL		
4	amount	decimal(10,2)	NO	NULL		MUL		
5	message	text	YES	NULL			utf8mb4_unicode_ci	
6	is_anonymous	tinyint(1)	YES	0				
7	content_id	int	YES	NULL				
8	stream_id	int	YES	NULL				
9	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_amount	NON_UNIQUE	BTREE	amount	0
idx_creator	NON_UNIQUE	BTREE	creator_id	0
idx_tipper	NON_UNIQUE	BTREE	tipper_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
creator_tips_ibfk_1	tipper_id	users	id	NO ACTION	NO ACTION
creator_tips_ibfk_2	creator_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `creator_tips` (
  `id` int NOT NULL AUTO_INCREMENT,
  `tipper_id` int NOT NULL,
  `creator_id` int NOT NULL,
  `amount` decimal(10,2) NOT NULL,
  `message` text COLLATE utf8mb4_unicode_ci,
  `is_anonymous` tinyint(1) DEFAULT '0',
  `content_id` int DEFAULT NULL,
  `stream_id` int DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_tipper` (`tipper_id`),
  KEY `idx_creator` (`creator_id`),
  KEY `idx_amount` (`amount`),
  CONSTRAINT `creator_tips_ibfk_1` FOREIGN KEY (`tipper_id`) REFERENCES `users` (`id`),
  CONSTRAINT `creator_tips_ibfk_2` FOREIGN KEY (`creator_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: cross_platform_orders
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:53:41 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	master_order_id	varchar(100)	NO	NULL		UNI	utf8mb4_unicode_ci	
3	platform_orders	json	NO	NULL				
4	customer_email	varchar(200)	YES	NULL		MUL	utf8mb4_unicode_ci	
5	total_amount	decimal(12,2)	NO	NULL				
6	currency	varchar(3)	YES	USD			utf8mb4_unicode_ci	
7	status_summary	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
8	platform_statuses	json	YES	NULL				
9	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
10	updated_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_email	NON_UNIQUE	BTREE	customer_email	0
idx_master_id	NON_UNIQUE	BTREE	master_order_id	0
master_order_id	UNIQUE	BTREE	master_order_id	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `cross_platform_orders` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `master_order_id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `platform_orders` json NOT NULL,
  `customer_email` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `total_amount` decimal(12,2) NOT NULL,
  `currency` varchar(3) COLLATE utf8mb4_unicode_ci DEFAULT 'USD',
  `status_summary` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `platform_statuses` json DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `master_order_id` (`master_order_id`),
  KEY `idx_master_id` (`master_order_id`),
  KEY `idx_email` (`customer_email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: cross_platform_shares
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:31:20 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	source_platform	varchar(50)	NO	NULL		MUL	utf8mb4_unicode_ci	
4	source_content_id	bigint	NO	NULL				
5	target_platforms	json	NO	NULL				
6	share_message	text	YES	NULL			utf8mb4_unicode_ci	
7	hashtags	json	YES	NULL				
8	mentions	json	YES	NULL				
9	custom_settings	json	YES	NULL				
10	status	enum('pending','shared','failed','partial')	YES	pending			utf8mb4_unicode_ci	
11	results	json	YES	NULL				
12	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_source	NON_UNIQUE	BTREE	source_platform	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
cross_platform_shares_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `cross_platform_shares` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `source_platform` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `source_content_id` bigint NOT NULL,
  `target_platforms` json NOT NULL,
  `share_message` text COLLATE utf8mb4_unicode_ci,
  `hashtags` json DEFAULT NULL,
  `mentions` json DEFAULT NULL,
  `custom_settings` json DEFAULT NULL,
  `status` enum('pending','shared','failed','partial') COLLATE utf8mb4_unicode_ci DEFAULT 'pending',
  `results` json DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_source` (`source_platform`),
  CONSTRAINT `cross_platform_shares_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: crypto_staking
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:12:40 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	wallet_id	int	NO	NULL		MUL		
4	token_symbol	varchar(20)	NO	NULL			utf8mb4_unicode_ci	
5	amount_staked	decimal(30,18)	NO	NULL				
6	apy_percentage	decimal(10,4)	NO	NULL				
7	lock_period_days	int	YES	0				
8	rewards_earned	decimal(30,18)	YES	0.000000000000000000				
9	rewards_claimed	decimal(30,18)	YES	0.000000000000000000				
10	staking_platform	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
11	validator_address	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
12	status	enum('active','unbonding','completed','cancelled')	YES	active		MUL	utf8mb4_unicode_ci	
13	staked_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
14	unlock_date	timestamp	YES	NULL				
15	last_reward_calculation	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_status	NON_UNIQUE	BTREE	status	0
idx_user	NON_UNIQUE	BTREE	user_id	0
idx_wallet	NON_UNIQUE	BTREE	wallet_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
crypto_staking_ibfk_1	user_id	users	id	NO ACTION	NO ACTION
crypto_staking_ibfk_2	wallet_id	crypto_wallets	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `crypto_staking` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `wallet_id` int NOT NULL,
  `token_symbol` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount_staked` decimal(30,18) NOT NULL,
  `apy_percentage` decimal(10,4) NOT NULL,
  `lock_period_days` int DEFAULT '0',
  `rewards_earned` decimal(30,18) DEFAULT '0.000000000000000000',
  `rewards_claimed` decimal(30,18) DEFAULT '0.000000000000000000',
  `staking_platform` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `validator_address` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` enum('active','unbonding','completed','cancelled') COLLATE utf8mb4_unicode_ci DEFAULT 'active',
  `staked_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `unlock_date` timestamp NULL DEFAULT NULL,
  `last_reward_calculation` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_wallet` (`wallet_id`),
  KEY `idx_status` (`status`),
  CONSTRAINT `crypto_staking_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
  CONSTRAINT `crypto_staking_ibfk_2` FOREIGN KEY (`wallet_id`) REFERENCES `crypto_wallets` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: crypto_transactions
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.08 | TOTAL_MB: 0.09 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:12:40 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	wallet_id	int	NO	NULL		MUL		
4	transaction_hash	varchar(100)	YES	NULL		UNI	utf8mb4_unicode_ci	
5	transaction_type	enum('send','receive','swap','stake','unstake','reward','fee')	NO	NULL			utf8mb4_unicode_ci	
6	from_address	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
7	to_address	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
8	amount_crypto	decimal(30,18)	NO	NULL				
9	amount_usd	decimal(20,2)	YES	NULL				
10	gas_fee	decimal(30,18)	YES	NULL				
11	gas_fee_usd	decimal(10,2)	YES	NULL				
12	blockchain	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
13	token_symbol	varchar(20)	YES	NULL			utf8mb4_unicode_ci	
14	token_contract	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
15	confirmations	int	YES	0				
16	status	enum('pending','confirmed','failed','cancelled')	YES	pending		MUL	utf8mb4_unicode_ci	
17	block_number	bigint	YES	NULL				
18	block_timestamp	timestamp	YES	NULL				
19	memo	text	YES	NULL			utf8mb4_unicode_ci	
20	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_hash	NON_UNIQUE	BTREE	transaction_hash	0
idx_status	NON_UNIQUE	BTREE	status	0
idx_user	NON_UNIQUE	BTREE	user_id	0
idx_wallet	NON_UNIQUE	BTREE	wallet_id	0
transaction_hash	UNIQUE	BTREE	transaction_hash	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
crypto_transactions_ibfk_1	user_id	users	id	NO ACTION	NO ACTION
crypto_transactions_ibfk_2	wallet_id	crypto_wallets	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `crypto_transactions` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `wallet_id` int NOT NULL,
  `transaction_hash` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `transaction_type` enum('send','receive','swap','stake','unstake','reward','fee') COLLATE utf8mb4_unicode_ci NOT NULL,
  `from_address` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `to_address` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `amount_crypto` decimal(30,18) NOT NULL,
  `amount_usd` decimal(20,2) DEFAULT NULL,
  `gas_fee` decimal(30,18) DEFAULT NULL,
  `gas_fee_usd` decimal(10,2) DEFAULT NULL,
  `blockchain` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `token_symbol` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `token_contract` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `confirmations` int DEFAULT '0',
  `status` enum('pending','confirmed','failed','cancelled') COLLATE utf8mb4_unicode_ci DEFAULT 'pending',
  `block_number` bigint DEFAULT NULL,
  `block_timestamp` timestamp NULL DEFAULT NULL,
  `memo` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `transaction_hash` (`transaction_hash`),
  KEY `idx_user` (`user_id`),
  KEY `idx_wallet` (`wallet_id`),
  KEY `idx_hash` (`transaction_hash`),
  KEY `idx_status` (`status`),
  CONSTRAINT `crypto_transactions_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
  CONSTRAINT `crypto_transactions_ibfk_2` FOREIGN KEY (`wallet_id`) REFERENCES `crypto_wallets` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: crypto_wallets
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:12:40 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	wallet_address	varchar(100)	NO	NULL		UNI	utf8mb4_unicode_ci	
4	wallet_type	enum('hot','cold','custodial','non_custodial')	YES	custodial			utf8mb4_unicode_ci	
5	blockchain	enum('bitcoin','ethereum','bsc','polygon','solana','avalanche')	NO	NULL		MUL	utf8mb4_unicode_ci	
6	balance_crypto	decimal(30,18)	YES	0.000000000000000000				
7	balance_usd	decimal(20,2)	YES	0.00				
8	private_key_encrypted	text	YES	NULL			utf8mb4_unicode_ci	
9	public_key	text	YES	NULL			utf8mb4_unicode_ci	
10	mnemonic_encrypted	text	YES	NULL			utf8mb4_unicode_ci	
11	is_primary	tinyint(1)	YES	0				
12	is_active	tinyint(1)	YES	1				
13	last_sync	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
14	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_address	NON_UNIQUE	BTREE	wallet_address	0
idx_blockchain	NON_UNIQUE	BTREE	blockchain	0
idx_user	NON_UNIQUE	BTREE	user_id	0
wallet_address	UNIQUE	BTREE	wallet_address	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
crypto_wallets_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `crypto_wallets` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `wallet_address` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `wallet_type` enum('hot','cold','custodial','non_custodial') COLLATE utf8mb4_unicode_ci DEFAULT 'custodial',
  `blockchain` enum('bitcoin','ethereum','bsc','polygon','solana','avalanche') COLLATE utf8mb4_unicode_ci NOT NULL,
  `balance_crypto` decimal(30,18) DEFAULT '0.000000000000000000',
  `balance_usd` decimal(20,2) DEFAULT '0.00',
  `private_key_encrypted` text COLLATE utf8mb4_unicode_ci,
  `public_key` text COLLATE utf8mb4_unicode_ci,
  `mnemonic_encrypted` text COLLATE utf8mb4_unicode_ci,
  `is_primary` tinyint(1) DEFAULT '0',
  `is_active` tinyint(1) DEFAULT '1',
  `last_sync` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `wallet_address` (`wallet_address`),
  KEY `idx_user` (`user_id`),
  KEY `idx_blockchain` (`blockchain`),
  KEY `idx_address` (`wallet_address`),
  CONSTRAINT `crypto_wallets_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: custom_emojis
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:55:45 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	creator_id	int	NO	NULL		MUL		
3	shortcode	varchar(50)	NO	NULL		UNI	utf8mb4_unicode_ci	
4	name	varchar(100)	NO	NULL			utf8mb4_unicode_ci	
5	image_url	varchar(500)	NO	NULL			utf8mb4_unicode_ci	
6	animated_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
7	category	varchar(50)	YES	NULL		MUL	utf8mb4_unicode_ci	
8	is_animated	tinyint(1)	YES	0				
9	is_premium	tinyint(1)	YES	0				
10	usage_count	int	YES	0				
11	is_approved	tinyint(1)	YES	0				
12	is_global	tinyint(1)	YES	0				
13	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_category	NON_UNIQUE	BTREE	category	0
idx_creator	NON_UNIQUE	BTREE	creator_id	0
idx_shortcode	NON_UNIQUE	BTREE	shortcode	0
shortcode	UNIQUE	BTREE	shortcode	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
custom_emojis_ibfk_1	creator_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `custom_emojis` (
  `id` int NOT NULL AUTO_INCREMENT,
  `creator_id` int NOT NULL,
  `shortcode` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `image_url` varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL,
  `animated_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `category` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_animated` tinyint(1) DEFAULT '0',
  `is_premium` tinyint(1) DEFAULT '0',
  `usage_count` int DEFAULT '0',
  `is_approved` tinyint(1) DEFAULT '0',
  `is_global` tinyint(1) DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `shortcode` (`shortcode`),
  KEY `idx_creator` (`creator_id`),
  KEY `idx_shortcode` (`shortcode`),
  KEY `idx_category` (`category`),
  CONSTRAINT `custom_emojis_ibfk_1` FOREIGN KEY (`creator_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: custom_reports
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 16:04:49 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	report_name	varchar(200)	NO	NULL			utf8mb4_unicode_ci	
3	report_type	varchar(100)	YES	NULL		MUL	utf8mb4_unicode_ci	
4	created_by	int	NO	NULL		MUL		
5	query	text	NO	NULL			utf8mb4_unicode_ci	
6	parameters	json	YES	NULL				
7	visualizations	json	YES	NULL				
8	schedule	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
9	recipients	json	YES	NULL				
10	format	varchar(20)	YES	pdf			utf8mb4_unicode_ci	
11	is_public	tinyint(1)	YES	0				
12	last_generated	timestamp	YES	NULL				
13	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_created_by	NON_UNIQUE	BTREE	created_by	0
idx_type	NON_UNIQUE	BTREE	report_type	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
custom_reports_ibfk_1	created_by	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `custom_reports` (
  `id` int NOT NULL AUTO_INCREMENT,
  `report_name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `report_type` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_by` int NOT NULL,
  `query` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `parameters` json DEFAULT NULL,
  `visualizations` json DEFAULT NULL,
  `schedule` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `recipients` json DEFAULT NULL,
  `format` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT 'pdf',
  `is_public` tinyint(1) DEFAULT '0',
  `last_generated` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_created_by` (`created_by`),
  KEY `idx_type` (`report_type`),
  CONSTRAINT `custom_reports_ibfk_1` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: customer_lifetime_value
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:53:58 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	customer_id	int	NO	NULL		MUL		
3	calculation_date	date	NO	NULL				
4	historical_value	decimal(20,2)	NO	NULL				
5	predicted_value	decimal(20,2)	YES	NULL				
6	total_ltv	decimal(20,2)	YES	NULL		MUL		
7	average_order_value	decimal(12,2)	YES	NULL				
8	purchase_frequency	decimal(10,4)	YES	NULL				
9	customer_lifespan_days	int	YES	NULL				
10	churn_probability	decimal(5,4)	YES	NULL				
11	segment	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
12	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_customer	NON_UNIQUE	BTREE	customer_id	0
idx_ltv	NON_UNIQUE	BTREE	total_ltv	0
unique_calculation	UNIQUE	BTREE	customer_id, calculation_date	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
customer_lifetime_value_ibfk_1	customer_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `customer_lifetime_value` (
  `id` int NOT NULL AUTO_INCREMENT,
  `customer_id` int NOT NULL,
  `calculation_date` date NOT NULL,
  `historical_value` decimal(20,2) NOT NULL,
  `predicted_value` decimal(20,2) DEFAULT NULL,
  `total_ltv` decimal(20,2) DEFAULT NULL,
  `average_order_value` decimal(12,2) DEFAULT NULL,
  `purchase_frequency` decimal(10,4) DEFAULT NULL,
  `customer_lifespan_days` int DEFAULT NULL,
  `churn_probability` decimal(5,4) DEFAULT NULL,
  `segment` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_calculation` (`customer_id`,`calculation_date`),
  KEY `idx_customer` (`customer_id`),
  KEY `idx_ltv` (`total_ltv`),
  CONSTRAINT `customer_lifetime_value_ibfk_1` FOREIGN KEY (`customer_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: customer_segments
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.02 | TOTAL_MB: 0.03 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:52:35 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	store_id	int	NO	NULL		MUL		
3	segment_name	varchar(200)	NO	NULL			utf8mb4_unicode_ci	
4	description	text	YES	NULL			utf8mb4_unicode_ci	
5	conditions	json	NO	NULL				
6	customer_count	int	YES	0				
7	is_dynamic	tinyint(1)	YES	1				
8	last_updated	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			
9	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_store	NON_UNIQUE	BTREE	store_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
customer_segments_ibfk_1	store_id	online_stores	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `customer_segments` (
  `id` int NOT NULL AUTO_INCREMENT,
  `store_id` int NOT NULL,
  `segment_name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `conditions` json NOT NULL,
  `customer_count` int DEFAULT '0',
  `is_dynamic` tinyint(1) DEFAULT '1',
  `last_updated` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_store` (`store_id`),
  CONSTRAINT `customer_segments_ibfk_1` FOREIGN KEY (`store_id`) REFERENCES `online_stores` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: daily_missions
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:38:22 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	mission_code	varchar(50)	NO	NULL		UNI	utf8mb4_unicode_ci	
3	title	varchar(100)	NO	NULL			utf8mb4_unicode_ci	
4	description	text	YES	NULL			utf8mb4_unicode_ci	
5	mission_type	enum('chat','gift','match','room','game','social','streak')	NO	NULL		MUL	utf8mb4_unicode_ci	
6	requirement_value	int	NO	NULL				
7	xp_reward	int	YES	0				
8	coin_reward	int	YES	0				
9	item_rewards	json	YES	NULL				
10	difficulty	enum('easy','medium','hard','extreme')	YES	medium		MUL	utf8mb4_unicode_ci	
11	time_limit_hours	int	YES	24				
12	is_active	tinyint(1)	YES	1		MUL		
13	min_level	int	YES	1				
14	max_daily_completions	int	YES	1				
15	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_active	NON_UNIQUE	BTREE	is_active	0
idx_difficulty	NON_UNIQUE	BTREE	difficulty	0
idx_type	NON_UNIQUE	BTREE	mission_type	0
mission_code	UNIQUE	BTREE	mission_code	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `daily_missions` (
  `id` int NOT NULL AUTO_INCREMENT,
  `mission_code` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `title` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `mission_type` enum('chat','gift','match','room','game','social','streak') COLLATE utf8mb4_unicode_ci NOT NULL,
  `requirement_value` int NOT NULL,
  `xp_reward` int DEFAULT '0',
  `coin_reward` int DEFAULT '0',
  `item_rewards` json DEFAULT NULL,
  `difficulty` enum('easy','medium','hard','extreme') COLLATE utf8mb4_unicode_ci DEFAULT 'medium',
  `time_limit_hours` int DEFAULT '24',
  `is_active` tinyint(1) DEFAULT '1',
  `min_level` int DEFAULT '1',
  `max_daily_completions` int DEFAULT '1',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `mission_code` (`mission_code`),
  KEY `idx_type` (`mission_type`),
  KEY `idx_active` (`is_active`),
  KEY `idx_difficulty` (`difficulty`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: daily_rewards
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 03:03:45 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	day_number	int	NO	NULL		UNI		
3	reward_type	enum('tokens','spins','bonus','item','xp','vip_points')	NO	NULL		MUL	utf8mb4_unicode_ci	
4	reward_amount	decimal(20,2)	NO	NULL				
5	reward_data	json	YES	NULL				
6	vip_multiplier	decimal(3,2)	YES	1.00				
7	icon_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
8	is_milestone	tinyint(1)	YES	0				
9	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_type	NON_UNIQUE	BTREE	reward_type	0
unique_day	UNIQUE	BTREE	day_number	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `daily_rewards` (
  `id` int NOT NULL AUTO_INCREMENT,
  `day_number` int NOT NULL,
  `reward_type` enum('tokens','spins','bonus','item','xp','vip_points') COLLATE utf8mb4_unicode_ci NOT NULL,
  `reward_amount` decimal(20,2) NOT NULL,
  `reward_data` json DEFAULT NULL,
  `vip_multiplier` decimal(3,2) DEFAULT '1.00',
  `icon_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_milestone` tinyint(1) DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_day` (`day_number`),
  KEY `idx_type` (`reward_type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: daily_stats
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.02 | TOTAL_MB: 0.03 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_0900_ai_ci | CREATE: 2025-08-04 01:43:53 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	date	date	NO	NULL		UNI		
3	total_users	int	YES	0				
4	new_users	int	YES	0				
5	active_users	int	YES	0				
6	total_sessions	int	YES	0				
7	total_messages	int	YES	0				
8	avg_session_duration	int	YES	0				
9	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
unique_date	UNIQUE	BTREE	date	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `daily_stats` (
  `id` int NOT NULL AUTO_INCREMENT,
  `date` date NOT NULL,
  `total_users` int DEFAULT '0',
  `new_users` int DEFAULT '0',
  `active_users` int DEFAULT '0',
  `total_sessions` int DEFAULT '0',
  `total_messages` int DEFAULT '0',
  `avg_session_duration` int DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_date` (`date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;


============================================================
TABLE: dashboard_ai_insights
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 16:04:00 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	metric_date	date	NO	NULL		UNI		
3	ai_requests_total	bigint	YES	0				
4	ai_conversations	int	YES	0				
5	ai_images_generated	int	YES	0				
6	ai_recommendations_served	bigint	YES	0				
7	content_auto_moderated	int	YES	0				
8	fraud_detected	int	YES	0				
9	personalized_experiences	int	YES	0				
10	prices_optimized	int	YES	0				
11	inventory_predictions	int	YES	0				
12	ai_processing_costs	decimal(20,2)	YES	0.00				
13	ai_driven_revenue	decimal(20,2)	YES	0.00				
14	ai_roi	decimal(10,2)	YES	0.00				
15	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_date	NON_UNIQUE	BTREE	metric_date	0
unique_date	UNIQUE	BTREE	metric_date	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `dashboard_ai_insights` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `metric_date` date NOT NULL,
  `ai_requests_total` bigint DEFAULT '0',
  `ai_conversations` int DEFAULT '0',
  `ai_images_generated` int DEFAULT '0',
  `ai_recommendations_served` bigint DEFAULT '0',
  `content_auto_moderated` int DEFAULT '0',
  `fraud_detected` int DEFAULT '0',
  `personalized_experiences` int DEFAULT '0',
  `prices_optimized` int DEFAULT '0',
  `inventory_predictions` int DEFAULT '0',
  `ai_processing_costs` decimal(20,2) DEFAULT '0.00',
  `ai_driven_revenue` decimal(20,2) DEFAULT '0.00',
  `ai_roi` decimal(10,2) DEFAULT '0.00',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_date` (`metric_date`),
  KEY `idx_date` (`metric_date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: dashboard_cloud_storage
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 16:04:00 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	metric_date	date	NO	NULL		UNI		
3	total_storage_used_tb	decimal(10,2)	YES	0.00				
4	total_files	bigint	YES	0				
5	total_folders	bigint	YES	0				
6	active_storage_users	int	YES	0				
7	files_uploaded	int	YES	0				
8	data_uploaded_gb	decimal(20,2)	YES	0.00				
9	files_downloaded	int	YES	0				
10	data_downloaded_gb	decimal(20,2)	YES	0.00				
11	files_shared	int	YES	0				
12	share_links_created	int	YES	0				
13	free_users	int	YES	0				
14	paid_users	int	YES	0				
15	storage_revenue	decimal(20,2)	YES	0.00				
16	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_date	NON_UNIQUE	BTREE	metric_date	0
unique_date	UNIQUE	BTREE	metric_date	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `dashboard_cloud_storage` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `metric_date` date NOT NULL,
  `total_storage_used_tb` decimal(10,2) DEFAULT '0.00',
  `total_files` bigint DEFAULT '0',
  `total_folders` bigint DEFAULT '0',
  `active_storage_users` int DEFAULT '0',
  `files_uploaded` int DEFAULT '0',
  `data_uploaded_gb` decimal(20,2) DEFAULT '0.00',
  `files_downloaded` int DEFAULT '0',
  `data_downloaded_gb` decimal(20,2) DEFAULT '0.00',
  `files_shared` int DEFAULT '0',
  `share_links_created` int DEFAULT '0',
  `free_users` int DEFAULT '0',
  `paid_users` int DEFAULT '0',
  `storage_revenue` decimal(20,2) DEFAULT '0.00',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_date` (`metric_date`),
  KEY `idx_date` (`metric_date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: dashboard_crypto
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 16:04:00 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	metric_date	date	NO	NULL		UNI		
3	total_wallets	int	YES	0				
4	active_wallets	int	YES	0				
5	crypto_transactions	int	YES	0				
6	total_volume_usd	decimal(20,2)	YES	0.00				
7	volume_by_currency	json	YES	NULL				
8	holdings_by_currency	json	YES	NULL				
9	nfts_minted	int	YES	0				
10	nfts_sold	int	YES	0				
11	nft_volume_eth	decimal(20,8)	YES	0.00000000				
12	nft_volume_usd	decimal(20,2)	YES	0.00				
13	trading_fees_collected	decimal(20,2)	YES	0.00				
14	total_staked_usd	decimal(20,2)	YES	0.00				
15	staking_rewards_paid	decimal(20,2)	YES	0.00				
16	liquidity_provided	decimal(20,2)	YES	0.00				
17	yield_generated	decimal(20,2)	YES	0.00				
18	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_date	NON_UNIQUE	BTREE	metric_date	0
unique_date	UNIQUE	BTREE	metric_date	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `dashboard_crypto` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `metric_date` date NOT NULL,
  `total_wallets` int DEFAULT '0',
  `active_wallets` int DEFAULT '0',
  `crypto_transactions` int DEFAULT '0',
  `total_volume_usd` decimal(20,2) DEFAULT '0.00',
  `volume_by_currency` json DEFAULT NULL,
  `holdings_by_currency` json DEFAULT NULL,
  `nfts_minted` int DEFAULT '0',
  `nfts_sold` int DEFAULT '0',
  `nft_volume_eth` decimal(20,8) DEFAULT '0.00000000',
  `nft_volume_usd` decimal(20,2) DEFAULT '0.00',
  `trading_fees_collected` decimal(20,2) DEFAULT '0.00',
  `total_staked_usd` decimal(20,2) DEFAULT '0.00',
  `staking_rewards_paid` decimal(20,2) DEFAULT '0.00',
  `liquidity_provided` decimal(20,2) DEFAULT '0.00',
  `yield_generated` decimal(20,2) DEFAULT '0.00',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_date` (`metric_date`),
  KEY `idx_date` (`metric_date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: dashboard_dating
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 16:04:00 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	metric_date	date	NO	NULL		UNI		
3	total_profiles	int	YES	0				
4	active_daters	int	YES	0				
5	matches_made	int	YES	0				
6	mutual_likes	int	YES	0				
7	super_likes	int	YES	0				
8	conversations_started	int	YES	0				
9	messages_exchanged	bigint	YES	0				
10	dates_scheduled	int	YES	0				
11	dates_completed	int	YES	0				
12	premium_subscribers	int	YES	0				
13	boost_purchases	int	YES	0				
14	match_rate	decimal(5,2)	YES	0.00				
15	conversation_rate	decimal(5,2)	YES	0.00				
16	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_date	NON_UNIQUE	BTREE	metric_date	0
unique_date	UNIQUE	BTREE	metric_date	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `dashboard_dating` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `metric_date` date NOT NULL,
  `total_profiles` int DEFAULT '0',
  `active_daters` int DEFAULT '0',
  `matches_made` int DEFAULT '0',
  `mutual_likes` int DEFAULT '0',
  `super_likes` int DEFAULT '0',
  `conversations_started` int DEFAULT '0',
  `messages_exchanged` bigint DEFAULT '0',
  `dates_scheduled` int DEFAULT '0',
  `dates_completed` int DEFAULT '0',
  `premium_subscribers` int DEFAULT '0',
  `boost_purchases` int DEFAULT '0',
  `match_rate` decimal(5,2) DEFAULT '0.00',
  `conversation_rate` decimal(5,2) DEFAULT '0.00',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_date` (`metric_date`),
  KEY `idx_date` (`metric_date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: dashboard_delivery
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 16:04:00 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	metric_date	date	NO	NULL		UNI		
3	delivery_orders	int	YES	0				
4	food_orders	int	YES	0				
5	grocery_orders	int	YES	0				
6	package_deliveries	int	YES	0				
7	active_drivers	int	YES	0				
8	available_drivers	int	YES	0				
9	driver_utilization	decimal(5,2)	YES	0.00				
10	average_delivery_time_minutes	decimal(10,2)	YES	0.00				
11	on_time_delivery_rate	decimal(5,2)	YES	0.00				
12	delivery_revenue	decimal(20,2)	YES	0.00				
13	delivery_fees_collected	decimal(20,2)	YES	0.00				
14	driver_earnings	decimal(20,2)	YES	0.00				
15	tips_collected	decimal(20,2)	YES	0.00				
16	partner_restaurants	int	YES	0				
17	restaurant_gmv	decimal(20,2)	YES	0.00				
18	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_date	NON_UNIQUE	BTREE	metric_date	0
unique_date	UNIQUE	BTREE	metric_date	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `dashboard_delivery` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `metric_date` date NOT NULL,
  `delivery_orders` int DEFAULT '0',
  `food_orders` int DEFAULT '0',
  `grocery_orders` int DEFAULT '0',
  `package_deliveries` int DEFAULT '0',
  `active_drivers` int DEFAULT '0',
  `available_drivers` int DEFAULT '0',
  `driver_utilization` decimal(5,2) DEFAULT '0.00',
  `average_delivery_time_minutes` decimal(10,2) DEFAULT '0.00',
  `on_time_delivery_rate` decimal(5,2) DEFAULT '0.00',
  `delivery_revenue` decimal(20,2) DEFAULT '0.00',
  `delivery_fees_collected` decimal(20,2) DEFAULT '0.00',
  `driver_earnings` decimal(20,2) DEFAULT '0.00',
  `tips_collected` decimal(20,2) DEFAULT '0.00',
  `partner_restaurants` int DEFAULT '0',
  `restaurant_gmv` decimal(20,2) DEFAULT '0.00',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_date` (`metric_date`),
  KEY `idx_date` (`metric_date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: dashboard_ecommerce
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 16:04:00 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	metric_date	date	NO	NULL		UNI		
3	total_sales	decimal(20,2)	YES	0.00				
4	orders_count	int	YES	0				
5	average_order_value	decimal(12,2)	YES	0.00				
6	items_sold	int	YES	0				
7	sales_by_category	json	YES	NULL				
8	top_selling_products	json	YES	NULL				
9	low_stock_products	json	YES	NULL				
10	top_sellers	json	YES	NULL				
11	new_sellers	int	YES	0				
12	visitors	int	YES	0				
13	add_to_cart	int	YES	0				
14	checkout_initiated	int	YES	0				
15	orders_completed	int	YES	0				
16	conversion_rate	decimal(5,2)	YES	0.00				
17	cart_abandonment_rate	decimal(5,2)	YES	0.00				
18	new_customers	int	YES	0				
19	returning_customers	int	YES	0				
20	customer_lifetime_value	decimal(12,2)	YES	0.00				
21	orders_pending	int	YES	0				
22	orders_processing	int	YES	0				
23	orders_shipped	int	YES	0				
24	orders_delivered	int	YES	0				
25	orders_returned	int	YES	0				
26	reviews_received	int	YES	0				
27	average_rating	decimal(3,2)	YES	0.00				
28	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_date	NON_UNIQUE	BTREE	metric_date	0
unique_date	UNIQUE	BTREE	metric_date	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `dashboard_ecommerce` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `metric_date` date NOT NULL,
  `total_sales` decimal(20,2) DEFAULT '0.00',
  `orders_count` int DEFAULT '0',
  `average_order_value` decimal(12,2) DEFAULT '0.00',
  `items_sold` int DEFAULT '0',
  `sales_by_category` json DEFAULT NULL,
  `top_selling_products` json DEFAULT NULL,
  `low_stock_products` json DEFAULT NULL,
  `top_sellers` json DEFAULT NULL,
  `new_sellers` int DEFAULT '0',
  `visitors` int DEFAULT '0',
  `add_to_cart` int DEFAULT '0',
  `checkout_initiated` int DEFAULT '0',
  `orders_completed` int DEFAULT '0',
  `conversion_rate` decimal(5,2) DEFAULT '0.00',
  `cart_abandonment_rate` decimal(5,2) DEFAULT '0.00',
  `new_customers` int DEFAULT '0',
  `returning_customers` int DEFAULT '0',
  `customer_lifetime_value` decimal(12,2) DEFAULT '0.00',
  `orders_pending` int DEFAULT '0',
  `orders_processing` int DEFAULT '0',
  `orders_shipped` int DEFAULT '0',
  `orders_delivered` int DEFAULT '0',
  `orders_returned` int DEFAULT '0',
  `reviews_received` int DEFAULT '0',
  `average_rating` decimal(3,2) DEFAULT '0.00',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_date` (`metric_date`),
  KEY `idx_date` (`metric_date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: dashboard_education
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 16:04:00 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	metric_date	date	NO	NULL		UNI		
3	total_courses	int	YES	0				
4	active_courses	int	YES	0				
5	enrolled_students	int	YES	0				
6	active_students	int	YES	0				
7	lessons_completed	int	YES	0				
8	assignments_submitted	int	YES	0				
9	quiz_attempts	int	YES	0				
10	average_score	decimal(5,2)	YES	0.00				
11	certificates_issued	int	YES	0				
12	course_sales	decimal(20,2)	YES	0.00				
13	subscription_revenue	decimal(20,2)	YES	0.00				
14	enrollments_by_category	json	YES	NULL				
15	revenue_by_category	json	YES	NULL				
16	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_date	NON_UNIQUE	BTREE	metric_date	0
unique_date	UNIQUE	BTREE	metric_date	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `dashboard_education` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `metric_date` date NOT NULL,
  `total_courses` int DEFAULT '0',
  `active_courses` int DEFAULT '0',
  `enrolled_students` int DEFAULT '0',
  `active_students` int DEFAULT '0',
  `lessons_completed` int DEFAULT '0',
  `assignments_submitted` int DEFAULT '0',
  `quiz_attempts` int DEFAULT '0',
  `average_score` decimal(5,2) DEFAULT '0.00',
  `certificates_issued` int DEFAULT '0',
  `course_sales` decimal(20,2) DEFAULT '0.00',
  `subscription_revenue` decimal(20,2) DEFAULT '0.00',
  `enrollments_by_category` json DEFAULT NULL,
  `revenue_by_category` json DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_date` (`metric_date`),
  KEY `idx_date` (`metric_date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: dashboard_gaming
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 16:04:00 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	metric_date	date	NO	NULL		UNI		
3	active_players	int	YES	0				
4	new_players	int	YES	0				
5	games_played	bigint	YES	0				
6	unique_games_played	int	YES	0				
7	total_wagered	decimal(20,2)	YES	0.00				
8	total_won	decimal(20,2)	YES	0.00				
9	total_lost	decimal(20,2)	YES	0.00				
10	house_edge	decimal(5,2)	YES	0.00				
11	revenue_by_game	json	YES	NULL				
12	players_by_game	json	YES	NULL				
13	tournaments_active	int	YES	0				
14	tournament_participants	int	YES	0				
15	tournament_prize_pool	decimal(20,2)	YES	0.00				
16	slots_revenue	decimal(20,2)	YES	0.00				
17	table_games_revenue	decimal(20,2)	YES	0.00				
18	live_casino_revenue	decimal(20,2)	YES	0.00				
19	jackpots_won	int	YES	0				
20	jackpot_total_paid	decimal(20,2)	YES	0.00				
21	current_jackpot_pool	decimal(20,2)	YES	0.00				
22	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_date	NON_UNIQUE	BTREE	metric_date	0
unique_date	UNIQUE	BTREE	metric_date	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `dashboard_gaming` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `metric_date` date NOT NULL,
  `active_players` int DEFAULT '0',
  `new_players` int DEFAULT '0',
  `games_played` bigint DEFAULT '0',
  `unique_games_played` int DEFAULT '0',
  `total_wagered` decimal(20,2) DEFAULT '0.00',
  `total_won` decimal(20,2) DEFAULT '0.00',
  `total_lost` decimal(20,2) DEFAULT '0.00',
  `house_edge` decimal(5,2) DEFAULT '0.00',
  `revenue_by_game` json DEFAULT NULL,
  `players_by_game` json DEFAULT NULL,
  `tournaments_active` int DEFAULT '0',
  `tournament_participants` int DEFAULT '0',
  `tournament_prize_pool` decimal(20,2) DEFAULT '0.00',
  `slots_revenue` decimal(20,2) DEFAULT '0.00',
  `table_games_revenue` decimal(20,2) DEFAULT '0.00',
  `live_casino_revenue` decimal(20,2) DEFAULT '0.00',
  `jackpots_won` int DEFAULT '0',
  `jackpot_total_paid` decimal(20,2) DEFAULT '0.00',
  `current_jackpot_pool` decimal(20,2) DEFAULT '0.00',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_date` (`metric_date`),
  KEY `idx_date` (`metric_date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: dashboard_health
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 16:04:00 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	metric_date	date	NO	NULL		UNI		
3	active_fitness_users	int	YES	0				
4	workouts_logged	int	YES	0				
5	total_exercise_minutes	bigint	YES	0				
6	calories_burned_total	bigint	YES	0				
7	meals_logged	int	YES	0				
8	average_calories_consumed	decimal(10,2)	YES	0.00				
9	active_programs	int	YES	0				
10	program_completions	int	YES	0				
11	active_challenges	int	YES	0				
12	challenge_participants	int	YES	0				
13	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_date	NON_UNIQUE	BTREE	metric_date	0
unique_date	UNIQUE	BTREE	metric_date	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `dashboard_health` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `metric_date` date NOT NULL,
  `active_fitness_users` int DEFAULT '0',
  `workouts_logged` int DEFAULT '0',
  `total_exercise_minutes` bigint DEFAULT '0',
  `calories_burned_total` bigint DEFAULT '0',
  `meals_logged` int DEFAULT '0',
  `average_calories_consumed` decimal(10,2) DEFAULT '0.00',
  `active_programs` int DEFAULT '0',
  `program_completions` int DEFAULT '0',
  `active_challenges` int DEFAULT '0',
  `challenge_participants` int DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_date` (`metric_date`),
  KEY `idx_date` (`metric_date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: dashboard_marketplace
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 16:04:00 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	metric_date	date	NO	NULL		UNI		
3	total_sellers	int	YES	0				
4	active_sellers	int	YES	0				
5	new_sellers	int	YES	0				
6	total_listings	bigint	YES	0				
7	active_listings	bigint	YES	0				
8	new_listings	int	YES	0				
9	transactions_count	int	YES	0				
10	gmv	decimal(20,2)	YES	0.00				
11	take_rate	decimal(5,2)	YES	0.00				
12	platform_revenue	decimal(20,2)	YES	0.00				
13	active_auctions	int	YES	0				
14	bids_placed	int	YES	0				
15	auction_conversion_rate	decimal(5,2)	YES	0.00				
16	gmv_by_category	json	YES	NULL				
17	listings_by_category	json	YES	NULL				
18	average_sale_price	decimal(12,2)	YES	0.00				
19	average_time_to_sell_days	decimal(10,2)	YES	0.00				
20	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_date	NON_UNIQUE	BTREE	metric_date	0
unique_date	UNIQUE	BTREE	metric_date	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `dashboard_marketplace` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `metric_date` date NOT NULL,
  `total_sellers` int DEFAULT '0',
  `active_sellers` int DEFAULT '0',
  `new_sellers` int DEFAULT '0',
  `total_listings` bigint DEFAULT '0',
  `active_listings` bigint DEFAULT '0',
  `new_listings` int DEFAULT '0',
  `transactions_count` int DEFAULT '0',
  `gmv` decimal(20,2) DEFAULT '0.00',
  `take_rate` decimal(5,2) DEFAULT '0.00',
  `platform_revenue` decimal(20,2) DEFAULT '0.00',
  `active_auctions` int DEFAULT '0',
  `bids_placed` int DEFAULT '0',
  `auction_conversion_rate` decimal(5,2) DEFAULT '0.00',
  `gmv_by_category` json DEFAULT NULL,
  `listings_by_category` json DEFAULT NULL,
  `average_sale_price` decimal(12,2) DEFAULT '0.00',
  `average_time_to_sell_days` decimal(10,2) DEFAULT '0.00',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_date` (`metric_date`),
  KEY `idx_date` (`metric_date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: dashboard_music_podcast
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 16:04:00 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	metric_date	date	NO	NULL		UNI		
3	tracks_played	bigint	YES	0				
4	unique_listeners	int	YES	0				
5	listening_hours	decimal(20,2)	YES	0.00				
6	episodes_played	int	YES	0				
7	podcast_subscribers	int	YES	0				
8	playlists_created	int	YES	0				
9	playlist_followers	int	YES	0				
10	artist_uploads	int	YES	0				
11	artist_earnings	decimal(20,2)	YES	0.00				
12	streaming_revenue	decimal(20,2)	YES	0.00				
13	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_date	NON_UNIQUE	BTREE	metric_date	0
unique_date	UNIQUE	BTREE	metric_date	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `dashboard_music_podcast` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `metric_date` date NOT NULL,
  `tracks_played` bigint DEFAULT '0',
  `unique_listeners` int DEFAULT '0',
  `listening_hours` decimal(20,2) DEFAULT '0.00',
  `episodes_played` int DEFAULT '0',
  `podcast_subscribers` int DEFAULT '0',
  `playlists_created` int DEFAULT '0',
  `playlist_followers` int DEFAULT '0',
  `artist_uploads` int DEFAULT '0',
  `artist_earnings` decimal(20,2) DEFAULT '0.00',
  `streaming_revenue` decimal(20,2) DEFAULT '0.00',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_date` (`metric_date`),
  KEY `idx_date` (`metric_date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: dashboard_services
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 16:04:00 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	metric_date	date	NO	NULL		UNI		
3	total_providers	int	YES	0				
4	active_providers	int	YES	0				
5	services_booked	int	YES	0				
6	services_completed	int	YES	0				
7	bookings_by_category	json	YES	NULL				
8	services_gmv	decimal(20,2)	YES	0.00				
9	platform_commission	decimal(20,2)	YES	0.00				
10	average_service_rating	decimal(3,2)	YES	0.00				
11	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_date	NON_UNIQUE	BTREE	metric_date	0
unique_date	UNIQUE	BTREE	metric_date	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `dashboard_services` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `metric_date` date NOT NULL,
  `total_providers` int DEFAULT '0',
  `active_providers` int DEFAULT '0',
  `services_booked` int DEFAULT '0',
  `services_completed` int DEFAULT '0',
  `bookings_by_category` json DEFAULT NULL,
  `services_gmv` decimal(20,2) DEFAULT '0.00',
  `platform_commission` decimal(20,2) DEFAULT '0.00',
  `average_service_rating` decimal(3,2) DEFAULT '0.00',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_date` (`metric_date`),
  KEY `idx_date` (`metric_date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: dashboard_social
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 16:04:00 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	metric_date	date	NO	NULL		UNI		
3	total_users	bigint	YES	0				
4	active_users	int	YES	0				
5	new_users	int	YES	0				
6	posts_created	int	YES	0				
7	stories_created	int	YES	0				
8	videos_uploaded	int	YES	0				
9	likes_total	bigint	YES	0				
10	comments_total	bigint	YES	0				
11	shares_total	bigint	YES	0				
12	views_total	bigint	YES	0				
13	messages_sent	bigint	YES	0				
14	active_conversations	int	YES	0				
15	groups_created	int	YES	0				
16	group_members_total	int	YES	0				
17	trending_hashtags	json	YES	NULL				
18	trending_topics	json	YES	NULL				
19	viral_posts	json	YES	NULL				
20	metrics_by_platform	json	YES	NULL				
21	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_date	NON_UNIQUE	BTREE	metric_date	0
unique_date	UNIQUE	BTREE	metric_date	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `dashboard_social` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `metric_date` date NOT NULL,
  `total_users` bigint DEFAULT '0',
  `active_users` int DEFAULT '0',
  `new_users` int DEFAULT '0',
  `posts_created` int DEFAULT '0',
  `stories_created` int DEFAULT '0',
  `videos_uploaded` int DEFAULT '0',
  `likes_total` bigint DEFAULT '0',
  `comments_total` bigint DEFAULT '0',
  `shares_total` bigint DEFAULT '0',
  `views_total` bigint DEFAULT '0',
  `messages_sent` bigint DEFAULT '0',
  `active_conversations` int DEFAULT '0',
  `groups_created` int DEFAULT '0',
  `group_members_total` int DEFAULT '0',
  `trending_hashtags` json DEFAULT NULL,
  `trending_topics` json DEFAULT NULL,
  `viral_posts` json DEFAULT NULL,
  `metrics_by_platform` json DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_date` (`metric_date`),
  KEY `idx_date` (`metric_date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: dashboard_streaming
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 16:04:00 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	metric_date	date	NO	NULL		UNI		
3	active_streams	int	YES	0				
4	total_streamers	int	YES	0				
5	total_viewers	int	YES	0				
6	peak_concurrent_viewers	int	YES	0				
7	videos_uploaded	int	YES	0				
8	videos_views	bigint	YES	0				
9	watch_time_hours	decimal(20,2)	YES	0.00				
10	average_view_duration_minutes	decimal(10,2)	YES	0.00				
11	subscription_revenue	decimal(20,2)	YES	0.00				
12	ads_revenue	decimal(20,2)	YES	0.00				
13	tips_revenue	decimal(20,2)	YES	0.00				
14	pay_per_view_revenue	decimal(20,2)	YES	0.00				
15	top_streams	json	YES	NULL				
16	top_videos	json	YES	NULL				
17	top_creators	json	YES	NULL				
18	average_bitrate	int	YES	0				
19	buffering_ratio	decimal(5,2)	YES	0.00				
20	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_date	NON_UNIQUE	BTREE	metric_date	0
unique_date	UNIQUE	BTREE	metric_date	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `dashboard_streaming` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `metric_date` date NOT NULL,
  `active_streams` int DEFAULT '0',
  `total_streamers` int DEFAULT '0',
  `total_viewers` int DEFAULT '0',
  `peak_concurrent_viewers` int DEFAULT '0',
  `videos_uploaded` int DEFAULT '0',
  `videos_views` bigint DEFAULT '0',
  `watch_time_hours` decimal(20,2) DEFAULT '0.00',
  `average_view_duration_minutes` decimal(10,2) DEFAULT '0.00',
  `subscription_revenue` decimal(20,2) DEFAULT '0.00',
  `ads_revenue` decimal(20,2) DEFAULT '0.00',
  `tips_revenue` decimal(20,2) DEFAULT '0.00',
  `pay_per_view_revenue` decimal(20,2) DEFAULT '0.00',
  `top_streams` json DEFAULT NULL,
  `top_videos` json DEFAULT NULL,
  `top_creators` json DEFAULT NULL,
  `average_bitrate` int DEFAULT '0',
  `buffering_ratio` decimal(5,2) DEFAULT '0.00',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_date` (`metric_date`),
  KEY `idx_date` (`metric_date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: dashboard_transport
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 16:04:00 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	metric_date	date	NO	NULL		UNI		
3	rides_requested	int	YES	0				
4	rides_completed	int	YES	0				
5	rides_cancelled	int	YES	0				
6	active_ride_drivers	int	YES	0				
7	driver_earnings_total	decimal(20,2)	YES	0.00				
8	average_wait_time_minutes	decimal(10,2)	YES	0.00				
9	average_ride_duration_minutes	decimal(10,2)	YES	0.00				
10	carpool_rides	int	YES	0				
11	seats_shared	int	YES	0				
12	ride_revenue	decimal(20,2)	YES	0.00				
13	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_date	NON_UNIQUE	BTREE	metric_date	0
unique_date	UNIQUE	BTREE	metric_date	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `dashboard_transport` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `metric_date` date NOT NULL,
  `rides_requested` int DEFAULT '0',
  `rides_completed` int DEFAULT '0',
  `rides_cancelled` int DEFAULT '0',
  `active_ride_drivers` int DEFAULT '0',
  `driver_earnings_total` decimal(20,2) DEFAULT '0.00',
  `average_wait_time_minutes` decimal(10,2) DEFAULT '0.00',
  `average_ride_duration_minutes` decimal(10,2) DEFAULT '0.00',
  `carpool_rides` int DEFAULT '0',
  `seats_shared` int DEFAULT '0',
  `ride_revenue` decimal(20,2) DEFAULT '0.00',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_date` (`metric_date`),
  KEY `idx_date` (`metric_date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: data_collection_jobs
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 16:04:49 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	job_name	varchar(200)	NO	NULL			utf8mb4_unicode_ci	
3	job_type	varchar(100)	NO	NULL			utf8mb4_unicode_ci	
4	schedule_cron	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
5	query	text	NO	NULL			utf8mb4_unicode_ci	
6	target_table	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
7	aggregation_type	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
8	filters	json	YES	NULL				
9	status	enum('active','paused','running','failed')	YES	active		MUL	utf8mb4_unicode_ci	
10	last_run	timestamp	YES	NULL				
11	next_run	timestamp	YES	NULL		MUL		
12	execution_time_seconds	int	YES	NULL				
13	rows_processed	bigint	YES	NULL				
14	error_message	text	YES	NULL			utf8mb4_unicode_ci	
15	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_next_run	NON_UNIQUE	BTREE	next_run	0
idx_status	NON_UNIQUE	BTREE	status	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `data_collection_jobs` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `job_name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `job_type` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `schedule_cron` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `query` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `target_table` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `aggregation_type` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `filters` json DEFAULT NULL,
  `status` enum('active','paused','running','failed') COLLATE utf8mb4_unicode_ci DEFAULT 'active',
  `last_run` timestamp NULL DEFAULT NULL,
  `next_run` timestamp NULL DEFAULT NULL,
  `execution_time_seconds` int DEFAULT NULL,
  `rows_processed` bigint DEFAULT NULL,
  `error_message` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_status` (`status`),
  KEY `idx_next_run` (`next_run`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: data_exports
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:13:51 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	export_type	enum('gdpr','backup','migration','deletion')	NO	NULL			utf8mb4_unicode_ci	
4	status	enum('requested','processing','completed','failed','expired')	YES	requested		MUL	utf8mb4_unicode_ci	
5	file_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
6	file_size_mb	decimal(10,2)	YES	NULL				
7	expires_at	timestamp	YES	NULL				
8	requested_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
9	completed_at	timestamp	YES	NULL				

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_status	NON_UNIQUE	BTREE	status	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
data_exports_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `data_exports` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `export_type` enum('gdpr','backup','migration','deletion') COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` enum('requested','processing','completed','failed','expired') COLLATE utf8mb4_unicode_ci DEFAULT 'requested',
  `file_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `file_size_mb` decimal(10,2) DEFAULT NULL,
  `expires_at` timestamp NULL DEFAULT NULL,
  `requested_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `completed_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_status` (`status`),
  CONSTRAINT `data_exports_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: data_governance
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 16:03:29 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	data_category	varchar(100)	NO	NULL		MUL	utf8mb4_unicode_ci	
3	data_classification	enum('public','internal','confidential','restricted')	NO	NULL		MUL	utf8mb4_unicode_ci	
4	retention_period_days	int	NO	NULL				
5	encryption_required	tinyint(1)	YES	1				
6	access_controls	json	YES	NULL				
7	data_owners	json	YES	NULL				
8	processing_locations	json	YES	NULL				
9	third_party_sharing	json	YES	NULL				
10	deletion_policy	text	YES	NULL			utf8mb4_unicode_ci	
11	backup_policy	text	YES	NULL			utf8mb4_unicode_ci	
12	last_review_date	date	YES	NULL				
13	next_review_date	date	YES	NULL				
14	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_category	NON_UNIQUE	BTREE	data_category	0
idx_classification	NON_UNIQUE	BTREE	data_classification	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `data_governance` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `data_category` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `data_classification` enum('public','internal','confidential','restricted') COLLATE utf8mb4_unicode_ci NOT NULL,
  `retention_period_days` int NOT NULL,
  `encryption_required` tinyint(1) DEFAULT '1',
  `access_controls` json DEFAULT NULL,
  `data_owners` json DEFAULT NULL,
  `processing_locations` json DEFAULT NULL,
  `third_party_sharing` json DEFAULT NULL,
  `deletion_policy` text COLLATE utf8mb4_unicode_ci,
  `backup_policy` text COLLATE utf8mb4_unicode_ci,
  `last_review_date` date DEFAULT NULL,
  `next_review_date` date DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_category` (`data_category`),
  KEY `idx_classification` (`data_classification`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: data_quality_checks
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 16:04:49 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	check_name	varchar(200)	NO	NULL			utf8mb4_unicode_ci	
3	table_name	varchar(100)	NO	NULL		MUL	utf8mb4_unicode_ci	
4	column_name	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
5	check_type	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
6	check_query	text	NO	NULL			utf8mb4_unicode_ci	
7	expected_result	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
8	actual_result	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
9	passed	tinyint(1)	YES	0		MUL		
10	error_count	int	YES	0				
11	sample_errors	json	YES	NULL				
12	run_date	date	NO	NULL		MUL		
13	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_date	NON_UNIQUE	BTREE	run_date	0
idx_passed	NON_UNIQUE	BTREE	passed	0
idx_table	NON_UNIQUE	BTREE	table_name	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `data_quality_checks` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `check_name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `table_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `column_name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `check_type` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `check_query` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `expected_result` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `actual_result` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `passed` tinyint(1) DEFAULT '0',
  `error_count` int DEFAULT '0',
  `sample_errors` json DEFAULT NULL,
  `run_date` date NOT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_table` (`table_name`),
  KEY `idx_date` (`run_date`),
  KEY `idx_passed` (`passed`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: data_transformations
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:53:41 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	transformation_name	varchar(200)	NO	NULL			utf8mb4_unicode_ci	
3	source_platform	varchar(100)	YES	NULL		MUL	utf8mb4_unicode_ci	
4	target_platform	varchar(100)	YES	NULL		MUL	utf8mb4_unicode_ci	
5	entity_type	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
6	mapping_rules	json	NO	NULL				
7	validation_rules	json	YES	NULL				
8	default_values	json	YES	NULL				
9	is_active	tinyint(1)	YES	1				
10	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_source	NON_UNIQUE	BTREE	source_platform	0
idx_target	NON_UNIQUE	BTREE	target_platform	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `data_transformations` (
  `id` int NOT NULL AUTO_INCREMENT,
  `transformation_name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `source_platform` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `target_platform` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `entity_type` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `mapping_rules` json NOT NULL,
  `validation_rules` json DEFAULT NULL,
  `default_values` json DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT '1',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_source` (`source_platform`),
  KEY `idx_target` (`target_platform`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: data_warehouse
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 16:04:49 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	dimension_date	date	NO	NULL		MUL		
3	dimension_hour	int	YES	NULL				
4	dimension_platform	varchar(100)	YES	NULL		MUL	utf8mb4_unicode_ci	
5	dimension_country	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
6	dimension_device	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
7	dimension_user_segment	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
8	dimension_product_category	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
9	fact_type	varchar(100)	NO	NULL		MUL	utf8mb4_unicode_ci	
10	fact_value	decimal(30,4)	NO	NULL				
11	fact_count	bigint	YES	0				
12	fact_metadata	json	YES	NULL				
13	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_date	NON_UNIQUE	BTREE	dimension_date	0
idx_platform	NON_UNIQUE	BTREE	dimension_platform	0
idx_type	NON_UNIQUE	BTREE	fact_type	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `data_warehouse` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `dimension_date` date NOT NULL,
  `dimension_hour` int DEFAULT NULL,
  `dimension_platform` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `dimension_country` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `dimension_device` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `dimension_user_segment` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `dimension_product_category` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `fact_type` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `fact_value` decimal(30,4) NOT NULL,
  `fact_count` bigint DEFAULT '0',
  `fact_metadata` json DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_date` (`dimension_date`),
  KEY `idx_type` (`fact_type`),
  KEY `idx_platform` (`dimension_platform`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: date_plans
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:12:06 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	match_id	int	NO	NULL		MUL		
3	proposed_by	int	NO	NULL		MUL		
4	date_type	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
5	venue_name	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
6	venue_address	text	YES	NULL			utf8mb4_unicode_ci	
7	venue_maps_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
8	scheduled_date	timestamp	NO	NULL		MUL		
9	duration_hours	decimal(3,1)	YES	2.0				
10	budget_estimate	decimal(10,2)	YES	NULL				
11	activities	json	YES	NULL				
12	special_requirements	text	YES	NULL			utf8mb4_unicode_ci	
13	status	enum('proposed','accepted','modified','confirmed','completed','cancelled')	YES	proposed		MUL	utf8mb4_unicode_ci	
14	rating_user1	int	YES	NULL				
15	rating_user2	int	YES	NULL				
16	review_user1	text	YES	NULL			utf8mb4_unicode_ci	
17	review_user2	text	YES	NULL			utf8mb4_unicode_ci	
18	photos	json	YES	NULL				
19	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_date	NON_UNIQUE	BTREE	scheduled_date	0
idx_match	NON_UNIQUE	BTREE	match_id	0
idx_status	NON_UNIQUE	BTREE	status	0
proposed_by	NON_UNIQUE	BTREE	proposed_by	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
date_plans_ibfk_1	match_id	dating_matches	id	NO ACTION	NO ACTION
date_plans_ibfk_2	proposed_by	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `date_plans` (
  `id` int NOT NULL AUTO_INCREMENT,
  `match_id` int NOT NULL,
  `proposed_by` int NOT NULL,
  `date_type` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `venue_name` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `venue_address` text COLLATE utf8mb4_unicode_ci,
  `venue_maps_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `scheduled_date` timestamp NOT NULL,
  `duration_hours` decimal(3,1) DEFAULT '2.0',
  `budget_estimate` decimal(10,2) DEFAULT NULL,
  `activities` json DEFAULT NULL,
  `special_requirements` text COLLATE utf8mb4_unicode_ci,
  `status` enum('proposed','accepted','modified','confirmed','completed','cancelled') COLLATE utf8mb4_unicode_ci DEFAULT 'proposed',
  `rating_user1` int DEFAULT NULL,
  `rating_user2` int DEFAULT NULL,
  `review_user1` text COLLATE utf8mb4_unicode_ci,
  `review_user2` text COLLATE utf8mb4_unicode_ci,
  `photos` json DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_match` (`match_id`),
  KEY `idx_date` (`scheduled_date`),
  KEY `idx_status` (`status`),
  KEY `proposed_by` (`proposed_by`),
  CONSTRAINT `date_plans_ibfk_1` FOREIGN KEY (`match_id`) REFERENCES `dating_matches` (`id`),
  CONSTRAINT `date_plans_ibfk_2` FOREIGN KEY (`proposed_by`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: dating_matches
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.08 | TOTAL_MB: 0.09 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:12:06 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user1_id	int	NO	NULL		MUL		
3	user2_id	int	NO	NULL		MUL		
4	compatibility_score	decimal(5,2)	YES	0.00		MUL		
5	ai_match_reasons	json	YES	NULL				
6	mutual_interests	json	YES	NULL				
7	match_type	enum('swipe','algorithm','boost','super_like','recommended')	YES	swipe			utf8mb4_unicode_ci	
8	user1_liked	tinyint(1)	YES	0				
9	user2_liked	tinyint(1)	YES	0				
10	user1_super_liked	tinyint(1)	YES	0				
11	user2_super_liked	tinyint(1)	YES	0				
12	is_matched	tinyint(1)	YES	0		MUL		
13	matched_at	timestamp	YES	NULL				
14	first_message_sent	timestamp	YES	NULL				
15	last_interaction	timestamp	YES	NULL				
16	conversation_quality_score	decimal(3,2)	YES	NULL				
17	unmatch_reason	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
18	unmatched_at	timestamp	YES	NULL				
19	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_compatibility	NON_UNIQUE	BTREE	compatibility_score	0
idx_matched	NON_UNIQUE	BTREE	is_matched	0
idx_users	NON_UNIQUE	BTREE	user1_id, user2_id	0
unique_match	UNIQUE	BTREE	user1_id, user2_id	0
user2_id	NON_UNIQUE	BTREE	user2_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
dating_matches_ibfk_1	user1_id	users	id	NO ACTION	NO ACTION
dating_matches_ibfk_2	user2_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `dating_matches` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user1_id` int NOT NULL,
  `user2_id` int NOT NULL,
  `compatibility_score` decimal(5,2) DEFAULT '0.00',
  `ai_match_reasons` json DEFAULT NULL,
  `mutual_interests` json DEFAULT NULL,
  `match_type` enum('swipe','algorithm','boost','super_like','recommended') COLLATE utf8mb4_unicode_ci DEFAULT 'swipe',
  `user1_liked` tinyint(1) DEFAULT '0',
  `user2_liked` tinyint(1) DEFAULT '0',
  `user1_super_liked` tinyint(1) DEFAULT '0',
  `user2_super_liked` tinyint(1) DEFAULT '0',
  `is_matched` tinyint(1) DEFAULT '0',
  `matched_at` timestamp NULL DEFAULT NULL,
  `first_message_sent` timestamp NULL DEFAULT NULL,
  `last_interaction` timestamp NULL DEFAULT NULL,
  `conversation_quality_score` decimal(3,2) DEFAULT NULL,
  `unmatch_reason` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `unmatched_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_match` (`user1_id`,`user2_id`),
  KEY `idx_users` (`user1_id`,`user2_id`),
  KEY `idx_matched` (`is_matched`),
  KEY `idx_compatibility` (`compatibility_score`),
  KEY `user2_id` (`user2_id`),
  CONSTRAINT `dating_matches_ibfk_1` FOREIGN KEY (`user1_id`) REFERENCES `users` (`id`),
  CONSTRAINT `dating_matches_ibfk_2` FOREIGN KEY (`user2_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: dating_profiles
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:12:06 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		UNI		
3	looking_for	enum('relationship','casual','friendship','marriage','unsure')	YES	relationship		MUL	utf8mb4_unicode_ci	
4	orientation	enum('straight','gay','lesbian','bisexual','pansexual','other')	YES	straight		MUL	utf8mb4_unicode_ci	
5	height_cm	int	YES	NULL				
6	body_type	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
7	ethnicity	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
8	religion	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
9	education_level	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
10	occupation	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
11	income_range	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
12	smoking	enum('never','occasionally','regularly','quitting')	YES	never			utf8mb4_unicode_ci	
13	drinking	enum('never','socially','occasionally','regularly')	YES	socially			utf8mb4_unicode_ci	
14	has_children	tinyint(1)	YES	0				
15	wants_children	enum('yes','no','maybe','unsure')	YES	unsure			utf8mb4_unicode_ci	
16	pets	json	YES	NULL				
17	languages_spoken	json	YES	NULL				
18	personality_traits	json	YES	NULL				
19	interests_detailed	json	YES	NULL				
20	ideal_date	text	YES	NULL			utf8mb4_unicode_ci	
21	love_language	enum('words','acts','gifts','time','touch')	YES	words			utf8mb4_unicode_ci	
22	zodiac_sign	varchar(20)	YES	NULL			utf8mb4_unicode_ci	
23	political_views	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
24	lifestyle_habits	json	YES	NULL				
25	deal_breakers	json	YES	NULL				
26	verification_video_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
27	is_verified	tinyint(1)	YES	0				
28	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_looking	NON_UNIQUE	BTREE	looking_for	0
idx_orientation	NON_UNIQUE	BTREE	orientation	0
idx_user	NON_UNIQUE	BTREE	user_id	0
user_id	UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
dating_profiles_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `dating_profiles` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `looking_for` enum('relationship','casual','friendship','marriage','unsure') COLLATE utf8mb4_unicode_ci DEFAULT 'relationship',
  `orientation` enum('straight','gay','lesbian','bisexual','pansexual','other') COLLATE utf8mb4_unicode_ci DEFAULT 'straight',
  `height_cm` int DEFAULT NULL,
  `body_type` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ethnicity` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `religion` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `education_level` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `occupation` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `income_range` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `smoking` enum('never','occasionally','regularly','quitting') COLLATE utf8mb4_unicode_ci DEFAULT 'never',
  `drinking` enum('never','socially','occasionally','regularly') COLLATE utf8mb4_unicode_ci DEFAULT 'socially',
  `has_children` tinyint(1) DEFAULT '0',
  `wants_children` enum('yes','no','maybe','unsure') COLLATE utf8mb4_unicode_ci DEFAULT 'unsure',
  `pets` json DEFAULT NULL,
  `languages_spoken` json DEFAULT NULL,
  `personality_traits` json DEFAULT NULL,
  `interests_detailed` json DEFAULT NULL,
  `ideal_date` text COLLATE utf8mb4_unicode_ci,
  `love_language` enum('words','acts','gifts','time','touch') COLLATE utf8mb4_unicode_ci DEFAULT 'words',
  `zodiac_sign` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `political_views` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `lifestyle_habits` json DEFAULT NULL,
  `deal_breakers` json DEFAULT NULL,
  `verification_video_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_verified` tinyint(1) DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_id` (`user_id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_looking` (`looking_for`),
  KEY `idx_orientation` (`orientation`),
  CONSTRAINT `dating_profiles_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: delivery_orders
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:13:35 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	customer_id	int	NO	NULL		MUL		
3	restaurant_id	int	YES	NULL				
4	driver_id	int	YES	NULL		MUL		
5	order_type	enum('food','grocery','package','pharmacy','other')	YES	food			utf8mb4_unicode_ci	
6	items	json	NO	NULL				
7	pickup_location	json	YES	NULL				
8	pickup_address	text	YES	NULL			utf8mb4_unicode_ci	
9	delivery_location	json	NO	NULL				
10	delivery_address	text	NO	NULL			utf8mb4_unicode_ci	
11	delivery_instructions	text	YES	NULL			utf8mb4_unicode_ci	
12	distance_km	decimal(10,2)	YES	NULL				
13	estimated_time_minutes	int	YES	NULL				
14	food_preparation_time	int	YES	NULL				
15	subtotal	decimal(10,2)	NO	NULL				
16	delivery_fee	decimal(10,2)	NO	NULL				
17	service_fee	decimal(10,2)	YES	0.00				
18	tip_amount	decimal(10,2)	YES	0.00				
19	total_amount	decimal(10,2)	NO	NULL				
20	payment_method	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
21	payment_status	enum('pending','paid','failed','refunded')	YES	pending			utf8mb4_unicode_ci	
22	order_status	enum('placed','confirmed','preparing','ready','picked_up','delivering','delivered','cancelled')	YES	placed		MUL	utf8mb4_unicode_ci	
23	scheduled_delivery	timestamp	YES	NULL				
24	driver_location	json	YES	NULL				
25	rating_food	int	YES	NULL				
26	rating_delivery	int	YES	NULL				
27	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
28	delivered_at	timestamp	YES	NULL				

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_customer	NON_UNIQUE	BTREE	customer_id	0
idx_driver	NON_UNIQUE	BTREE	driver_id	0
idx_status	NON_UNIQUE	BTREE	order_status	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
delivery_orders_ibfk_1	customer_id	users	id	NO ACTION	NO ACTION
delivery_orders_ibfk_2	driver_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `delivery_orders` (
  `id` int NOT NULL AUTO_INCREMENT,
  `customer_id` int NOT NULL,
  `restaurant_id` int DEFAULT NULL,
  `driver_id` int DEFAULT NULL,
  `order_type` enum('food','grocery','package','pharmacy','other') COLLATE utf8mb4_unicode_ci DEFAULT 'food',
  `items` json NOT NULL,
  `pickup_location` json DEFAULT NULL,
  `pickup_address` text COLLATE utf8mb4_unicode_ci,
  `delivery_location` json NOT NULL,
  `delivery_address` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `delivery_instructions` text COLLATE utf8mb4_unicode_ci,
  `distance_km` decimal(10,2) DEFAULT NULL,
  `estimated_time_minutes` int DEFAULT NULL,
  `food_preparation_time` int DEFAULT NULL,
  `subtotal` decimal(10,2) NOT NULL,
  `delivery_fee` decimal(10,2) NOT NULL,
  `service_fee` decimal(10,2) DEFAULT '0.00',
  `tip_amount` decimal(10,2) DEFAULT '0.00',
  `total_amount` decimal(10,2) NOT NULL,
  `payment_method` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `payment_status` enum('pending','paid','failed','refunded') COLLATE utf8mb4_unicode_ci DEFAULT 'pending',
  `order_status` enum('placed','confirmed','preparing','ready','picked_up','delivering','delivered','cancelled') COLLATE utf8mb4_unicode_ci DEFAULT 'placed',
  `scheduled_delivery` timestamp NULL DEFAULT NULL,
  `driver_location` json DEFAULT NULL,
  `rating_food` int DEFAULT NULL,
  `rating_delivery` int DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `delivered_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_customer` (`customer_id`),
  KEY `idx_driver` (`driver_id`),
  KEY `idx_status` (`order_status`),
  CONSTRAINT `delivery_orders_ibfk_1` FOREIGN KEY (`customer_id`) REFERENCES `users` (`id`),
  CONSTRAINT `delivery_orders_ibfk_2` FOREIGN KEY (`driver_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: delivery_routes
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:53:00 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	driver_id	int	NO	NULL		MUL		
3	route_date	date	NO	NULL		MUL		
4	vehicle_id	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
5	start_location	json	YES	NULL				
6	end_location	json	YES	NULL				
7	stops	json	NO	NULL				
8	total_distance_km	decimal(10,2)	YES	NULL				
9	estimated_duration_minutes	int	YES	NULL				
10	actual_duration_minutes	int	YES	NULL				
11	packages_delivered	int	YES	0				
12	packages_attempted	int	YES	0				
13	fuel_cost	decimal(10,2)	YES	NULL				
14	status	enum('planned','in_progress','completed','cancelled')	YES	planned		MUL	utf8mb4_unicode_ci	
15	started_at	timestamp	YES	NULL				
16	completed_at	timestamp	YES	NULL				
17	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_date	NON_UNIQUE	BTREE	route_date	0
idx_driver	NON_UNIQUE	BTREE	driver_id	0
idx_status	NON_UNIQUE	BTREE	status	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
delivery_routes_ibfk_1	driver_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `delivery_routes` (
  `id` int NOT NULL AUTO_INCREMENT,
  `driver_id` int NOT NULL,
  `route_date` date NOT NULL,
  `vehicle_id` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `start_location` json DEFAULT NULL,
  `end_location` json DEFAULT NULL,
  `stops` json NOT NULL,
  `total_distance_km` decimal(10,2) DEFAULT NULL,
  `estimated_duration_minutes` int DEFAULT NULL,
  `actual_duration_minutes` int DEFAULT NULL,
  `packages_delivered` int DEFAULT '0',
  `packages_attempted` int DEFAULT '0',
  `fuel_cost` decimal(10,2) DEFAULT NULL,
  `status` enum('planned','in_progress','completed','cancelled') COLLATE utf8mb4_unicode_ci DEFAULT 'planned',
  `started_at` timestamp NULL DEFAULT NULL,
  `completed_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_driver` (`driver_id`),
  KEY `idx_date` (`route_date`),
  KEY `idx_status` (`status`),
  CONSTRAINT `delivery_routes_ibfk_1` FOREIGN KEY (`driver_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: discount_codes
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:52:35 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	store_id	int	NO	NULL		MUL		
3	code	varchar(50)	NO	NULL		MUL	utf8mb4_unicode_ci	
4	description	text	YES	NULL			utf8mb4_unicode_ci	
5	discount_type	enum('percentage','fixed_amount','free_shipping','buy_x_get_y')	NO	NULL			utf8mb4_unicode_ci	
6	discount_value	decimal(10,2)	NO	NULL				
7	minimum_purchase	decimal(10,2)	YES	NULL				
8	applies_to	enum('all','specific_products','specific_collections','specific_customers')	YES	all			utf8mb4_unicode_ci	
9	applies_to_ids	json	YES	NULL				
10	usage_limit	int	YES	NULL				
11	usage_limit_per_customer	int	YES	1				
12	times_used	int	YES	0				
13	start_date	timestamp	YES	NULL				
14	end_date	timestamp	YES	NULL				
15	is_active	tinyint(1)	YES	1		MUL		
16	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_active	NON_UNIQUE	BTREE	is_active	0
idx_code	NON_UNIQUE	BTREE	code	0
idx_store	NON_UNIQUE	BTREE	store_id	0
unique_code	UNIQUE	BTREE	store_id, code	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
discount_codes_ibfk_1	store_id	online_stores	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `discount_codes` (
  `id` int NOT NULL AUTO_INCREMENT,
  `store_id` int NOT NULL,
  `code` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `discount_type` enum('percentage','fixed_amount','free_shipping','buy_x_get_y') COLLATE utf8mb4_unicode_ci NOT NULL,
  `discount_value` decimal(10,2) NOT NULL,
  `minimum_purchase` decimal(10,2) DEFAULT NULL,
  `applies_to` enum('all','specific_products','specific_collections','specific_customers') COLLATE utf8mb4_unicode_ci DEFAULT 'all',
  `applies_to_ids` json DEFAULT NULL,
  `usage_limit` int DEFAULT NULL,
  `usage_limit_per_customer` int DEFAULT '1',
  `times_used` int DEFAULT '0',
  `start_date` timestamp NULL DEFAULT NULL,
  `end_date` timestamp NULL DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT '1',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_code` (`store_id`,`code`),
  KEY `idx_store` (`store_id`),
  KEY `idx_code` (`code`),
  KEY `idx_active` (`is_active`),
  CONSTRAINT `discount_codes_ibfk_1` FOREIGN KEY (`store_id`) REFERENCES `online_stores` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: dispute_cases
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:52:02 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	case_type	enum('item_not_received','not_as_described','return_request','cancelled_transaction','other')	NO	NULL			utf8mb4_unicode_ci	
3	transaction_id	bigint	NO	NULL				
4	buyer_id	int	NO	NULL		MUL		
5	seller_id	int	NO	NULL		MUL		
6	reason	text	NO	NULL			utf8mb4_unicode_ci	
7	evidence	json	YES	NULL				
8	messages	json	YES	NULL				
9	escalated_to_platform	tinyint(1)	YES	0				
10	status	enum('open','waiting_buyer','waiting_seller','escalated','resolved','closed')	YES	open		MUL	utf8mb4_unicode_ci	
11	resolution	text	YES	NULL			utf8mb4_unicode_ci	
12	resolution_type	enum('refund_full','refund_partial','return_and_refund','replacement','no_action','seller_wins','buyer_wins')	YES	NULL			utf8mb4_unicode_ci	
13	refund_amount	decimal(12,2)	YES	NULL				
14	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
15	resolved_at	timestamp	YES	NULL				

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_buyer	NON_UNIQUE	BTREE	buyer_id	0
idx_seller	NON_UNIQUE	BTREE	seller_id	0
idx_status	NON_UNIQUE	BTREE	status	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
dispute_cases_ibfk_1	buyer_id	users	id	NO ACTION	NO ACTION
dispute_cases_ibfk_2	seller_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `dispute_cases` (
  `id` int NOT NULL AUTO_INCREMENT,
  `case_type` enum('item_not_received','not_as_described','return_request','cancelled_transaction','other') COLLATE utf8mb4_unicode_ci NOT NULL,
  `transaction_id` bigint NOT NULL,
  `buyer_id` int NOT NULL,
  `seller_id` int NOT NULL,
  `reason` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `evidence` json DEFAULT NULL,
  `messages` json DEFAULT NULL,
  `escalated_to_platform` tinyint(1) DEFAULT '0',
  `status` enum('open','waiting_buyer','waiting_seller','escalated','resolved','closed') COLLATE utf8mb4_unicode_ci DEFAULT 'open',
  `resolution` text COLLATE utf8mb4_unicode_ci,
  `resolution_type` enum('refund_full','refund_partial','return_and_refund','replacement','no_action','seller_wins','buyer_wins') COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `refund_amount` decimal(12,2) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `resolved_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_buyer` (`buyer_id`),
  KEY `idx_seller` (`seller_id`),
  KEY `idx_status` (`status`),
  CONSTRAINT `dispute_cases_ibfk_1` FOREIGN KEY (`buyer_id`) REFERENCES `users` (`id`),
  CONSTRAINT `dispute_cases_ibfk_2` FOREIGN KEY (`seller_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: download_queue
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:30:09 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	content_id	int	NO	NULL		MUL		
4	episode_id	int	YES	NULL		MUL		
5	quality	varchar(20)	YES	medium			utf8mb4_unicode_ci	
6	file_size	bigint	YES	NULL				
7	download_progress	decimal(5,2)	YES	0.00				
8	download_speed_mbps	decimal(10,2)	YES	NULL				
9	device_id	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
10	storage_path	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
11	status	enum('queued','downloading','paused','completed','failed')	YES	queued		MUL	utf8mb4_unicode_ci	
12	error_message	text	YES	NULL			utf8mb4_unicode_ci	
13	expires_at	timestamp	YES	NULL				
14	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
15	completed_at	timestamp	YES	NULL				

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
content_id	NON_UNIQUE	BTREE	content_id	0
episode_id	NON_UNIQUE	BTREE	episode_id	0
idx_status	NON_UNIQUE	BTREE	status	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
download_queue_ibfk_1	user_id	users	id	NO ACTION	NO ACTION
download_queue_ibfk_2	content_id	media_content	id	NO ACTION	NO ACTION
download_queue_ibfk_3	episode_id	media_episodes	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `download_queue` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `content_id` int NOT NULL,
  `episode_id` int DEFAULT NULL,
  `quality` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT 'medium',
  `file_size` bigint DEFAULT NULL,
  `download_progress` decimal(5,2) DEFAULT '0.00',
  `download_speed_mbps` decimal(10,2) DEFAULT NULL,
  `device_id` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `storage_path` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` enum('queued','downloading','paused','completed','failed') COLLATE utf8mb4_unicode_ci DEFAULT 'queued',
  `error_message` text COLLATE utf8mb4_unicode_ci,
  `expires_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `completed_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_status` (`status`),
  KEY `content_id` (`content_id`),
  KEY `episode_id` (`episode_id`),
  CONSTRAINT `download_queue_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
  CONSTRAINT `download_queue_ibfk_2` FOREIGN KEY (`content_id`) REFERENCES `media_content` (`id`),
  CONSTRAINT `download_queue_ibfk_3` FOREIGN KEY (`episode_id`) REFERENCES `media_episodes` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: driver_dashboard
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 16:04:26 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	driver_id	int	NO	NULL		UNI		
3	rides_today	int	YES	0				
4	earnings_today	decimal(12,2)	YES	0.00				
5	hours_online_today	decimal(5,2)	YES	0.00				
6	acceptance_rate	decimal(5,2)	YES	0.00				
7	completion_rate	decimal(5,2)	YES	0.00				
8	driver_rating	decimal(3,2)	YES	0.00				
9	weekly_earnings	decimal(12,2)	YES	0.00				
10	pending_payment	decimal(12,2)	YES	0.00				
11	tips_week	decimal(12,2)	YES	0.00				
12	current_status	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
13	next_scheduled_ride	timestamp	YES	NULL				
14	last_updated	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_driver	NON_UNIQUE	BTREE	driver_id	0
unique_driver	UNIQUE	BTREE	driver_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
driver_dashboard_ibfk_1	driver_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `driver_dashboard` (
  `id` int NOT NULL AUTO_INCREMENT,
  `driver_id` int NOT NULL,
  `rides_today` int DEFAULT '0',
  `earnings_today` decimal(12,2) DEFAULT '0.00',
  `hours_online_today` decimal(5,2) DEFAULT '0.00',
  `acceptance_rate` decimal(5,2) DEFAULT '0.00',
  `completion_rate` decimal(5,2) DEFAULT '0.00',
  `driver_rating` decimal(3,2) DEFAULT '0.00',
  `weekly_earnings` decimal(12,2) DEFAULT '0.00',
  `pending_payment` decimal(12,2) DEFAULT '0.00',
  `tips_week` decimal(12,2) DEFAULT '0.00',
  `current_status` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `next_scheduled_ride` timestamp NULL DEFAULT NULL,
  `last_updated` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_driver` (`driver_id`),
  KEY `idx_driver` (`driver_id`),
  CONSTRAINT `driver_dashboard_ibfk_1` FOREIGN KEY (`driver_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: drivers
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:13:35 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		UNI		
3	license_number	varchar(100)	NO	NULL			utf8mb4_unicode_ci	
4	license_expiry	date	NO	NULL				
5	vehicle_make	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
6	vehicle_model	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
7	vehicle_year	int	YES	NULL				
8	vehicle_color	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
9	vehicle_plate	varchar(20)	NO	NULL			utf8mb4_unicode_ci	
10	vehicle_photos	json	YES	NULL				
11	insurance_policy	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
12	insurance_expiry	date	YES	NULL				
13	bank_account	json	YES	NULL				
14	is_verified	tinyint(1)	YES	0				
15	is_active	tinyint(1)	YES	0				
16	is_available	tinyint(1)	YES	0		MUL		
17	current_location	json	YES	NULL				
18	total_rides	int	YES	0				
19	total_earnings	decimal(15,2)	YES	0.00				
20	average_rating	decimal(3,2)	YES	0.00				
21	acceptance_rate	decimal(5,2)	YES	0.00				
22	cancellation_rate	decimal(5,2)	YES	0.00				
23	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_available	NON_UNIQUE	BTREE	is_available	0
idx_user	NON_UNIQUE	BTREE	user_id	0
user_id	UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
drivers_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `drivers` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `license_number` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `license_expiry` date NOT NULL,
  `vehicle_make` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `vehicle_model` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `vehicle_year` int DEFAULT NULL,
  `vehicle_color` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `vehicle_plate` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `vehicle_photos` json DEFAULT NULL,
  `insurance_policy` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `insurance_expiry` date DEFAULT NULL,
  `bank_account` json DEFAULT NULL,
  `is_verified` tinyint(1) DEFAULT '0',
  `is_active` tinyint(1) DEFAULT '0',
  `is_available` tinyint(1) DEFAULT '0',
  `current_location` json DEFAULT NULL,
  `total_rides` int DEFAULT '0',
  `total_earnings` decimal(15,2) DEFAULT '0.00',
  `average_rating` decimal(3,2) DEFAULT '0.00',
  `acceptance_rate` decimal(5,2) DEFAULT '0.00',
  `cancellation_rate` decimal(5,2) DEFAULT '0.00',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_id` (`user_id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_available` (`is_available`),
  CONSTRAINT `drivers_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: dropship_orders
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:53:00 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	order_id	bigint	NO	NULL		MUL		
3	supplier_id	int	NO	NULL		MUL		
4	dropship_order_number	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
5	items	json	NO	NULL				
6	supplier_cost	decimal(12,2)	NO	NULL				
7	markup_amount	decimal(10,2)	YES	NULL				
8	status	enum('pending','submitted','processing','shipped','delivered','cancelled')	YES	pending		MUL	utf8mb4_unicode_ci	
9	supplier_tracking	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
10	submitted_at	timestamp	YES	NULL				
11	shipped_at	timestamp	YES	NULL				
12	delivered_at	timestamp	YES	NULL				
13	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_order	NON_UNIQUE	BTREE	order_id	0
idx_status	NON_UNIQUE	BTREE	status	0
idx_supplier	NON_UNIQUE	BTREE	supplier_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
dropship_orders_ibfk_1	order_id	purchase_orders	id	NO ACTION	NO ACTION
dropship_orders_ibfk_2	supplier_id	supplier_management	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `dropship_orders` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `order_id` bigint NOT NULL,
  `supplier_id` int NOT NULL,
  `dropship_order_number` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `items` json NOT NULL,
  `supplier_cost` decimal(12,2) NOT NULL,
  `markup_amount` decimal(10,2) DEFAULT NULL,
  `status` enum('pending','submitted','processing','shipped','delivered','cancelled') COLLATE utf8mb4_unicode_ci DEFAULT 'pending',
  `supplier_tracking` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `submitted_at` timestamp NULL DEFAULT NULL,
  `shipped_at` timestamp NULL DEFAULT NULL,
  `delivered_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_order` (`order_id`),
  KEY `idx_supplier` (`supplier_id`),
  KEY `idx_status` (`status`),
  CONSTRAINT `dropship_orders_ibfk_1` FOREIGN KEY (`order_id`) REFERENCES `purchase_orders` (`id`),
  CONSTRAINT `dropship_orders_ibfk_2` FOREIGN KEY (`supplier_id`) REFERENCES `supplier_management` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: email_campaigns
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:52:35 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	store_id	int	NO	NULL		MUL		
3	campaign_name	varchar(200)	NO	NULL			utf8mb4_unicode_ci	
4	campaign_type	enum('newsletter','promotional','abandoned_cart','welcome','reengagement','transactional')	NO	NULL		MUL	utf8mb4_unicode_ci	
5	subject_line	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
6	preview_text	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
7	email_content	text	YES	NULL			utf8mb4_unicode_ci	
8	template_id	int	YES	NULL				
9	segment_criteria	json	YES	NULL				
10	recipient_count	int	YES	0				
11	sent_count	int	YES	0				
12	opened_count	int	YES	0				
13	clicked_count	int	YES	0				
14	unsubscribed_count	int	YES	0				
15	conversion_count	int	YES	0				
16	revenue_generated	decimal(12,2)	YES	0.00				
17	status	enum('draft','scheduled','sending','sent','cancelled')	YES	draft		MUL	utf8mb4_unicode_ci	
18	scheduled_send	timestamp	YES	NULL				
19	sent_at	timestamp	YES	NULL				
20	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_status	NON_UNIQUE	BTREE	status	0
idx_store	NON_UNIQUE	BTREE	store_id	0
idx_type	NON_UNIQUE	BTREE	campaign_type	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
email_campaigns_ibfk_1	store_id	online_stores	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `email_campaigns` (
  `id` int NOT NULL AUTO_INCREMENT,
  `store_id` int NOT NULL,
  `campaign_name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `campaign_type` enum('newsletter','promotional','abandoned_cart','welcome','reengagement','transactional') COLLATE utf8mb4_unicode_ci NOT NULL,
  `subject_line` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `preview_text` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email_content` text COLLATE utf8mb4_unicode_ci,
  `template_id` int DEFAULT NULL,
  `segment_criteria` json DEFAULT NULL,
  `recipient_count` int DEFAULT '0',
  `sent_count` int DEFAULT '0',
  `opened_count` int DEFAULT '0',
  `clicked_count` int DEFAULT '0',
  `unsubscribed_count` int DEFAULT '0',
  `conversion_count` int DEFAULT '0',
  `revenue_generated` decimal(12,2) DEFAULT '0.00',
  `status` enum('draft','scheduled','sending','sent','cancelled') COLLATE utf8mb4_unicode_ci DEFAULT 'draft',
  `scheduled_send` timestamp NULL DEFAULT NULL,
  `sent_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_store` (`store_id`),
  KEY `idx_type` (`campaign_type`),
  KEY `idx_status` (`status`),
  CONSTRAINT `email_campaigns_ibfk_1` FOREIGN KEY (`store_id`) REFERENCES `online_stores` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: emergency_contacts
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.02 | TOTAL_MB: 0.03 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:13:51 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	contact_name	varchar(100)	NO	NULL			utf8mb4_unicode_ci	
4	relationship	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
5	phone_primary	varchar(20)	NO	NULL			utf8mb4_unicode_ci	
6	phone_secondary	varchar(20)	YES	NULL			utf8mb4_unicode_ci	
7	email	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
8	address	text	YES	NULL			utf8mb4_unicode_ci	
9	notes	text	YES	NULL			utf8mb4_unicode_ci	
10	is_primary	tinyint(1)	YES	0				
11	notify_on_emergency	tinyint(1)	YES	1				
12	notify_on_trip	tinyint(1)	YES	0				
13	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
emergency_contacts_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `emergency_contacts` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `contact_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `relationship` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone_primary` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `phone_secondary` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address` text COLLATE utf8mb4_unicode_ci,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `is_primary` tinyint(1) DEFAULT '0',
  `notify_on_emergency` tinyint(1) DEFAULT '1',
  `notify_on_trip` tinyint(1) DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  CONSTRAINT `emergency_contacts_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: enterprise_dashboard
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 16:04:26 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	enterprise_id	int	NO	NULL		UNI		
3	team_members	int	YES	0				
4	active_users_today	int	YES	0				
5	corporate_sales_month	decimal(20,2)	YES	0.00				
6	pending_invoices	int	YES	0				
7	api_calls_month	bigint	YES	0				
8	storage_used_tb	decimal(10,2)	YES	0.00				
9	monthly_invoice_amount	decimal(20,2)	YES	0.00				
10	credit_balance	decimal(20,2)	YES	0.00				
11	uptime_percentage	decimal(5,2)	YES	99.90				
12	support_tickets_open	int	YES	0				
13	last_updated	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_enterprise	NON_UNIQUE	BTREE	enterprise_id	0
unique_enterprise	UNIQUE	BTREE	enterprise_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
enterprise_dashboard_ibfk_1	enterprise_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `enterprise_dashboard` (
  `id` int NOT NULL AUTO_INCREMENT,
  `enterprise_id` int NOT NULL,
  `team_members` int DEFAULT '0',
  `active_users_today` int DEFAULT '0',
  `corporate_sales_month` decimal(20,2) DEFAULT '0.00',
  `pending_invoices` int DEFAULT '0',
  `api_calls_month` bigint DEFAULT '0',
  `storage_used_tb` decimal(10,2) DEFAULT '0.00',
  `monthly_invoice_amount` decimal(20,2) DEFAULT '0.00',
  `credit_balance` decimal(20,2) DEFAULT '0.00',
  `uptime_percentage` decimal(5,2) DEFAULT '99.90',
  `support_tickets_open` int DEFAULT '0',
  `last_updated` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_enterprise` (`enterprise_id`),
  KEY `idx_enterprise` (`enterprise_id`),
  CONSTRAINT `enterprise_dashboard_ibfk_1` FOREIGN KEY (`enterprise_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: event_attendees
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.08 | TOTAL_MB: 0.09 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:39:42 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	event_id	int	NO	NULL		MUL		
3	user_id	int	NO	NULL		MUL		
4	status	enum('interested','going','maybe','not_going','went')	YES	interested		MUL	utf8mb4_unicode_ci	
5	invited_by	int	YES	NULL		MUL		
6	checked_in	tinyint(1)	YES	0				
7	check_in_time	timestamp	YES	NULL				
8	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_event	NON_UNIQUE	BTREE	event_id	0
idx_status	NON_UNIQUE	BTREE	status	0
idx_user	NON_UNIQUE	BTREE	user_id	0
invited_by	NON_UNIQUE	BTREE	invited_by	0
unique_attendee	UNIQUE	BTREE	event_id, user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
event_attendees_ibfk_1	event_id	events	id	NO ACTION	NO ACTION
event_attendees_ibfk_2	user_id	users	id	NO ACTION	NO ACTION
event_attendees_ibfk_3	invited_by	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `event_attendees` (
  `id` int NOT NULL AUTO_INCREMENT,
  `event_id` int NOT NULL,
  `user_id` int NOT NULL,
  `status` enum('interested','going','maybe','not_going','went') COLLATE utf8mb4_unicode_ci DEFAULT 'interested',
  `invited_by` int DEFAULT NULL,
  `checked_in` tinyint(1) DEFAULT '0',
  `check_in_time` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_attendee` (`event_id`,`user_id`),
  KEY `idx_event` (`event_id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_status` (`status`),
  KEY `invited_by` (`invited_by`),
  CONSTRAINT `event_attendees_ibfk_1` FOREIGN KEY (`event_id`) REFERENCES `events` (`id`),
  CONSTRAINT `event_attendees_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
  CONSTRAINT `event_attendees_ibfk_3` FOREIGN KEY (`invited_by`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: events
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:39:42 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	creator_id	int	NO	NULL		MUL		
3	host_type	enum('user','page','group')	YES	user		MUL	utf8mb4_unicode_ci	
4	host_id	int	NO	NULL				
5	event_name	varchar(200)	NO	NULL			utf8mb4_unicode_ci	
6	description	text	YES	NULL			utf8mb4_unicode_ci	
7	category	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
8	cover_photo	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
9	start_datetime	timestamp	NO	NULL		MUL		
10	end_datetime	timestamp	YES	NULL				
11	timezone	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
12	location_type	enum('physical','online','hybrid')	YES	physical			utf8mb4_unicode_ci	
13	location_name	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
14	location_address	text	YES	NULL			utf8mb4_unicode_ci	
15	location_coordinates	json	YES	NULL				
16	online_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
17	privacy	enum('public','friends','private','group')	YES	public			utf8mb4_unicode_ci	
18	guest_list_visible	tinyint(1)	YES	1				
19	can_guests_invite	tinyint(1)	YES	1				
20	ticket_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
21	price	decimal(10,2)	YES	NULL				
22	max_attendees	int	YES	NULL				
23	interested_count	int	YES	0				
24	going_count	int	YES	0				
25	went_count	int	YES	0				
26	is_cancelled	tinyint(1)	YES	0				
27	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_creator	NON_UNIQUE	BTREE	creator_id	0
idx_host	NON_UNIQUE	BTREE	host_type, host_id	0
idx_start	NON_UNIQUE	BTREE	start_datetime	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
events_ibfk_1	creator_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `events` (
  `id` int NOT NULL AUTO_INCREMENT,
  `creator_id` int NOT NULL,
  `host_type` enum('user','page','group') COLLATE utf8mb4_unicode_ci DEFAULT 'user',
  `host_id` int NOT NULL,
  `event_name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `category` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cover_photo` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `start_datetime` timestamp NOT NULL,
  `end_datetime` timestamp NULL DEFAULT NULL,
  `timezone` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `location_type` enum('physical','online','hybrid') COLLATE utf8mb4_unicode_ci DEFAULT 'physical',
  `location_name` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `location_address` text COLLATE utf8mb4_unicode_ci,
  `location_coordinates` json DEFAULT NULL,
  `online_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `privacy` enum('public','friends','private','group') COLLATE utf8mb4_unicode_ci DEFAULT 'public',
  `guest_list_visible` tinyint(1) DEFAULT '1',
  `can_guests_invite` tinyint(1) DEFAULT '1',
  `ticket_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `price` decimal(10,2) DEFAULT NULL,
  `max_attendees` int DEFAULT NULL,
  `interested_count` int DEFAULT '0',
  `going_count` int DEFAULT '0',
  `went_count` int DEFAULT '0',
  `is_cancelled` tinyint(1) DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_creator` (`creator_id`),
  KEY `idx_host` (`host_type`,`host_id`),
  KEY `idx_start` (`start_datetime`),
  CONSTRAINT `events_ibfk_1` FOREIGN KEY (`creator_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: executive_dashboards
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:53:58 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	dashboard_name	varchar(200)	NO	NULL			utf8mb4_unicode_ci	
3	dashboard_type	varchar(100)	YES	NULL		MUL	utf8mb4_unicode_ci	
4	owner_id	int	NO	NULL		MUL		
5	layout	json	YES	NULL				
6	widgets	json	YES	NULL				
7	filters	json	YES	NULL				
8	date_range	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
9	refresh_frequency	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
10	shared_with	json	YES	NULL				
11	is_public	tinyint(1)	YES	0				
12	last_viewed	timestamp	YES	NULL				
13	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
14	updated_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_owner	NON_UNIQUE	BTREE	owner_id	0
idx_type	NON_UNIQUE	BTREE	dashboard_type	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
executive_dashboards_ibfk_1	owner_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `executive_dashboards` (
  `id` int NOT NULL AUTO_INCREMENT,
  `dashboard_name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `dashboard_type` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `owner_id` int NOT NULL,
  `layout` json DEFAULT NULL,
  `widgets` json DEFAULT NULL,
  `filters` json DEFAULT NULL,
  `date_range` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `refresh_frequency` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `shared_with` json DEFAULT NULL,
  `is_public` tinyint(1) DEFAULT '0',
  `last_viewed` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_owner` (`owner_id`),
  KEY `idx_type` (`dashboard_type`),
  CONSTRAINT `executive_dashboards_ibfk_1` FOREIGN KEY (`owner_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: executive_summary
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 16:04:49 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	summary_date	date	NO	NULL		UNI		
3	total_revenue	decimal(20,2)	YES	0.00				
4	total_costs	decimal(20,2)	YES	0.00				
5	net_profit	decimal(20,2)	YES	0.00				
6	profit_margin	decimal(5,2)	YES	0.00				
7	revenue_growth_mom	decimal(10,2)	YES	0.00				
8	revenue_growth_yoy	decimal(10,2)	YES	0.00				
9	user_growth_mom	decimal(10,2)	YES	0.00				
10	user_growth_yoy	decimal(10,2)	YES	0.00				
11	total_users	bigint	YES	0				
12	active_users	int	YES	0				
13	new_users	int	YES	0				
14	churn_rate	decimal(5,2)	YES	0.00				
15	nps_score	int	YES	0				
16	customer_satisfaction	decimal(5,2)	YES	0.00				
17	operational_efficiency	decimal(5,2)	YES	0.00				
18	key_achievements	json	YES	NULL				
19	main_challenges	json	YES	NULL				
20	opportunities	json	YES	NULL				
21	action_items	json	YES	NULL				
22	revenue_forecast_month	decimal(20,2)	YES	0.00				
23	user_forecast_month	bigint	YES	0				
24	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_date	NON_UNIQUE	BTREE	summary_date	0
unique_date	UNIQUE	BTREE	summary_date	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `executive_summary` (
  `id` int NOT NULL AUTO_INCREMENT,
  `summary_date` date NOT NULL,
  `total_revenue` decimal(20,2) DEFAULT '0.00',
  `total_costs` decimal(20,2) DEFAULT '0.00',
  `net_profit` decimal(20,2) DEFAULT '0.00',
  `profit_margin` decimal(5,2) DEFAULT '0.00',
  `revenue_growth_mom` decimal(10,2) DEFAULT '0.00',
  `revenue_growth_yoy` decimal(10,2) DEFAULT '0.00',
  `user_growth_mom` decimal(10,2) DEFAULT '0.00',
  `user_growth_yoy` decimal(10,2) DEFAULT '0.00',
  `total_users` bigint DEFAULT '0',
  `active_users` int DEFAULT '0',
  `new_users` int DEFAULT '0',
  `churn_rate` decimal(5,2) DEFAULT '0.00',
  `nps_score` int DEFAULT '0',
  `customer_satisfaction` decimal(5,2) DEFAULT '0.00',
  `operational_efficiency` decimal(5,2) DEFAULT '0.00',
  `key_achievements` json DEFAULT NULL,
  `main_challenges` json DEFAULT NULL,
  `opportunities` json DEFAULT NULL,
  `action_items` json DEFAULT NULL,
  `revenue_forecast_month` decimal(20,2) DEFAULT '0.00',
  `user_forecast_month` bigint DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_date` (`summary_date`),
  KEY `idx_date` (`summary_date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: experimentation_results
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:53:58 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	experiment_name	varchar(200)	NO	NULL		MUL	utf8mb4_unicode_ci	
3	experiment_type	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
4	hypothesis	text	YES	NULL			utf8mb4_unicode_ci	
5	control_group	json	YES	NULL				
6	treatment_groups	json	YES	NULL				
7	metrics_measured	json	YES	NULL				
8	results	json	YES	NULL				
9	statistical_significance	decimal(5,4)	YES	NULL				
10	confidence_interval	json	YES	NULL				
11	winner	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
12	impact_estimate	decimal(10,4)	YES	NULL				
13	decision	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
14	start_date	date	NO	NULL		MUL		
15	end_date	date	NO	NULL				
16	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_dates	NON_UNIQUE	BTREE	start_date, end_date	0
idx_name	NON_UNIQUE	BTREE	experiment_name	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `experimentation_results` (
  `id` int NOT NULL AUTO_INCREMENT,
  `experiment_name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `experiment_type` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `hypothesis` text COLLATE utf8mb4_unicode_ci,
  `control_group` json DEFAULT NULL,
  `treatment_groups` json DEFAULT NULL,
  `metrics_measured` json DEFAULT NULL,
  `results` json DEFAULT NULL,
  `statistical_significance` decimal(5,4) DEFAULT NULL,
  `confidence_interval` json DEFAULT NULL,
  `winner` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `impact_estimate` decimal(10,4) DEFAULT NULL,
  `decision` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `start_date` date NOT NULL,
  `end_date` date NOT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_name` (`experiment_name`),
  KEY `idx_dates` (`start_date`,`end_date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: feature_flags
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:13:51 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	flag_name	varchar(100)	NO	NULL		UNI	utf8mb4_unicode_ci	
3	description	text	YES	NULL			utf8mb4_unicode_ci	
4	is_enabled	tinyint(1)	YES	0		MUL		
5	rollout_percentage	int	YES	0				
6	target_users	json	YES	NULL				
7	target_groups	json	YES	NULL				
8	conditions	json	YES	NULL				
9	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
10	updated_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
flag_name	UNIQUE	BTREE	flag_name	0
idx_enabled	NON_UNIQUE	BTREE	is_enabled	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `feature_flags` (
  `id` int NOT NULL AUTO_INCREMENT,
  `flag_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `is_enabled` tinyint(1) DEFAULT '0',
  `rollout_percentage` int DEFAULT '0',
  `target_users` json DEFAULT NULL,
  `target_groups` json DEFAULT NULL,
  `conditions` json DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `flag_name` (`flag_name`),
  KEY `idx_enabled` (`is_enabled`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: feedback
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 2 | COLLATION: utf8mb4_0900_ai_ci | CREATE: 2025-08-04 01:43:53 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	YES	NULL		MUL		
3	type	enum('bug','feature','complaint','praise','other')	YES	other			utf8mb4_0900_ai_ci	
4	subject	varchar(255)	YES	NULL			utf8mb4_0900_ai_ci	
5	message	text	NO	NULL			utf8mb4_0900_ai_ci	
6	status	enum('new','in_progress','resolved','closed')	YES	new		MUL	utf8mb4_0900_ai_ci	
7	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED	MUL		
8	resolved_at	timestamp	YES	NULL				

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_created	NON_UNIQUE	BTREE	created_at	0
idx_status	NON_UNIQUE	BTREE	status	0
user_id	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
feedback_ibfk_1	user_id	users	id	NO ACTION	SET NULL

--- SHOW CREATE TABLE ---
CREATE TABLE `feedback` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int DEFAULT NULL,
  `type` enum('bug','feature','complaint','praise','other') DEFAULT 'other',
  `subject` varchar(255) DEFAULT NULL,
  `message` text NOT NULL,
  `status` enum('new','in_progress','resolved','closed') DEFAULT 'new',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `resolved_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `idx_status` (`status`),
  KEY `idx_created` (`created_at`),
  CONSTRAINT `feedback_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;


============================================================
TABLE: file_comments
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:37:23 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	file_id	bigint	NO	NULL		MUL		
3	user_id	int	NO	NULL		MUL		
4	comment_text	text	NO	NULL			utf8mb4_unicode_ci	
5	parent_comment_id	int	YES	NULL				
6	mentioned_users	json	YES	NULL				
7	is_resolved	tinyint(1)	YES	0				
8	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_file	NON_UNIQUE	BTREE	file_id	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
file_comments_ibfk_1	file_id	cloud_files	id	NO ACTION	CASCADE
file_comments_ibfk_2	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `file_comments` (
  `id` int NOT NULL AUTO_INCREMENT,
  `file_id` bigint NOT NULL,
  `user_id` int NOT NULL,
  `comment_text` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `parent_comment_id` int DEFAULT NULL,
  `mentioned_users` json DEFAULT NULL,
  `is_resolved` tinyint(1) DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_file` (`file_id`),
  KEY `idx_user` (`user_id`),
  CONSTRAINT `file_comments_ibfk_1` FOREIGN KEY (`file_id`) REFERENCES `cloud_files` (`id`) ON DELETE CASCADE,
  CONSTRAINT `file_comments_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: financial_control_center
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 16:03:29 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	date	date	NO	NULL		UNI		
3	revenue_products	decimal(20,2)	YES	0.00				
4	revenue_services	decimal(20,2)	YES	0.00				
5	revenue_subscriptions	decimal(20,2)	YES	0.00				
6	revenue_gaming	decimal(20,2)	YES	0.00				
7	revenue_streaming	decimal(20,2)	YES	0.00				
8	revenue_marketplace_fees	decimal(20,2)	YES	0.00				
9	revenue_transaction_fees	decimal(20,2)	YES	0.00				
10	revenue_advertising	decimal(20,2)	YES	0.00				
11	revenue_premium_features	decimal(20,2)	YES	0.00				
12	revenue_virtual_goods	decimal(20,2)	YES	0.00				
13	revenue_crypto	decimal(20,2)	YES	0.00				
14	revenue_nft	decimal(20,2)	YES	0.00				
15	revenue_affiliates	decimal(20,2)	YES	0.00				
16	revenue_other	json	YES	NULL				
17	cost_infrastructure	decimal(20,2)	YES	0.00				
18	cost_bandwidth	decimal(20,2)	YES	0.00				
19	cost_storage	decimal(20,2)	YES	0.00				
20	cost_processing_fees	decimal(20,2)	YES	0.00				
21	cost_refunds	decimal(20,2)	YES	0.00				
22	cost_chargebacks	decimal(20,2)	YES	0.00				
23	cost_marketing	decimal(20,2)	YES	0.00				
24	cost_support	decimal(20,2)	YES	0.00				
25	cost_development	decimal(20,2)	YES	0.00				
26	cost_other	json	YES	NULL				
27	gross_profit	decimal(20,2)	YES	0.00				
28	net_profit	decimal(20,2)	YES	0.00				
29	ebitda	decimal(20,2)	YES	0.00				
30	profit_margin	decimal(5,2)	YES	0.00				
31	cash_inflow	decimal(20,2)	YES	0.00				
32	cash_outflow	decimal(20,2)	YES	0.00				
33	cash_balance	decimal(20,2)	YES	0.00				
34	revenue_by_currency	json	YES	NULL				
35	revenue_by_country	json	YES	NULL				
36	revenue_by_platform	json	YES	NULL				
37	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_date	NON_UNIQUE	BTREE	date	0
unique_date	UNIQUE	BTREE	date	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `financial_control_center` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `date` date NOT NULL,
  `revenue_products` decimal(20,2) DEFAULT '0.00',
  `revenue_services` decimal(20,2) DEFAULT '0.00',
  `revenue_subscriptions` decimal(20,2) DEFAULT '0.00',
  `revenue_gaming` decimal(20,2) DEFAULT '0.00',
  `revenue_streaming` decimal(20,2) DEFAULT '0.00',
  `revenue_marketplace_fees` decimal(20,2) DEFAULT '0.00',
  `revenue_transaction_fees` decimal(20,2) DEFAULT '0.00',
  `revenue_advertising` decimal(20,2) DEFAULT '0.00',
  `revenue_premium_features` decimal(20,2) DEFAULT '0.00',
  `revenue_virtual_goods` decimal(20,2) DEFAULT '0.00',
  `revenue_crypto` decimal(20,2) DEFAULT '0.00',
  `revenue_nft` decimal(20,2) DEFAULT '0.00',
  `revenue_affiliates` decimal(20,2) DEFAULT '0.00',
  `revenue_other` json DEFAULT NULL,
  `cost_infrastructure` decimal(20,2) DEFAULT '0.00',
  `cost_bandwidth` decimal(20,2) DEFAULT '0.00',
  `cost_storage` decimal(20,2) DEFAULT '0.00',
  `cost_processing_fees` decimal(20,2) DEFAULT '0.00',
  `cost_refunds` decimal(20,2) DEFAULT '0.00',
  `cost_chargebacks` decimal(20,2) DEFAULT '0.00',
  `cost_marketing` decimal(20,2) DEFAULT '0.00',
  `cost_support` decimal(20,2) DEFAULT '0.00',
  `cost_development` decimal(20,2) DEFAULT '0.00',
  `cost_other` json DEFAULT NULL,
  `gross_profit` decimal(20,2) DEFAULT '0.00',
  `net_profit` decimal(20,2) DEFAULT '0.00',
  `ebitda` decimal(20,2) DEFAULT '0.00',
  `profit_margin` decimal(5,2) DEFAULT '0.00',
  `cash_inflow` decimal(20,2) DEFAULT '0.00',
  `cash_outflow` decimal(20,2) DEFAULT '0.00',
  `cash_balance` decimal(20,2) DEFAULT '0.00',
  `revenue_by_currency` json DEFAULT NULL,
  `revenue_by_country` json DEFAULT NULL,
  `revenue_by_platform` json DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_date` (`date`),
  KEY `idx_date` (`date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: fitness_activities
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:13:15 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	activity_type	varchar(100)	NO	NULL		MUL	utf8mb4_unicode_ci	
4	activity_name	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
5	duration_minutes	int	NO	NULL				
6	distance_km	decimal(10,3)	YES	NULL				
7	calories_burned	int	YES	NULL				
8	heart_rate_avg	int	YES	NULL				
9	heart_rate_max	int	YES	NULL				
10	steps	int	YES	NULL				
11	elevation_gain_m	decimal(10,2)	YES	NULL				
12	route_map	json	YES	NULL				
13	weather_conditions	json	YES	NULL				
14	equipment_used	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
15	intensity_level	enum('low','moderate','high','very_high')	YES	moderate			utf8mb4_unicode_ci	
16	mood_before	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
17	mood_after	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
18	notes	text	YES	NULL			utf8mb4_unicode_ci	
19	photos	json	YES	NULL				
20	is_public	tinyint(1)	YES	0				
21	likes_count	int	YES	0				
22	activity_date	date	NO	NULL		MUL		
23	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_date	NON_UNIQUE	BTREE	activity_date	0
idx_type	NON_UNIQUE	BTREE	activity_type	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
fitness_activities_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `fitness_activities` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `activity_type` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `activity_name` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `duration_minutes` int NOT NULL,
  `distance_km` decimal(10,3) DEFAULT NULL,
  `calories_burned` int DEFAULT NULL,
  `heart_rate_avg` int DEFAULT NULL,
  `heart_rate_max` int DEFAULT NULL,
  `steps` int DEFAULT NULL,
  `elevation_gain_m` decimal(10,2) DEFAULT NULL,
  `route_map` json DEFAULT NULL,
  `weather_conditions` json DEFAULT NULL,
  `equipment_used` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `intensity_level` enum('low','moderate','high','very_high') COLLATE utf8mb4_unicode_ci DEFAULT 'moderate',
  `mood_before` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `mood_after` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `photos` json DEFAULT NULL,
  `is_public` tinyint(1) DEFAULT '0',
  `likes_count` int DEFAULT '0',
  `activity_date` date NOT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_date` (`activity_date`),
  KEY `idx_type` (`activity_type`),
  CONSTRAINT `fitness_activities_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: flash_deals
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:51:43 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	product_id	bigint	NO	NULL		MUL		
3	deal_price	decimal(12,2)	NO	NULL				
4	original_price	decimal(12,2)	NO	NULL				
5	discount_percentage	decimal(5,2)	YES	NULL				
6	quantity_available	int	NO	NULL				
7	quantity_sold	int	YES	0				
8	start_time	timestamp	NO	NULL		MUL		
9	end_time	timestamp	NO	NULL				
10	is_featured	tinyint(1)	YES	0				
11	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_product	NON_UNIQUE	BTREE	product_id	0
idx_time	NON_UNIQUE	BTREE	start_time, end_time	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
flash_deals_ibfk_1	product_id	products_catalog	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `flash_deals` (
  `id` int NOT NULL AUTO_INCREMENT,
  `product_id` bigint NOT NULL,
  `deal_price` decimal(12,2) NOT NULL,
  `original_price` decimal(12,2) NOT NULL,
  `discount_percentage` decimal(5,2) DEFAULT NULL,
  `quantity_available` int NOT NULL,
  `quantity_sold` int DEFAULT '0',
  `start_time` timestamp NOT NULL,
  `end_time` timestamp NOT NULL,
  `is_featured` tinyint(1) DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_product` (`product_id`),
  KEY `idx_time` (`start_time`,`end_time`),
  CONSTRAINT `flash_deals_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `products_catalog` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: fraud_detection
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 03:01:45 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	detection_type	enum('multi_account','bonus_abuse','payment_fraud','collusion','bot_activity','suspicious_pattern')	NO	NULL		MUL	utf8mb4_unicode_ci	
4	risk_score	decimal(5,2)	NO	NULL		MUL		
5	evidence	json	YES	NULL				
6	related_accounts	json	YES	NULL				
7	action_taken	enum('none','warning','restriction','suspension','ban')	YES	none			utf8mb4_unicode_ci	
8	reviewed_by	int	YES	NULL		MUL		
9	review_notes	text	YES	NULL			utf8mb4_unicode_ci	
10	is_false_positive	tinyint(1)	YES	0				
11	detected_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
12	reviewed_at	timestamp	YES	NULL				

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_score	NON_UNIQUE	BTREE	risk_score	0
idx_type	NON_UNIQUE	BTREE	detection_type	0
idx_user	NON_UNIQUE	BTREE	user_id	0
reviewed_by	NON_UNIQUE	BTREE	reviewed_by	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
fraud_detection_ibfk_1	user_id	users	id	NO ACTION	NO ACTION
fraud_detection_ibfk_2	reviewed_by	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `fraud_detection` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `detection_type` enum('multi_account','bonus_abuse','payment_fraud','collusion','bot_activity','suspicious_pattern') COLLATE utf8mb4_unicode_ci NOT NULL,
  `risk_score` decimal(5,2) NOT NULL,
  `evidence` json DEFAULT NULL,
  `related_accounts` json DEFAULT NULL,
  `action_taken` enum('none','warning','restriction','suspension','ban') COLLATE utf8mb4_unicode_ci DEFAULT 'none',
  `reviewed_by` int DEFAULT NULL,
  `review_notes` text COLLATE utf8mb4_unicode_ci,
  `is_false_positive` tinyint(1) DEFAULT '0',
  `detected_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `reviewed_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_type` (`detection_type`),
  KEY `idx_score` (`risk_score`),
  KEY `reviewed_by` (`reviewed_by`),
  CONSTRAINT `fraud_detection_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
  CONSTRAINT `fraud_detection_ibfk_2` FOREIGN KEY (`reviewed_by`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: game_leaderboards
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.08 | TOTAL_MB: 0.09 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 03:00:56 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	leaderboard_type	enum('daily','weekly','monthly','all_time','tournament')	NO	NULL		MUL	utf8mb4_unicode_ci	
3	game_id	int	YES	NULL		MUL		
4	period_start	date	NO	NULL				
5	period_end	date	NO	NULL				
6	user_id	int	NO	NULL		MUL		
7	rank_position	int	NO	NULL		MUL		
8	score	decimal(20,2)	NO	NULL				
9	games_played	int	YES	0				
10	total_wagered	decimal(20,2)	YES	0.00				
11	total_won	decimal(20,2)	YES	0.00				
12	best_win	decimal(20,2)	YES	0.00				
13	best_multiplier	decimal(10,2)	YES	NULL				
14	prize_amount	decimal(20,2)	YES	0.00				
15	prize_claimed	tinyint(1)	YES	0				
16	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_game	NON_UNIQUE	BTREE	game_id	0
idx_rank	NON_UNIQUE	BTREE	rank_position	0
idx_type_period	NON_UNIQUE	BTREE	leaderboard_type, period_start	0
idx_user	NON_UNIQUE	BTREE	user_id	0
unique_leaderboard	UNIQUE	BTREE	leaderboard_type, game_id, period_start, user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
game_leaderboards_ibfk_1	game_id	casino_games	id	NO ACTION	NO ACTION
game_leaderboards_ibfk_2	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `game_leaderboards` (
  `id` int NOT NULL AUTO_INCREMENT,
  `leaderboard_type` enum('daily','weekly','monthly','all_time','tournament') COLLATE utf8mb4_unicode_ci NOT NULL,
  `game_id` int DEFAULT NULL,
  `period_start` date NOT NULL,
  `period_end` date NOT NULL,
  `user_id` int NOT NULL,
  `rank_position` int NOT NULL,
  `score` decimal(20,2) NOT NULL,
  `games_played` int DEFAULT '0',
  `total_wagered` decimal(20,2) DEFAULT '0.00',
  `total_won` decimal(20,2) DEFAULT '0.00',
  `best_win` decimal(20,2) DEFAULT '0.00',
  `best_multiplier` decimal(10,2) DEFAULT NULL,
  `prize_amount` decimal(20,2) DEFAULT '0.00',
  `prize_claimed` tinyint(1) DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_leaderboard` (`leaderboard_type`,`game_id`,`period_start`,`user_id`),
  KEY `idx_type_period` (`leaderboard_type`,`period_start`),
  KEY `idx_game` (`game_id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_rank` (`rank_position`),
  CONSTRAINT `game_leaderboards_ibfk_1` FOREIGN KEY (`game_id`) REFERENCES `casino_games` (`id`),
  CONSTRAINT `game_leaderboards_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: game_rounds
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.08 | TOTAL_MB: 0.09 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:57:40 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	session_id	varchar(100)	NO	NULL		MUL	utf8mb4_unicode_ci	
3	user_id	int	NO	NULL		MUL		
4	game_id	int	NO	NULL		MUL		
5	round_id	varchar(100)	NO	NULL		UNI	utf8mb4_unicode_ci	
6	bet_amount	decimal(20,2)	NO	NULL				
7	win_amount	decimal(20,2)	YES	0.00				
8	profit	decimal(20,2)	YES	0.00				
9	multiplier	decimal(10,2)	YES	NULL				
10	game_data	json	YES	NULL				
11	result	json	YES	NULL				
12	is_bonus_round	tinyint(1)	YES	0				
13	is_jackpot	tinyint(1)	YES	0				
14	client_seed	varchar(255)	YES	NULL			utf8mb4_unicode_ci	
15	server_seed	varchar(255)	YES	NULL			utf8mb4_unicode_ci	
16	nonce	int	YES	NULL				
17	verification_hash	varchar(255)	YES	NULL			utf8mb4_unicode_ci	
18	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED	MUL		

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_created	NON_UNIQUE	BTREE	created_at	0
idx_game	NON_UNIQUE	BTREE	game_id	0
idx_session	NON_UNIQUE	BTREE	session_id	0
idx_user	NON_UNIQUE	BTREE	user_id	0
round_id	UNIQUE	BTREE	round_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
game_rounds_ibfk_1	user_id	users	id	NO ACTION	NO ACTION
game_rounds_ibfk_2	game_id	casino_games	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `game_rounds` (
  `id` int NOT NULL AUTO_INCREMENT,
  `session_id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` int NOT NULL,
  `game_id` int NOT NULL,
  `round_id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `bet_amount` decimal(20,2) NOT NULL,
  `win_amount` decimal(20,2) DEFAULT '0.00',
  `profit` decimal(20,2) DEFAULT '0.00',
  `multiplier` decimal(10,2) DEFAULT NULL,
  `game_data` json DEFAULT NULL,
  `result` json DEFAULT NULL,
  `is_bonus_round` tinyint(1) DEFAULT '0',
  `is_jackpot` tinyint(1) DEFAULT '0',
  `client_seed` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `server_seed` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `nonce` int DEFAULT NULL,
  `verification_hash` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `round_id` (`round_id`),
  KEY `idx_session` (`session_id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_game` (`game_id`),
  KEY `idx_created` (`created_at`),
  CONSTRAINT `game_rounds_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
  CONSTRAINT `game_rounds_ibfk_2` FOREIGN KEY (`game_id`) REFERENCES `casino_games` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: game_sessions
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.02 | TOTAL_MB: 0.03 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_0900_ai_ci | CREATE: 2025-08-05 23:28:33 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	session_id	int	YES	NULL		MUL		
3	game_type	varchar(50)	YES	NULL			utf8mb4_0900_ai_ci	
4	player1_score	int	YES	0				
5	player2_score	int	YES	0				
6	started_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
7	ended_at	timestamp	YES	NULL				

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
session_id	NON_UNIQUE	BTREE	session_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
game_sessions_ibfk_1	session_id	chat_sessions	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `game_sessions` (
  `id` int NOT NULL AUTO_INCREMENT,
  `session_id` int DEFAULT NULL,
  `game_type` varchar(50) DEFAULT NULL,
  `player1_score` int DEFAULT '0',
  `player2_score` int DEFAULT '0',
  `started_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `ended_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `session_id` (`session_id`),
  CONSTRAINT `game_sessions_ibfk_1` FOREIGN KEY (`session_id`) REFERENCES `chat_sessions` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;


============================================================
TABLE: game_tokens
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:56:04 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		UNI		
3	token_balance	decimal(20,2)	YES	0.00				
4	bonus_balance	decimal(20,2)	YES	0.00				
5	locked_balance	decimal(20,2)	YES	0.00				
6	total_deposited	decimal(20,2)	YES	0.00				
7	total_withdrawn	decimal(20,2)	YES	0.00				
8	total_wagered	decimal(20,2)	YES	0.00				
9	total_won	decimal(20,2)	YES	0.00				
10	wagering_requirement	decimal(20,2)	YES	0.00				
11	vip_tier	int	YES	0		MUL		
12	cashback_rate	decimal(5,2)	YES	0.00				
13	last_deposit	timestamp	YES	NULL				
14	last_withdrawal	timestamp	YES	NULL				
15	is_suspended	tinyint(1)	YES	0				
16	suspension_reason	text	YES	NULL			utf8mb4_unicode_ci	
17	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
18	updated_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_vip	NON_UNIQUE	BTREE	vip_tier	0
unique_user	UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
game_tokens_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `game_tokens` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `token_balance` decimal(20,2) DEFAULT '0.00',
  `bonus_balance` decimal(20,2) DEFAULT '0.00',
  `locked_balance` decimal(20,2) DEFAULT '0.00',
  `total_deposited` decimal(20,2) DEFAULT '0.00',
  `total_withdrawn` decimal(20,2) DEFAULT '0.00',
  `total_wagered` decimal(20,2) DEFAULT '0.00',
  `total_won` decimal(20,2) DEFAULT '0.00',
  `wagering_requirement` decimal(20,2) DEFAULT '0.00',
  `vip_tier` int DEFAULT '0',
  `cashback_rate` decimal(5,2) DEFAULT '0.00',
  `last_deposit` timestamp NULL DEFAULT NULL,
  `last_withdrawal` timestamp NULL DEFAULT NULL,
  `is_suspended` tinyint(1) DEFAULT '0',
  `suspension_reason` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_user` (`user_id`),
  KEY `idx_vip` (`vip_tier`),
  CONSTRAINT `game_tokens_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: game_tournaments
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.08 | TOTAL_MB: 0.09 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:58:27 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	tournament_code	varchar(50)	NO	NULL		UNI	utf8mb4_unicode_ci	
3	name	varchar(200)	NO	NULL			utf8mb4_unicode_ci	
4	description	text	YES	NULL			utf8mb4_unicode_ci	
5	game_id	int	YES	NULL		MUL		
6	tournament_type	enum('slots','poker','blackjack','mixed','freeroll','satellite')	NO	NULL		MUL	utf8mb4_unicode_ci	
7	format	enum('freezeout','rebuy','knockout','points','time_based')	YES	points			utf8mb4_unicode_ci	
8	buy_in	decimal(20,2)	YES	0.00				
9	rebuy_cost	decimal(20,2)	YES	NULL				
10	prize_pool	decimal(20,2)	YES	0.00				
11	guaranteed_prize	decimal(20,2)	YES	NULL				
12	prizes_structure	json	YES	NULL				
13	min_players	int	YES	2				
14	max_players	int	YES	1000				
15	registered_players	int	YES	0				
16	starting_chips	int	YES	NULL				
17	blind_structure	json	YES	NULL				
18	time_limit_minutes	int	YES	NULL				
19	late_registration_minutes	int	YES	NULL				
20	status	enum('upcoming','registering','running','finished','cancelled')	YES	upcoming		MUL	utf8mb4_unicode_ci	
21	start_time	timestamp	NO	NULL		MUL		
22	end_time	timestamp	YES	NULL				
23	leaderboard	json	YES	NULL				
24	is_featured	tinyint(1)	YES	0				
25	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_game	NON_UNIQUE	BTREE	game_id	0
idx_start	NON_UNIQUE	BTREE	start_time	0
idx_status	NON_UNIQUE	BTREE	status	0
idx_type	NON_UNIQUE	BTREE	tournament_type	0
tournament_code	UNIQUE	BTREE	tournament_code	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
game_tournaments_ibfk_1	game_id	casino_games	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `game_tournaments` (
  `id` int NOT NULL AUTO_INCREMENT,
  `tournament_code` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `game_id` int DEFAULT NULL,
  `tournament_type` enum('slots','poker','blackjack','mixed','freeroll','satellite') COLLATE utf8mb4_unicode_ci NOT NULL,
  `format` enum('freezeout','rebuy','knockout','points','time_based') COLLATE utf8mb4_unicode_ci DEFAULT 'points',
  `buy_in` decimal(20,2) DEFAULT '0.00',
  `rebuy_cost` decimal(20,2) DEFAULT NULL,
  `prize_pool` decimal(20,2) DEFAULT '0.00',
  `guaranteed_prize` decimal(20,2) DEFAULT NULL,
  `prizes_structure` json DEFAULT NULL,
  `min_players` int DEFAULT '2',
  `max_players` int DEFAULT '1000',
  `registered_players` int DEFAULT '0',
  `starting_chips` int DEFAULT NULL,
  `blind_structure` json DEFAULT NULL,
  `time_limit_minutes` int DEFAULT NULL,
  `late_registration_minutes` int DEFAULT NULL,
  `status` enum('upcoming','registering','running','finished','cancelled') COLLATE utf8mb4_unicode_ci DEFAULT 'upcoming',
  `start_time` timestamp NOT NULL,
  `end_time` timestamp NULL DEFAULT NULL,
  `leaderboard` json DEFAULT NULL,
  `is_featured` tinyint(1) DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `tournament_code` (`tournament_code`),
  KEY `idx_game` (`game_id`),
  KEY `idx_type` (`tournament_type`),
  KEY `idx_status` (`status`),
  KEY `idx_start` (`start_time`),
  CONSTRAINT `game_tournaments_ibfk_1` FOREIGN KEY (`game_id`) REFERENCES `casino_games` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: gamer_dashboard
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 16:04:26 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	gamer_id	int	NO	NULL		UNI		
3	games_played_today	int	YES	0				
4	win_rate_week	decimal(5,2)	YES	0.00				
5	current_streak	int	YES	0				
6	balance_tokens	decimal(12,2)	YES	0.00				
7	wagered_today	decimal(12,2)	YES	0.00				
8	profit_loss_today	decimal(12,2)	YES	0.00				
9	global_rank	int	YES	NULL				
10	tournament_points	int	YES	0				
11	pending_rewards	int	YES	0				
12	vip_level	int	YES	0				
13	cashback_available	decimal(12,2)	YES	0.00				
14	last_updated	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_gamer	NON_UNIQUE	BTREE	gamer_id	0
unique_gamer	UNIQUE	BTREE	gamer_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
gamer_dashboard_ibfk_1	gamer_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `gamer_dashboard` (
  `id` int NOT NULL AUTO_INCREMENT,
  `gamer_id` int NOT NULL,
  `games_played_today` int DEFAULT '0',
  `win_rate_week` decimal(5,2) DEFAULT '0.00',
  `current_streak` int DEFAULT '0',
  `balance_tokens` decimal(12,2) DEFAULT '0.00',
  `wagered_today` decimal(12,2) DEFAULT '0.00',
  `profit_loss_today` decimal(12,2) DEFAULT '0.00',
  `global_rank` int DEFAULT NULL,
  `tournament_points` int DEFAULT '0',
  `pending_rewards` int DEFAULT '0',
  `vip_level` int DEFAULT '0',
  `cashback_available` decimal(12,2) DEFAULT '0.00',
  `last_updated` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_gamer` (`gamer_id`),
  KEY `idx_gamer` (`gamer_id`),
  CONSTRAINT `gamer_dashboard_ibfk_1` FOREIGN KEY (`gamer_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: geolocation_checks
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 03:01:23 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	ip_address	varchar(45)	NO	NULL		MUL	utf8mb4_unicode_ci	
4	country	varchar(2)	YES	NULL			utf8mb4_unicode_ci	
5	state	varchar(50)	YES	NULL		MUL	utf8mb4_unicode_ci	
6	city	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
7	latitude	decimal(10,8)	YES	NULL				
8	longitude	decimal(11,8)	YES	NULL				
9	is_vpn	tinyint(1)	YES	0				
10	is_proxy	tinyint(1)	YES	0				
11	is_allowed	tinyint(1)	YES	1				
12	restriction_reason	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
13	provider	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
14	check_data	json	YES	NULL				
15	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED	MUL		

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_created	NON_UNIQUE	BTREE	created_at	0
idx_ip	NON_UNIQUE	BTREE	ip_address	0
idx_state	NON_UNIQUE	BTREE	state	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
geolocation_checks_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `geolocation_checks` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `ip_address` varchar(45) COLLATE utf8mb4_unicode_ci NOT NULL,
  `country` varchar(2) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `state` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `city` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `latitude` decimal(10,8) DEFAULT NULL,
  `longitude` decimal(11,8) DEFAULT NULL,
  `is_vpn` tinyint(1) DEFAULT '0',
  `is_proxy` tinyint(1) DEFAULT '0',
  `is_allowed` tinyint(1) DEFAULT '1',
  `restriction_reason` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `provider` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `check_data` json DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_ip` (`ip_address`),
  KEY `idx_state` (`state`),
  KEY `idx_created` (`created_at`),
  CONSTRAINT `geolocation_checks_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: gift_transactions
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-07 01:09:42 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	sender_id	int	NO	NULL		MUL		
3	receiver_id	int	NO	NULL		MUL		
4	gift_id	int	NO	NULL		MUL		
5	session_id	int	YES	NULL		MUL		
6	coins_spent	int	NO	NULL				
7	message	text	YES	NULL			utf8mb4_unicode_ci	
8	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
gift_id	NON_UNIQUE	BTREE	gift_id	0
idx_receiver	NON_UNIQUE	BTREE	receiver_id	0
idx_sender	NON_UNIQUE	BTREE	sender_id	0
session_id	NON_UNIQUE	BTREE	session_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
gift_transactions_ibfk_1	sender_id	users	id	NO ACTION	CASCADE
gift_transactions_ibfk_2	receiver_id	users	id	NO ACTION	CASCADE
gift_transactions_ibfk_3	gift_id	virtual_gifts	id	NO ACTION	NO ACTION
gift_transactions_ibfk_4	session_id	chat_sessions	id	NO ACTION	SET NULL

--- SHOW CREATE TABLE ---
CREATE TABLE `gift_transactions` (
  `id` int NOT NULL AUTO_INCREMENT,
  `sender_id` int NOT NULL,
  `receiver_id` int NOT NULL,
  `gift_id` int NOT NULL,
  `session_id` int DEFAULT NULL,
  `coins_spent` int NOT NULL,
  `message` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `gift_id` (`gift_id`),
  KEY `session_id` (`session_id`),
  KEY `idx_sender` (`sender_id`),
  KEY `idx_receiver` (`receiver_id`),
  CONSTRAINT `gift_transactions_ibfk_1` FOREIGN KEY (`sender_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  CONSTRAINT `gift_transactions_ibfk_2` FOREIGN KEY (`receiver_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  CONSTRAINT `gift_transactions_ibfk_3` FOREIGN KEY (`gift_id`) REFERENCES `virtual_gifts` (`id`),
  CONSTRAINT `gift_transactions_ibfk_4` FOREIGN KEY (`session_id`) REFERENCES `chat_sessions` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: gig_jobs
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.08 | TOTAL_MB: 0.09 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:12:25 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	employer_id	int	NO	NULL		MUL		
3	title	varchar(200)	NO	NULL			utf8mb4_unicode_ci	
4	description	text	NO	NULL			utf8mb4_unicode_ci	
5	category	varchar(100)	YES	NULL		MUL	utf8mb4_unicode_ci	
6	skills_required	json	YES	NULL				
7	experience_level	enum('entry','intermediate','expert')	YES	intermediate			utf8mb4_unicode_ci	
8	job_type	enum('fixed_price','hourly','milestone')	YES	fixed_price			utf8mb4_unicode_ci	
9	budget_min	decimal(10,2)	YES	NULL		MUL		
10	budget_max	decimal(10,2)	YES	NULL				
11	hourly_rate_min	decimal(10,2)	YES	NULL				
12	hourly_rate_max	decimal(10,2)	YES	NULL				
13	estimated_duration	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
14	deadline	date	YES	NULL				
15	attachments	json	YES	NULL				
16	location_requirement	enum('remote','onsite','hybrid')	YES	remote			utf8mb4_unicode_ci	
17	location_details	text	YES	NULL			utf8mb4_unicode_ci	
18	proposals_count	int	YES	0				
19	hired_freelancer_id	int	YES	NULL		MUL		
20	status	enum('draft','open','in_progress','completed','cancelled','disputed')	YES	draft		MUL	utf8mb4_unicode_ci	
21	is_urgent	tinyint(1)	YES	0				
22	is_featured	tinyint(1)	YES	0				
23	visibility	enum('public','invite_only','private')	YES	public			utf8mb4_unicode_ci	
24	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
25	hired_at	timestamp	YES	NULL				
26	completed_at	timestamp	YES	NULL				

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
hired_freelancer_id	NON_UNIQUE	BTREE	hired_freelancer_id	0
idx_budget	NON_UNIQUE	BTREE	budget_min, budget_max	0
idx_category	NON_UNIQUE	BTREE	category	0
idx_employer	NON_UNIQUE	BTREE	employer_id	0
idx_status	NON_UNIQUE	BTREE	status	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
gig_jobs_ibfk_1	employer_id	users	id	NO ACTION	NO ACTION
gig_jobs_ibfk_2	hired_freelancer_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `gig_jobs` (
  `id` int NOT NULL AUTO_INCREMENT,
  `employer_id` int NOT NULL,
  `title` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `category` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `skills_required` json DEFAULT NULL,
  `experience_level` enum('entry','intermediate','expert') COLLATE utf8mb4_unicode_ci DEFAULT 'intermediate',
  `job_type` enum('fixed_price','hourly','milestone') COLLATE utf8mb4_unicode_ci DEFAULT 'fixed_price',
  `budget_min` decimal(10,2) DEFAULT NULL,
  `budget_max` decimal(10,2) DEFAULT NULL,
  `hourly_rate_min` decimal(10,2) DEFAULT NULL,
  `hourly_rate_max` decimal(10,2) DEFAULT NULL,
  `estimated_duration` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `deadline` date DEFAULT NULL,
  `attachments` json DEFAULT NULL,
  `location_requirement` enum('remote','onsite','hybrid') COLLATE utf8mb4_unicode_ci DEFAULT 'remote',
  `location_details` text COLLATE utf8mb4_unicode_ci,
  `proposals_count` int DEFAULT '0',
  `hired_freelancer_id` int DEFAULT NULL,
  `status` enum('draft','open','in_progress','completed','cancelled','disputed') COLLATE utf8mb4_unicode_ci DEFAULT 'draft',
  `is_urgent` tinyint(1) DEFAULT '0',
  `is_featured` tinyint(1) DEFAULT '0',
  `visibility` enum('public','invite_only','private') COLLATE utf8mb4_unicode_ci DEFAULT 'public',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `hired_at` timestamp NULL DEFAULT NULL,
  `completed_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_employer` (`employer_id`),
  KEY `idx_category` (`category`),
  KEY `idx_status` (`status`),
  KEY `idx_budget` (`budget_min`,`budget_max`),
  KEY `hired_freelancer_id` (`hired_freelancer_id`),
  CONSTRAINT `gig_jobs_ibfk_1` FOREIGN KEY (`employer_id`) REFERENCES `users` (`id`),
  CONSTRAINT `gig_jobs_ibfk_2` FOREIGN KEY (`hired_freelancer_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: gig_proposals
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:12:25 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	job_id	int	NO	NULL		MUL		
3	freelancer_id	int	NO	NULL		MUL		
4	cover_letter	text	NO	NULL			utf8mb4_unicode_ci	
5	proposed_rate	decimal(10,2)	NO	NULL				
6	delivery_time_days	int	NO	NULL				
7	milestones	json	YES	NULL				
8	portfolio_items	json	YES	NULL				
9	attachments	json	YES	NULL				
10	questions_answers	json	YES	NULL				
11	status	enum('pending','shortlisted','accepted','rejected','withdrawn')	YES	pending		MUL	utf8mb4_unicode_ci	
12	client_viewed	tinyint(1)	YES	0				
13	viewed_at	timestamp	YES	NULL				
14	interview_scheduled	timestamp	YES	NULL				
15	rejection_reason	text	YES	NULL			utf8mb4_unicode_ci	
16	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_freelancer	NON_UNIQUE	BTREE	freelancer_id	0
idx_job	NON_UNIQUE	BTREE	job_id	0
idx_status	NON_UNIQUE	BTREE	status	0
unique_proposal	UNIQUE	BTREE	job_id, freelancer_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
gig_proposals_ibfk_1	job_id	gig_jobs	id	NO ACTION	NO ACTION
gig_proposals_ibfk_2	freelancer_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `gig_proposals` (
  `id` int NOT NULL AUTO_INCREMENT,
  `job_id` int NOT NULL,
  `freelancer_id` int NOT NULL,
  `cover_letter` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `proposed_rate` decimal(10,2) NOT NULL,
  `delivery_time_days` int NOT NULL,
  `milestones` json DEFAULT NULL,
  `portfolio_items` json DEFAULT NULL,
  `attachments` json DEFAULT NULL,
  `questions_answers` json DEFAULT NULL,
  `status` enum('pending','shortlisted','accepted','rejected','withdrawn') COLLATE utf8mb4_unicode_ci DEFAULT 'pending',
  `client_viewed` tinyint(1) DEFAULT '0',
  `viewed_at` timestamp NULL DEFAULT NULL,
  `interview_scheduled` timestamp NULL DEFAULT NULL,
  `rejection_reason` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_proposal` (`job_id`,`freelancer_id`),
  KEY `idx_job` (`job_id`),
  KEY `idx_freelancer` (`freelancer_id`),
  KEY `idx_status` (`status`),
  CONSTRAINT `gig_proposals_ibfk_1` FOREIGN KEY (`job_id`) REFERENCES `gig_jobs` (`id`),
  CONSTRAINT `gig_proposals_ibfk_2` FOREIGN KEY (`freelancer_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: global_events_queue
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 03:05:22 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	event_type	varchar(100)	NO	NULL			utf8mb4_unicode_ci	
3	event_subtype	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
4	user_id	int	YES	NULL		MUL		
5	target_user_id	int	YES	NULL				
6	module	varchar(50)	NO	NULL		MUL	utf8mb4_unicode_ci	
7	payload	json	NO	NULL				
8	priority	enum('low','normal','high','critical')	YES	normal			utf8mb4_unicode_ci	
9	status	enum('pending','processing','completed','failed')	YES	pending		MUL	utf8mb4_unicode_ci	
10	retry_count	int	YES	0				
11	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED	MUL		
12	processed_at	timestamp	YES	NULL				

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_created	NON_UNIQUE	BTREE	created_at	0
idx_module	NON_UNIQUE	BTREE	module	0
idx_status_priority	NON_UNIQUE	BTREE	status, priority	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `global_events_queue` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `event_type` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `event_subtype` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_id` int DEFAULT NULL,
  `target_user_id` int DEFAULT NULL,
  `module` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `payload` json NOT NULL,
  `priority` enum('low','normal','high','critical') COLLATE utf8mb4_unicode_ci DEFAULT 'normal',
  `status` enum('pending','processing','completed','failed') COLLATE utf8mb4_unicode_ci DEFAULT 'pending',
  `retry_count` int DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `processed_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_status_priority` (`status`,`priority`),
  KEY `idx_user` (`user_id`),
  KEY `idx_module` (`module`),
  KEY `idx_created` (`created_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: group_chats
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:53:52 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	group_code	varchar(30)	NO	NULL		UNI	utf8mb4_unicode_ci	
3	name	varchar(100)	NO	NULL			utf8mb4_unicode_ci	
4	description	text	YES	NULL			utf8mb4_unicode_ci	
5	avatar_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
6	owner_id	int	NO	NULL		MUL		
7	admins	json	YES	NULL				
8	member_count	int	YES	0				
9	max_members	int	YES	256				
10	privacy	enum('public','private','secret')	YES	private		MUL	utf8mb4_unicode_ci	
11	join_approval	tinyint(1)	YES	0				
12	invite_link	varchar(100)	YES	NULL		UNI	utf8mb4_unicode_ci	
13	invite_link_expires	timestamp	YES	NULL				
14	rules	text	YES	NULL			utf8mb4_unicode_ci	
15	pinned_messages	json	YES	NULL				
16	slow_mode_seconds	int	YES	0				
17	auto_delete_hours	int	YES	0				
18	is_broadcast	tinyint(1)	YES	0				
19	is_archived	tinyint(1)	YES	0				
20	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
group_code	UNIQUE	BTREE	group_code	0
idx_owner	NON_UNIQUE	BTREE	owner_id	0
idx_privacy	NON_UNIQUE	BTREE	privacy	0
invite_link	UNIQUE	BTREE	invite_link	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
group_chats_ibfk_1	owner_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `group_chats` (
  `id` int NOT NULL AUTO_INCREMENT,
  `group_code` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `avatar_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `owner_id` int NOT NULL,
  `admins` json DEFAULT NULL,
  `member_count` int DEFAULT '0',
  `max_members` int DEFAULT '256',
  `privacy` enum('public','private','secret') COLLATE utf8mb4_unicode_ci DEFAULT 'private',
  `join_approval` tinyint(1) DEFAULT '0',
  `invite_link` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `invite_link_expires` timestamp NULL DEFAULT NULL,
  `rules` text COLLATE utf8mb4_unicode_ci,
  `pinned_messages` json DEFAULT NULL,
  `slow_mode_seconds` int DEFAULT '0',
  `auto_delete_hours` int DEFAULT '0',
  `is_broadcast` tinyint(1) DEFAULT '0',
  `is_archived` tinyint(1) DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `group_code` (`group_code`),
  UNIQUE KEY `invite_link` (`invite_link`),
  KEY `idx_owner` (`owner_id`),
  KEY `idx_privacy` (`privacy`),
  CONSTRAINT `group_chats_ibfk_1` FOREIGN KEY (`owner_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: health_challenges
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:13:15 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	creator_id	int	NO	NULL		MUL		
3	title	varchar(200)	NO	NULL			utf8mb4_unicode_ci	
4	description	text	YES	NULL			utf8mb4_unicode_ci	
5	challenge_type	enum('weight_loss','muscle_gain','steps','nutrition','meditation','sleep','custom')	NO	NULL		MUL	utf8mb4_unicode_ci	
6	goal_value	decimal(10,2)	YES	NULL				
7	goal_unit	varchar(20)	YES	NULL			utf8mb4_unicode_ci	
8	duration_days	int	YES	30				
9	start_date	date	NO	NULL		MUL		
10	end_date	date	NO	NULL				
11	rules	text	YES	NULL			utf8mb4_unicode_ci	
12	prizes	json	YES	NULL				
13	entry_fee	decimal(10,2)	YES	0.00				
14	participant_count	int	YES	0				
15	completion_count	int	YES	0				
16	total_prize_pool	decimal(10,2)	YES	0.00				
17	leaderboard	json	YES	NULL				
18	is_public	tinyint(1)	YES	1				
19	is_featured	tinyint(1)	YES	0				
20	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_creator	NON_UNIQUE	BTREE	creator_id	0
idx_dates	NON_UNIQUE	BTREE	start_date, end_date	0
idx_type	NON_UNIQUE	BTREE	challenge_type	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
health_challenges_ibfk_1	creator_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `health_challenges` (
  `id` int NOT NULL AUTO_INCREMENT,
  `creator_id` int NOT NULL,
  `title` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `challenge_type` enum('weight_loss','muscle_gain','steps','nutrition','meditation','sleep','custom') COLLATE utf8mb4_unicode_ci NOT NULL,
  `goal_value` decimal(10,2) DEFAULT NULL,
  `goal_unit` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `duration_days` int DEFAULT '30',
  `start_date` date NOT NULL,
  `end_date` date NOT NULL,
  `rules` text COLLATE utf8mb4_unicode_ci,
  `prizes` json DEFAULT NULL,
  `entry_fee` decimal(10,2) DEFAULT '0.00',
  `participant_count` int DEFAULT '0',
  `completion_count` int DEFAULT '0',
  `total_prize_pool` decimal(10,2) DEFAULT '0.00',
  `leaderboard` json DEFAULT NULL,
  `is_public` tinyint(1) DEFAULT '1',
  `is_featured` tinyint(1) DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_creator` (`creator_id`),
  KEY `idx_type` (`challenge_type`),
  KEY `idx_dates` (`start_date`,`end_date`),
  CONSTRAINT `health_challenges_ibfk_1` FOREIGN KEY (`creator_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: health_profiles
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:13:15 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		UNI		
3	date_of_birth	date	YES	NULL				
4	gender	varchar(20)	YES	NULL			utf8mb4_unicode_ci	
5	height_cm	int	YES	NULL				
6	weight_kg	decimal(5,2)	YES	NULL				
7	bmi	decimal(4,2)	YES	NULL	STORED GENERATED			
8	blood_type	varchar(10)	YES	NULL			utf8mb4_unicode_ci	
9	allergies	json	YES	NULL				
10	chronic_conditions	json	YES	NULL				
11	medications	json	YES	NULL				
12	emergency_contact	json	YES	NULL				
13	medical_history	json	YES	NULL				
14	fitness_level	enum('sedentary','beginner','intermediate','advanced','athlete')	YES	beginner			utf8mb4_unicode_ci	
15	fitness_goals	json	YES	NULL				
16	dietary_restrictions	json	YES	NULL				
17	sleep_hours_target	int	YES	8				
18	water_intake_target_ml	int	YES	2000				
19	steps_daily_target	int	YES	10000				
20	calories_daily_target	int	YES	NULL				
21	heart_rate_resting	int	YES	NULL				
22	heart_rate_max	int	YES	NULL				
23	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
24	updated_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_user	NON_UNIQUE	BTREE	user_id	0
user_id	UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
health_profiles_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `health_profiles` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `date_of_birth` date DEFAULT NULL,
  `gender` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `height_cm` int DEFAULT NULL,
  `weight_kg` decimal(5,2) DEFAULT NULL,
  `bmi` decimal(4,2) GENERATED ALWAYS AS ((`weight_kg` / pow((`height_cm` / 100),2))) STORED,
  `blood_type` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `allergies` json DEFAULT NULL,
  `chronic_conditions` json DEFAULT NULL,
  `medications` json DEFAULT NULL,
  `emergency_contact` json DEFAULT NULL,
  `medical_history` json DEFAULT NULL,
  `fitness_level` enum('sedentary','beginner','intermediate','advanced','athlete') COLLATE utf8mb4_unicode_ci DEFAULT 'beginner',
  `fitness_goals` json DEFAULT NULL,
  `dietary_restrictions` json DEFAULT NULL,
  `sleep_hours_target` int DEFAULT '8',
  `water_intake_target_ml` int DEFAULT '2000',
  `steps_daily_target` int DEFAULT '10000',
  `calories_daily_target` int DEFAULT NULL,
  `heart_rate_resting` int DEFAULT NULL,
  `heart_rate_max` int DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_id` (`user_id`),
  KEY `idx_user` (`user_id`),
  CONSTRAINT `health_profiles_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: housing_rentals
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.08 | TOTAL_MB: 0.09 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:52:18 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	landlord_id	int	NO	NULL		MUL		
3	listing_type	enum('apartment','house','room','shared','sublet','vacation')	NO	NULL		MUL	utf8mb4_unicode_ci	
4	title	varchar(300)	NO	NULL			utf8mb4_unicode_ci	
5	description	text	YES	NULL			utf8mb4_unicode_ci	
6	address_hidden	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
7	neighborhood	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
8	city	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
9	state	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
10	zip_code	varchar(20)	YES	NULL			utf8mb4_unicode_ci	
11	coordinates	json	YES	NULL				
12	rent_amount	decimal(10,2)	NO	NULL		MUL		
13	security_deposit	decimal(10,2)	YES	NULL				
14	utilities_included	json	YES	NULL				
15	bedrooms	decimal(2,1)	YES	NULL		MUL		
16	bathrooms	decimal(2,1)	YES	NULL				
17	square_feet	int	YES	NULL				
18	furnished	enum('unfurnished','partially','fully')	YES	unfurnished			utf8mb4_unicode_ci	
19	amenities	json	YES	NULL				
20	pet_policy	json	YES	NULL				
21	parking_spots	int	YES	0				
22	lease_term_months	int	YES	NULL				
23	available_date	date	YES	NULL		MUL		
24	application_fee	decimal(10,2)	YES	NULL				
25	credit_check_required	tinyint(1)	YES	1				
26	income_requirement	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
27	images	json	YES	NULL				
28	virtual_tour_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
29	contact_method	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
30	showing_times	json	YES	NULL				
31	applications_received	int	YES	0				
32	status	enum('available','pending','rented','removed')	YES	available			utf8mb4_unicode_ci	
33	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_available	NON_UNIQUE	BTREE	available_date	0
idx_bedrooms	NON_UNIQUE	BTREE	bedrooms	0
idx_landlord	NON_UNIQUE	BTREE	landlord_id	0
idx_rent	NON_UNIQUE	BTREE	rent_amount	0
idx_type	NON_UNIQUE	BTREE	listing_type	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
housing_rentals_ibfk_1	landlord_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `housing_rentals` (
  `id` int NOT NULL AUTO_INCREMENT,
  `landlord_id` int NOT NULL,
  `listing_type` enum('apartment','house','room','shared','sublet','vacation') COLLATE utf8mb4_unicode_ci NOT NULL,
  `title` varchar(300) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `address_hidden` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `neighborhood` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `city` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `state` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `zip_code` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `coordinates` json DEFAULT NULL,
  `rent_amount` decimal(10,2) NOT NULL,
  `security_deposit` decimal(10,2) DEFAULT NULL,
  `utilities_included` json DEFAULT NULL,
  `bedrooms` decimal(2,1) DEFAULT NULL,
  `bathrooms` decimal(2,1) DEFAULT NULL,
  `square_feet` int DEFAULT NULL,
  `furnished` enum('unfurnished','partially','fully') COLLATE utf8mb4_unicode_ci DEFAULT 'unfurnished',
  `amenities` json DEFAULT NULL,
  `pet_policy` json DEFAULT NULL,
  `parking_spots` int DEFAULT '0',
  `lease_term_months` int DEFAULT NULL,
  `available_date` date DEFAULT NULL,
  `application_fee` decimal(10,2) DEFAULT NULL,
  `credit_check_required` tinyint(1) DEFAULT '1',
  `income_requirement` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `images` json DEFAULT NULL,
  `virtual_tour_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `contact_method` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `showing_times` json DEFAULT NULL,
  `applications_received` int DEFAULT '0',
  `status` enum('available','pending','rented','removed') COLLATE utf8mb4_unicode_ci DEFAULT 'available',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_landlord` (`landlord_id`),
  KEY `idx_type` (`listing_type`),
  KEY `idx_rent` (`rent_amount`),
  KEY `idx_bedrooms` (`bedrooms`),
  KEY `idx_available` (`available_date`),
  CONSTRAINT `housing_rentals_ibfk_1` FOREIGN KEY (`landlord_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: idea_pins
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:30:33 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	title	varchar(200)	NO	NULL			utf8mb4_unicode_ci	
4	pages	json	NO	NULL				
5	music_track	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
6	total_duration_seconds	int	YES	NULL				
7	topics	json	YES	NULL				
8	supplies	json	YES	NULL				
9	instructions	json	YES	NULL				
10	view_count	bigint	YES	0				
11	completion_rate	decimal(5,2)	YES	0.00				
12	is_published	tinyint(1)	YES	1		MUL		
13	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
14	expires_at	timestamp	YES	NULL				

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_published	NON_UNIQUE	BTREE	is_published	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
idea_pins_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `idea_pins` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `title` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `pages` json NOT NULL,
  `music_track` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `total_duration_seconds` int DEFAULT NULL,
  `topics` json DEFAULT NULL,
  `supplies` json DEFAULT NULL,
  `instructions` json DEFAULT NULL,
  `view_count` bigint DEFAULT '0',
  `completion_rate` decimal(5,2) DEFAULT '0.00',
  `is_published` tinyint(1) DEFAULT '1',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `expires_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_published` (`is_published`),
  CONSTRAINT `idea_pins_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: interest_tags
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 25 | DATA_MB: 0.02 | INDEX_MB: 0.02 | TOTAL_MB: 0.03 | AUTO_INCREMENT: 26 | COLLATION: utf8mb4_0900_ai_ci | CREATE: 2025-08-04 01:43:53 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	tag_name	varchar(50)	NO	NULL		UNI	utf8mb4_0900_ai_ci	
3	category	varchar(50)	YES	NULL			utf8mb4_0900_ai_ci	
4	usage_count	int	YES	0				
5	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	25
tag_name	UNIQUE	BTREE	tag_name	25

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `interest_tags` (
  `id` int NOT NULL AUTO_INCREMENT,
  `tag_name` varchar(50) NOT NULL,
  `category` varchar(50) DEFAULT NULL,
  `usage_count` int DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `tag_name` (`tag_name`)
) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;


============================================================
TABLE: inventory_locations
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:53:00 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	warehouse_id	int	NO	NULL		MUL		
3	product_id	bigint	NO	NULL		MUL		
4	location_code	varchar(50)	NO	NULL		MUL	utf8mb4_unicode_ci	
5	zone	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
6	aisle	varchar(20)	YES	NULL			utf8mb4_unicode_ci	
7	rack	varchar(20)	YES	NULL			utf8mb4_unicode_ci	
8	shelf	varchar(20)	YES	NULL			utf8mb4_unicode_ci	
9	bin	varchar(20)	YES	NULL			utf8mb4_unicode_ci	
10	quantity	int	YES	0				
11	reserved_quantity	int	YES	0				
12	last_counted	timestamp	YES	NULL				
13	last_movement	timestamp	YES	NULL				
14	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_location	NON_UNIQUE	BTREE	location_code	0
idx_product	NON_UNIQUE	BTREE	product_id	0
idx_warehouse	NON_UNIQUE	BTREE	warehouse_id	0
unique_location	UNIQUE	BTREE	warehouse_id, product_id, location_code	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
inventory_locations_ibfk_1	warehouse_id	warehouses	id	NO ACTION	NO ACTION
inventory_locations_ibfk_2	product_id	products_catalog	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `inventory_locations` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `warehouse_id` int NOT NULL,
  `product_id` bigint NOT NULL,
  `location_code` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `zone` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `aisle` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `rack` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `shelf` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `bin` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `quantity` int DEFAULT '0',
  `reserved_quantity` int DEFAULT '0',
  `last_counted` timestamp NULL DEFAULT NULL,
  `last_movement` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_location` (`warehouse_id`,`product_id`,`location_code`),
  KEY `idx_warehouse` (`warehouse_id`),
  KEY `idx_product` (`product_id`),
  KEY `idx_location` (`location_code`),
  CONSTRAINT `inventory_locations_ibfk_1` FOREIGN KEY (`warehouse_id`) REFERENCES `warehouses` (`id`),
  CONSTRAINT `inventory_locations_ibfk_2` FOREIGN KEY (`product_id`) REFERENCES `products_catalog` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: inventory_transfers
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.08 | TOTAL_MB: 0.09 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:53:00 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	from_warehouse_id	int	NO	NULL		MUL		
3	to_warehouse_id	int	NO	NULL		MUL		
4	transfer_number	varchar(50)	NO	NULL		UNI	utf8mb4_unicode_ci	
5	items	json	NO	NULL				
6	status	enum('planned','picking','in_transit','received','cancelled')	YES	planned		MUL	utf8mb4_unicode_ci	
7	shipped_date	timestamp	YES	NULL				
8	received_date	timestamp	YES	NULL				
9	shipping_method	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
10	tracking_number	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
11	notes	text	YES	NULL			utf8mb4_unicode_ci	
12	created_by	int	NO	NULL		MUL		
13	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
created_by	NON_UNIQUE	BTREE	created_by	0
idx_from	NON_UNIQUE	BTREE	from_warehouse_id	0
idx_status	NON_UNIQUE	BTREE	status	0
idx_to	NON_UNIQUE	BTREE	to_warehouse_id	0
transfer_number	UNIQUE	BTREE	transfer_number	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
inventory_transfers_ibfk_1	from_warehouse_id	warehouses	id	NO ACTION	NO ACTION
inventory_transfers_ibfk_2	to_warehouse_id	warehouses	id	NO ACTION	NO ACTION
inventory_transfers_ibfk_3	created_by	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `inventory_transfers` (
  `id` int NOT NULL AUTO_INCREMENT,
  `from_warehouse_id` int NOT NULL,
  `to_warehouse_id` int NOT NULL,
  `transfer_number` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `items` json NOT NULL,
  `status` enum('planned','picking','in_transit','received','cancelled') COLLATE utf8mb4_unicode_ci DEFAULT 'planned',
  `shipped_date` timestamp NULL DEFAULT NULL,
  `received_date` timestamp NULL DEFAULT NULL,
  `shipping_method` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tracking_number` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `created_by` int NOT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `transfer_number` (`transfer_number`),
  KEY `idx_from` (`from_warehouse_id`),
  KEY `idx_to` (`to_warehouse_id`),
  KEY `idx_status` (`status`),
  KEY `created_by` (`created_by`),
  CONSTRAINT `inventory_transfers_ibfk_1` FOREIGN KEY (`from_warehouse_id`) REFERENCES `warehouses` (`id`),
  CONSTRAINT `inventory_transfers_ibfk_2` FOREIGN KEY (`to_warehouse_id`) REFERENCES `warehouses` (`id`),
  CONSTRAINT `inventory_transfers_ibfk_3` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: investor_dashboard
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 16:04:26 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	investor_id	int	NO	NULL		UNI		
3	portfolio_value	decimal(20,2)	YES	0.00				
4	daily_change	decimal(12,2)	YES	0.00				
5	daily_change_percentage	decimal(10,2)	YES	0.00				
6	crypto_holdings	decimal(20,2)	YES	0.00				
7	nft_value	decimal(20,2)	YES	0.00				
8	staked_amount	decimal(20,2)	YES	0.00				
9	staking_rewards_month	decimal(12,2)	YES	0.00				
10	trades_today	int	YES	0				
11	profit_loss_week	decimal(12,2)	YES	0.00				
12	last_updated	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_investor	NON_UNIQUE	BTREE	investor_id	0
unique_investor	UNIQUE	BTREE	investor_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
investor_dashboard_ibfk_1	investor_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `investor_dashboard` (
  `id` int NOT NULL AUTO_INCREMENT,
  `investor_id` int NOT NULL,
  `portfolio_value` decimal(20,2) DEFAULT '0.00',
  `daily_change` decimal(12,2) DEFAULT '0.00',
  `daily_change_percentage` decimal(10,2) DEFAULT '0.00',
  `crypto_holdings` decimal(20,2) DEFAULT '0.00',
  `nft_value` decimal(20,2) DEFAULT '0.00',
  `staked_amount` decimal(20,2) DEFAULT '0.00',
  `staking_rewards_month` decimal(12,2) DEFAULT '0.00',
  `trades_today` int DEFAULT '0',
  `profit_loss_week` decimal(12,2) DEFAULT '0.00',
  `last_updated` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_investor` (`investor_id`),
  KEY `idx_investor` (`investor_id`),
  CONSTRAINT `investor_dashboard_ibfk_1` FOREIGN KEY (`investor_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: jackpot_contributions
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:59:31 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	jackpot_id	int	NO	NULL		MUL		
3	user_id	int	NO	NULL		MUL		
4	game_id	int	NO	NULL		MUL		
5	round_id	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
6	contribution_amount	decimal(20,2)	NO	NULL				
7	bet_amount	decimal(20,2)	NO	NULL				
8	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_game	NON_UNIQUE	BTREE	game_id	0
idx_jackpot	NON_UNIQUE	BTREE	jackpot_id	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
jackpot_contributions_ibfk_1	jackpot_id	progressive_jackpots	id	NO ACTION	NO ACTION
jackpot_contributions_ibfk_2	user_id	users	id	NO ACTION	NO ACTION
jackpot_contributions_ibfk_3	game_id	casino_games	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `jackpot_contributions` (
  `id` int NOT NULL AUTO_INCREMENT,
  `jackpot_id` int NOT NULL,
  `user_id` int NOT NULL,
  `game_id` int NOT NULL,
  `round_id` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `contribution_amount` decimal(20,2) NOT NULL,
  `bet_amount` decimal(20,2) NOT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_jackpot` (`jackpot_id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_game` (`game_id`),
  CONSTRAINT `jackpot_contributions_ibfk_1` FOREIGN KEY (`jackpot_id`) REFERENCES `progressive_jackpots` (`id`),
  CONSTRAINT `jackpot_contributions_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
  CONSTRAINT `jackpot_contributions_ibfk_3` FOREIGN KEY (`game_id`) REFERENCES `casino_games` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: jackpot_winners
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:59:42 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	jackpot_id	int	NO	NULL		MUL		
3	user_id	int	NO	NULL		MUL		
4	game_id	int	NO	NULL		MUL		
5	amount_won	decimal(20,2)	NO	NULL		MUL		
6	bet_amount	decimal(20,2)	NO	NULL				
7	round_id	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
8	game_data	json	YES	NULL				
9	screenshot_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
10	is_verified	tinyint(1)	YES	0				
11	is_paid	tinyint(1)	YES	0				
12	paid_at	timestamp	YES	NULL				
13	won_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
game_id	NON_UNIQUE	BTREE	game_id	0
idx_amount	NON_UNIQUE	BTREE	amount_won	0
idx_jackpot	NON_UNIQUE	BTREE	jackpot_id	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
jackpot_winners_ibfk_1	jackpot_id	progressive_jackpots	id	NO ACTION	NO ACTION
jackpot_winners_ibfk_2	user_id	users	id	NO ACTION	NO ACTION
jackpot_winners_ibfk_3	game_id	casino_games	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `jackpot_winners` (
  `id` int NOT NULL AUTO_INCREMENT,
  `jackpot_id` int NOT NULL,
  `user_id` int NOT NULL,
  `game_id` int NOT NULL,
  `amount_won` decimal(20,2) NOT NULL,
  `bet_amount` decimal(20,2) NOT NULL,
  `round_id` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `game_data` json DEFAULT NULL,
  `screenshot_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_verified` tinyint(1) DEFAULT '0',
  `is_paid` tinyint(1) DEFAULT '0',
  `paid_at` timestamp NULL DEFAULT NULL,
  `won_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_jackpot` (`jackpot_id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_amount` (`amount_won`),
  KEY `game_id` (`game_id`),
  CONSTRAINT `jackpot_winners_ibfk_1` FOREIGN KEY (`jackpot_id`) REFERENCES `progressive_jackpots` (`id`),
  CONSTRAINT `jackpot_winners_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
  CONSTRAINT `jackpot_winners_ibfk_3` FOREIGN KEY (`game_id`) REFERENCES `casino_games` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: job_postings
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.11 | TOTAL_MB: 0.13 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:52:18 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	employer_id	int	NO	NULL		MUL		
3	company_name	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
4	job_title	varchar(200)	NO	NULL		MUL	utf8mb4_unicode_ci	
5	job_category	varchar(100)	YES	NULL		MUL	utf8mb4_unicode_ci	
6	employment_type	enum('full_time','part_time','contract','temporary','internship','volunteer')	NO	NULL		MUL	utf8mb4_unicode_ci	
7	description	text	YES	NULL			utf8mb4_unicode_ci	
8	requirements	text	YES	NULL			utf8mb4_unicode_ci	
9	responsibilities	text	YES	NULL			utf8mb4_unicode_ci	
10	qualifications	text	YES	NULL			utf8mb4_unicode_ci	
11	salary_min	decimal(10,2)	YES	NULL		MUL		
12	salary_max	decimal(10,2)	YES	NULL				
13	salary_period	enum('hourly','daily','weekly','monthly','yearly')	YES	yearly			utf8mb4_unicode_ci	
14	benefits	json	YES	NULL				
15	location	varchar(200)	YES	NULL		MUL	utf8mb4_unicode_ci	
16	remote_option	enum('onsite','remote','hybrid')	YES	onsite			utf8mb4_unicode_ci	
17	application_method	enum('email','website','in_person','phone')	YES	email			utf8mb4_unicode_ci	
18	application_email	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
19	application_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
20	application_deadline	date	YES	NULL				
21	start_date	date	YES	NULL				
22	experience_required	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
23	education_required	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
24	skills_required	json	YES	NULL				
25	languages_required	json	YES	NULL				
26	background_check	tinyint(1)	YES	0				
27	drug_test	tinyint(1)	YES	0				
28	view_count	int	YES	0				
29	application_count	int	YES	0				
30	is_featured	tinyint(1)	YES	0				
31	status	enum('active','filled','expired','removed')	YES	active			utf8mb4_unicode_ci	
32	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
33	expires_at	timestamp	YES	NULL				

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_category	NON_UNIQUE	BTREE	job_category	0
idx_employer	NON_UNIQUE	BTREE	employer_id	0
idx_location	NON_UNIQUE	BTREE	location	0
idx_salary	NON_UNIQUE	BTREE	salary_min, salary_max	0
idx_search	NON_UNIQUE	FULLTEXT	job_title, description	0
idx_type	NON_UNIQUE	BTREE	employment_type	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
job_postings_ibfk_1	employer_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `job_postings` (
  `id` int NOT NULL AUTO_INCREMENT,
  `employer_id` int NOT NULL,
  `company_name` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `job_title` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `job_category` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `employment_type` enum('full_time','part_time','contract','temporary','internship','volunteer') COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `requirements` text COLLATE utf8mb4_unicode_ci,
  `responsibilities` text COLLATE utf8mb4_unicode_ci,
  `qualifications` text COLLATE utf8mb4_unicode_ci,
  `salary_min` decimal(10,2) DEFAULT NULL,
  `salary_max` decimal(10,2) DEFAULT NULL,
  `salary_period` enum('hourly','daily','weekly','monthly','yearly') COLLATE utf8mb4_unicode_ci DEFAULT 'yearly',
  `benefits` json DEFAULT NULL,
  `location` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `remote_option` enum('onsite','remote','hybrid') COLLATE utf8mb4_unicode_ci DEFAULT 'onsite',
  `application_method` enum('email','website','in_person','phone') COLLATE utf8mb4_unicode_ci DEFAULT 'email',
  `application_email` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `application_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `application_deadline` date DEFAULT NULL,
  `start_date` date DEFAULT NULL,
  `experience_required` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `education_required` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `skills_required` json DEFAULT NULL,
  `languages_required` json DEFAULT NULL,
  `background_check` tinyint(1) DEFAULT '0',
  `drug_test` tinyint(1) DEFAULT '0',
  `view_count` int DEFAULT '0',
  `application_count` int DEFAULT '0',
  `is_featured` tinyint(1) DEFAULT '0',
  `status` enum('active','filled','expired','removed') COLLATE utf8mb4_unicode_ci DEFAULT 'active',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `expires_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_employer` (`employer_id`),
  KEY `idx_category` (`job_category`),
  KEY `idx_type` (`employment_type`),
  KEY `idx_location` (`location`),
  KEY `idx_salary` (`salary_min`,`salary_max`),
  FULLTEXT KEY `idx_search` (`job_title`,`description`),
  CONSTRAINT `job_postings_ibfk_1` FOREIGN KEY (`employer_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: kpi_definitions
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 16:04:49 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	kpi_name	varchar(200)	NO	NULL			utf8mb4_unicode_ci	
3	kpi_category	varchar(100)	YES	NULL		MUL	utf8mb4_unicode_ci	
4	calculation_formula	text	NO	NULL			utf8mb4_unicode_ci	
5	data_sources	json	YES	NULL				
6	target_value	decimal(20,4)	YES	NULL				
7	threshold_warning	decimal(20,4)	YES	NULL				
8	threshold_critical	decimal(20,4)	YES	NULL				
9	measurement_unit	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
10	frequency	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
11	owner	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
12	is_active	tinyint(1)	YES	1		MUL		
13	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_active	NON_UNIQUE	BTREE	is_active	0
idx_category	NON_UNIQUE	BTREE	kpi_category	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `kpi_definitions` (
  `id` int NOT NULL AUTO_INCREMENT,
  `kpi_name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `kpi_category` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `calculation_formula` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `data_sources` json DEFAULT NULL,
  `target_value` decimal(20,4) DEFAULT NULL,
  `threshold_warning` decimal(20,4) DEFAULT NULL,
  `threshold_critical` decimal(20,4) DEFAULT NULL,
  `measurement_unit` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `frequency` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `owner` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT '1',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_category` (`kpi_category`),
  KEY `idx_active` (`is_active`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: kpi_values
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 16:04:49 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	kpi_id	int	NO	NULL		MUL		
3	measurement_date	date	NO	NULL		MUL		
4	value	decimal(20,4)	NO	NULL				
5	target_value	decimal(20,4)	YES	NULL				
6	variance	decimal(20,4)	YES	NULL				
7	variance_percentage	decimal(10,2)	YES	NULL				
8	status	enum('on_target','warning','critical')	YES	on_target		MUL	utf8mb4_unicode_ci	
9	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_date	NON_UNIQUE	BTREE	measurement_date	0
idx_kpi	NON_UNIQUE	BTREE	kpi_id	0
idx_status	NON_UNIQUE	BTREE	status	0
unique_kpi_date	UNIQUE	BTREE	kpi_id, measurement_date	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
kpi_values_ibfk_1	kpi_id	kpi_definitions	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `kpi_values` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `kpi_id` int NOT NULL,
  `measurement_date` date NOT NULL,
  `value` decimal(20,4) NOT NULL,
  `target_value` decimal(20,4) DEFAULT NULL,
  `variance` decimal(20,4) DEFAULT NULL,
  `variance_percentage` decimal(10,2) DEFAULT NULL,
  `status` enum('on_target','warning','critical') COLLATE utf8mb4_unicode_ci DEFAULT 'on_target',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_kpi_date` (`kpi_id`,`measurement_date`),
  KEY `idx_kpi` (`kpi_id`),
  KEY `idx_date` (`measurement_date`),
  KEY `idx_status` (`status`),
  CONSTRAINT `kpi_values_ibfk_1` FOREIGN KEY (`kpi_id`) REFERENCES `kpi_definitions` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: kyc_verification
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 03:01:05 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		UNI		
3	verification_level	int	YES	0				
4	first_name	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
5	last_name	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
6	date_of_birth	date	YES	NULL				
7	ssn_last_four	varchar(4)	YES	NULL			utf8mb4_unicode_ci	
8	address_line1	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
9	address_line2	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
10	city	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
11	state	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
12	zip_code	varchar(20)	YES	NULL			utf8mb4_unicode_ci	
13	country	varchar(2)	YES	NULL			utf8mb4_unicode_ci	
14	phone_number	varchar(20)	YES	NULL			utf8mb4_unicode_ci	
15	document_type	enum('passport','driver_license','national_id')	NO	NULL			utf8mb4_unicode_ci	
16	document_number_encrypted	text	YES	NULL			utf8mb4_unicode_ci	
17	document_front_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
18	document_back_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
19	selfie_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
20	proof_of_address_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
21	verification_status	enum('pending','approved','rejected','expired')	YES	pending		MUL	utf8mb4_unicode_ci	
22	rejection_reason	text	YES	NULL			utf8mb4_unicode_ci	
23	verified_by	int	YES	NULL		MUL		
24	verified_at	timestamp	YES	NULL				
25	expires_at	date	YES	NULL				
26	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
27	updated_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_status	NON_UNIQUE	BTREE	verification_status	0
idx_user	NON_UNIQUE	BTREE	user_id	0
user_id	UNIQUE	BTREE	user_id	0
verified_by	NON_UNIQUE	BTREE	verified_by	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
kyc_verification_ibfk_1	user_id	users	id	NO ACTION	NO ACTION
kyc_verification_ibfk_2	verified_by	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `kyc_verification` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `verification_level` int DEFAULT '0',
  `first_name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `last_name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `date_of_birth` date DEFAULT NULL,
  `ssn_last_four` varchar(4) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address_line1` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address_line2` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `city` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `state` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `zip_code` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `country` varchar(2) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone_number` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `document_type` enum('passport','driver_license','national_id') COLLATE utf8mb4_unicode_ci NOT NULL,
  `document_number_encrypted` text COLLATE utf8mb4_unicode_ci,
  `document_front_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `document_back_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `selfie_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `proof_of_address_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `verification_status` enum('pending','approved','rejected','expired') COLLATE utf8mb4_unicode_ci DEFAULT 'pending',
  `rejection_reason` text COLLATE utf8mb4_unicode_ci,
  `verified_by` int DEFAULT NULL,
  `verified_at` timestamp NULL DEFAULT NULL,
  `expires_at` date DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_id` (`user_id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_status` (`verification_status`),
  KEY `verified_by` (`verified_by`),
  CONSTRAINT `kyc_verification_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
  CONSTRAINT `kyc_verification_ibfk_2` FOREIGN KEY (`verified_by`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: leaderboard_weekly
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-07 01:09:42 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	week_start	date	NO	NULL		MUL		
4	score	int	YES	0		MUL		
5	rank	int	YES	NULL				
6	activities_count	int	YES	0				
7	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
8	updated_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_score	NON_UNIQUE	BTREE	score	0
idx_week	NON_UNIQUE	BTREE	week_start	0
unique_user_week	UNIQUE	BTREE	user_id, week_start	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
leaderboard_weekly_ibfk_1	user_id	users	id	NO ACTION	CASCADE

--- SHOW CREATE TABLE ---
CREATE TABLE `leaderboard_weekly` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `week_start` date NOT NULL,
  `score` int DEFAULT '0',
  `rank` int DEFAULT NULL,
  `activities_count` int DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_user_week` (`user_id`,`week_start`),
  KEY `idx_week` (`week_start`),
  KEY `idx_score` (`score` DESC),
  CONSTRAINT `leaderboard_weekly_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: list_members
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:27:53 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	list_id	int	NO	NULL		MUL		
3	user_id	int	NO	NULL		MUL		
4	added_by	int	NO	NULL		MUL		
5	added_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
added_by	NON_UNIQUE	BTREE	added_by	0
idx_list	NON_UNIQUE	BTREE	list_id	0
idx_user	NON_UNIQUE	BTREE	user_id	0
unique_list_member	UNIQUE	BTREE	list_id, user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
list_members_ibfk_1	list_id	lists	id	NO ACTION	CASCADE
list_members_ibfk_2	user_id	users	id	NO ACTION	NO ACTION
list_members_ibfk_3	added_by	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `list_members` (
  `id` int NOT NULL AUTO_INCREMENT,
  `list_id` int NOT NULL,
  `user_id` int NOT NULL,
  `added_by` int NOT NULL,
  `added_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_list_member` (`list_id`,`user_id`),
  KEY `idx_list` (`list_id`),
  KEY `idx_user` (`user_id`),
  KEY `added_by` (`added_by`),
  CONSTRAINT `list_members_ibfk_1` FOREIGN KEY (`list_id`) REFERENCES `lists` (`id`) ON DELETE CASCADE,
  CONSTRAINT `list_members_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
  CONSTRAINT `list_members_ibfk_3` FOREIGN KEY (`added_by`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: listening_history
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:12:57 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	content_type	enum('track','episode','radio','live')	NO	NULL		MUL	utf8mb4_unicode_ci	
4	content_id	int	NO	NULL				
5	played_duration_seconds	int	YES	0				
6	total_duration_seconds	int	YES	NULL				
7	completion_percentage	decimal(5,2)	YES	0.00				
8	device_type	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
9	quality	varchar(20)	YES	NULL			utf8mb4_unicode_ci	
10	source	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
11	context	json	YES	NULL				
12	skipped	tinyint(1)	YES	0				
13	repeated_count	int	YES	0				
14	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED	MUL		

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_content	NON_UNIQUE	BTREE	content_type, content_id	0
idx_created	NON_UNIQUE	BTREE	created_at	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
listening_history_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `listening_history` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `content_type` enum('track','episode','radio','live') COLLATE utf8mb4_unicode_ci NOT NULL,
  `content_id` int NOT NULL,
  `played_duration_seconds` int DEFAULT '0',
  `total_duration_seconds` int DEFAULT NULL,
  `completion_percentage` decimal(5,2) DEFAULT '0.00',
  `device_type` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `quality` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `source` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `context` json DEFAULT NULL,
  `skipped` tinyint(1) DEFAULT '0',
  `repeated_count` int DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_content` (`content_type`,`content_id`),
  KEY `idx_created` (`created_at`),
  CONSTRAINT `listening_history_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: lists
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:27:53 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	owner_id	int	NO	NULL		MUL		
3	list_name	varchar(100)	NO	NULL			utf8mb4_unicode_ci	
4	list_description	text	YES	NULL			utf8mb4_unicode_ci	
5	cover_image	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
6	is_private	tinyint(1)	YES	0		MUL		
7	member_count	int	YES	0				
8	subscriber_count	int	YES	0				
9	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_owner	NON_UNIQUE	BTREE	owner_id	0
idx_private	NON_UNIQUE	BTREE	is_private	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
lists_ibfk_1	owner_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `lists` (
  `id` int NOT NULL AUTO_INCREMENT,
  `owner_id` int NOT NULL,
  `list_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `list_description` text COLLATE utf8mb4_unicode_ci,
  `cover_image` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_private` tinyint(1) DEFAULT '0',
  `member_count` int DEFAULT '0',
  `subscriber_count` int DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_owner` (`owner_id`),
  KEY `idx_private` (`is_private`),
  CONSTRAINT `lists_ibfk_1` FOREIGN KEY (`owner_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: live_battles
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.08 | TOTAL_MB: 0.09 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:48:51 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	room_code	varchar(20)	NO	NULL		UNI	utf8mb4_unicode_ci	
3	host1_id	int	NO	NULL		MUL		
4	host2_id	int	NO	NULL		MUL		
5	battle_type	enum('pk','talent','beauty','singing','dancing')	YES	pk			utf8mb4_unicode_ci	
6	duration_minutes	int	YES	5				
7	host1_score	int	YES	0				
8	host2_score	int	YES	0				
9	host1_gifts	json	YES	NULL				
10	host2_gifts	json	YES	NULL				
11	winner_id	int	YES	NULL		MUL		
12	prize_coins	int	YES	NULL				
13	viewer_count	int	YES	0				
14	status	enum('waiting','ongoing','finished','cancelled')	YES	waiting		MUL	utf8mb4_unicode_ci	
15	started_at	timestamp	YES	NULL				
16	ended_at	timestamp	YES	NULL				
17	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
host2_id	NON_UNIQUE	BTREE	host2_id	0
idx_hosts	NON_UNIQUE	BTREE	host1_id, host2_id	0
idx_status	NON_UNIQUE	BTREE	status	0
room_code	UNIQUE	BTREE	room_code	0
winner_id	NON_UNIQUE	BTREE	winner_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
live_battles_ibfk_1	host1_id	users	id	NO ACTION	NO ACTION
live_battles_ibfk_2	host2_id	users	id	NO ACTION	NO ACTION
live_battles_ibfk_3	winner_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `live_battles` (
  `id` int NOT NULL AUTO_INCREMENT,
  `room_code` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `host1_id` int NOT NULL,
  `host2_id` int NOT NULL,
  `battle_type` enum('pk','talent','beauty','singing','dancing') COLLATE utf8mb4_unicode_ci DEFAULT 'pk',
  `duration_minutes` int DEFAULT '5',
  `host1_score` int DEFAULT '0',
  `host2_score` int DEFAULT '0',
  `host1_gifts` json DEFAULT NULL,
  `host2_gifts` json DEFAULT NULL,
  `winner_id` int DEFAULT NULL,
  `prize_coins` int DEFAULT NULL,
  `viewer_count` int DEFAULT '0',
  `status` enum('waiting','ongoing','finished','cancelled') COLLATE utf8mb4_unicode_ci DEFAULT 'waiting',
  `started_at` timestamp NULL DEFAULT NULL,
  `ended_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `room_code` (`room_code`),
  KEY `idx_hosts` (`host1_id`,`host2_id`),
  KEY `idx_status` (`status`),
  KEY `host2_id` (`host2_id`),
  KEY `winner_id` (`winner_id`),
  CONSTRAINT `live_battles_ibfk_1` FOREIGN KEY (`host1_id`) REFERENCES `users` (`id`),
  CONSTRAINT `live_battles_ibfk_2` FOREIGN KEY (`host2_id`) REFERENCES `users` (`id`),
  CONSTRAINT `live_battles_ibfk_3` FOREIGN KEY (`winner_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: live_classes
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:11:42 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	course_id	int	YES	NULL		MUL		
3	instructor_id	int	NO	NULL		MUL		
4	title	varchar(200)	NO	NULL			utf8mb4_unicode_ci	
5	description	text	YES	NULL			utf8mb4_unicode_ci	
6	meeting_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
7	meeting_password	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
8	scheduled_time	timestamp	NO	NULL		MUL		
9	duration_minutes	int	YES	60				
10	max_students	int	YES	100				
11	enrolled_students	int	YES	0				
12	recording_available	tinyint(1)	YES	1				
13	recording_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
14	materials	json	YES	NULL				
15	is_recurring	tinyint(1)	YES	0				
16	recurrence_pattern	json	YES	NULL				
17	status	enum('scheduled','live','completed','cancelled')	YES	scheduled		MUL	utf8mb4_unicode_ci	
18	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
course_id	NON_UNIQUE	BTREE	course_id	0
idx_instructor	NON_UNIQUE	BTREE	instructor_id	0
idx_scheduled	NON_UNIQUE	BTREE	scheduled_time	0
idx_status	NON_UNIQUE	BTREE	status	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
live_classes_ibfk_1	course_id	courses	id	NO ACTION	NO ACTION
live_classes_ibfk_2	instructor_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `live_classes` (
  `id` int NOT NULL AUTO_INCREMENT,
  `course_id` int DEFAULT NULL,
  `instructor_id` int NOT NULL,
  `title` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `meeting_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `meeting_password` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `scheduled_time` timestamp NOT NULL,
  `duration_minutes` int DEFAULT '60',
  `max_students` int DEFAULT '100',
  `enrolled_students` int DEFAULT '0',
  `recording_available` tinyint(1) DEFAULT '1',
  `recording_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `materials` json DEFAULT NULL,
  `is_recurring` tinyint(1) DEFAULT '0',
  `recurrence_pattern` json DEFAULT NULL,
  `status` enum('scheduled','live','completed','cancelled') COLLATE utf8mb4_unicode_ci DEFAULT 'scheduled',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_instructor` (`instructor_id`),
  KEY `idx_scheduled` (`scheduled_time`),
  KEY `idx_status` (`status`),
  KEY `course_id` (`course_id`),
  CONSTRAINT `live_classes_ibfk_1` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`),
  CONSTRAINT `live_classes_ibfk_2` FOREIGN KEY (`instructor_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: live_dealer_bets
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 03:03:34 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	table_id	int	NO	NULL		MUL		
3	user_id	int	NO	NULL		MUL		
4	round_number	varchar(50)	NO	NULL		MUL	utf8mb4_unicode_ci	
5	bet_type	varchar(50)	NO	NULL			utf8mb4_unicode_ci	
6	bet_position	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
7	bet_amount	decimal(20,2)	NO	NULL				
8	win_amount	decimal(20,2)	YES	0.00				
9	cards_dealt	json	YES	NULL				
10	result	json	YES	NULL				
11	dealer_cards	json	YES	NULL				
12	is_winner	tinyint(1)	YES	0				
13	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_round	NON_UNIQUE	BTREE	round_number	0
idx_table	NON_UNIQUE	BTREE	table_id	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
live_dealer_bets_ibfk_1	table_id	live_dealer_tables	id	NO ACTION	NO ACTION
live_dealer_bets_ibfk_2	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `live_dealer_bets` (
  `id` int NOT NULL AUTO_INCREMENT,
  `table_id` int NOT NULL,
  `user_id` int NOT NULL,
  `round_number` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `bet_type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `bet_position` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `bet_amount` decimal(20,2) NOT NULL,
  `win_amount` decimal(20,2) DEFAULT '0.00',
  `cards_dealt` json DEFAULT NULL,
  `result` json DEFAULT NULL,
  `dealer_cards` json DEFAULT NULL,
  `is_winner` tinyint(1) DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_table` (`table_id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_round` (`round_number`),
  CONSTRAINT `live_dealer_bets_ibfk_1` FOREIGN KEY (`table_id`) REFERENCES `live_dealer_tables` (`id`),
  CONSTRAINT `live_dealer_bets_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: live_dealer_tables
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 03:03:18 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	table_code	varchar(50)	NO	NULL		UNI	utf8mb4_unicode_ci	
3	game_type	enum('blackjack','roulette','baccarat','poker','dragon_tiger','sic_bo')	NO	NULL		MUL	utf8mb4_unicode_ci	
4	dealer_name	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
5	dealer_photo	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
6	stream_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
7	min_bet	decimal(10,2)	NO	NULL				
8	max_bet	decimal(10,2)	NO	NULL				
9	seats_total	int	YES	7				
10	seats_occupied	int	YES	0				
11	current_players	json	YES	NULL				
12	table_limits	json	YES	NULL				
13	language	varchar(10)	YES	en			utf8mb4_unicode_ci	
14	studio_location	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
15	is_vip	tinyint(1)	YES	0		MUL		
16	is_private	tinyint(1)	YES	0				
17	status	enum('open','full','closed','maintenance')	YES	open		MUL	utf8mb4_unicode_ci	
18	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_game	NON_UNIQUE	BTREE	game_type	0
idx_status	NON_UNIQUE	BTREE	status	0
idx_vip	NON_UNIQUE	BTREE	is_vip	0
table_code	UNIQUE	BTREE	table_code	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `live_dealer_tables` (
  `id` int NOT NULL AUTO_INCREMENT,
  `table_code` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `game_type` enum('blackjack','roulette','baccarat','poker','dragon_tiger','sic_bo') COLLATE utf8mb4_unicode_ci NOT NULL,
  `dealer_name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `dealer_photo` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `stream_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `min_bet` decimal(10,2) NOT NULL,
  `max_bet` decimal(10,2) NOT NULL,
  `seats_total` int DEFAULT '7',
  `seats_occupied` int DEFAULT '0',
  `current_players` json DEFAULT NULL,
  `table_limits` json DEFAULT NULL,
  `language` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT 'en',
  `studio_location` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_vip` tinyint(1) DEFAULT '0',
  `is_private` tinyint(1) DEFAULT '0',
  `status` enum('open','full','closed','maintenance') COLLATE utf8mb4_unicode_ci DEFAULT 'open',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `table_code` (`table_code`),
  KEY `idx_game` (`game_type`),
  KEY `idx_status` (`status`),
  KEY `idx_vip` (`is_vip`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: live_streams
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:43:44 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	streamer_id	int	NO	NULL		MUL		
3	stream_key	varchar(100)	NO	NULL		UNI	utf8mb4_unicode_ci	
4	title	varchar(200)	NO	NULL			utf8mb4_unicode_ci	
5	description	text	YES	NULL			utf8mb4_unicode_ci	
6	category	varchar(50)	YES	NULL		MUL	utf8mb4_unicode_ci	
7	tags	json	YES	NULL				
8	thumbnail_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
9	stream_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
10	viewer_count	int	YES	0				
11	peak_viewers	int	YES	0				
12	likes_count	int	YES	0				
13	gifts_received	json	YES	NULL				
14	total_coins_received	int	YES	0				
15	is_nsfw	tinyint(1)	YES	0				
16	is_private	tinyint(1)	YES	0				
17	password_hash	varchar(255)	YES	NULL			utf8mb4_unicode_ci	
18	min_level_required	int	YES	0				
19	chat_enabled	tinyint(1)	YES	1				
20	donations_enabled	tinyint(1)	YES	1				
21	status	enum('preparing','live','ended','interrupted')	YES	preparing		MUL	utf8mb4_unicode_ci	
22	started_at	timestamp	YES	NULL				
23	ended_at	timestamp	YES	NULL				
24	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_category	NON_UNIQUE	BTREE	category	0
idx_status	NON_UNIQUE	BTREE	status	0
idx_streamer	NON_UNIQUE	BTREE	streamer_id	0
stream_key	UNIQUE	BTREE	stream_key	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
live_streams_ibfk_1	streamer_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `live_streams` (
  `id` int NOT NULL AUTO_INCREMENT,
  `streamer_id` int NOT NULL,
  `stream_key` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `title` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `category` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tags` json DEFAULT NULL,
  `thumbnail_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `stream_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `viewer_count` int DEFAULT '0',
  `peak_viewers` int DEFAULT '0',
  `likes_count` int DEFAULT '0',
  `gifts_received` json DEFAULT NULL,
  `total_coins_received` int DEFAULT '0',
  `is_nsfw` tinyint(1) DEFAULT '0',
  `is_private` tinyint(1) DEFAULT '0',
  `password_hash` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `min_level_required` int DEFAULT '0',
  `chat_enabled` tinyint(1) DEFAULT '1',
  `donations_enabled` tinyint(1) DEFAULT '1',
  `status` enum('preparing','live','ended','interrupted') COLLATE utf8mb4_unicode_ci DEFAULT 'preparing',
  `started_at` timestamp NULL DEFAULT NULL,
  `ended_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `stream_key` (`stream_key`),
  KEY `idx_streamer` (`streamer_id`),
  KEY `idx_status` (`status`),
  KEY `idx_category` (`category`),
  CONSTRAINT `live_streams_ibfk_1` FOREIGN KEY (`streamer_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: local_classifieds
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.11 | TOTAL_MB: 0.13 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:52:17 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	poster_id	int	NO	NULL		MUL		
3	category	varchar(100)	NO	NULL		MUL	utf8mb4_unicode_ci	
4	subcategory	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
5	title	varchar(300)	NO	NULL		MUL	utf8mb4_unicode_ci	
6	description	text	YES	NULL			utf8mb4_unicode_ci	
7	price	decimal(12,2)	YES	NULL		MUL		
8	price_negotiable	tinyint(1)	YES	1				
9	trade_accepted	tinyint(1)	YES	0				
10	trade_items	text	YES	NULL			utf8mb4_unicode_ci	
11	condition_notes	text	YES	NULL			utf8mb4_unicode_ci	
12	images	json	YES	NULL				
13	location_area	varchar(200)	NO	NULL		MUL	utf8mb4_unicode_ci	
14	location_neighborhood	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
15	location_zip	varchar(20)	YES	NULL			utf8mb4_unicode_ci	
16	location_coords	json	YES	NULL				
17	hide_precise_location	tinyint(1)	YES	1				
18	contact_method	enum('email','phone','text','platform_message')	YES	email			utf8mb4_unicode_ci	
19	contact_phone	varchar(20)	YES	NULL			utf8mb4_unicode_ci	
20	contact_email	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
21	contact_name	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
22	show_phone_number	tinyint(1)	YES	0				
23	available_times	text	YES	NULL			utf8mb4_unicode_ci	
24	is_urgent	tinyint(1)	YES	0				
25	is_featured	tinyint(1)	YES	0				
26	view_count	int	YES	0				
27	reply_count	int	YES	0				
28	flag_count	int	YES	0				
29	status	enum('active','sold','expired','removed','flagged')	YES	active		MUL	utf8mb4_unicode_ci	
30	expires_at	timestamp	YES	NULL				
31	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_category	NON_UNIQUE	BTREE	category	0
idx_location	NON_UNIQUE	BTREE	location_area	0
idx_poster	NON_UNIQUE	BTREE	poster_id	0
idx_price	NON_UNIQUE	BTREE	price	0
idx_search	NON_UNIQUE	FULLTEXT	title, description	0
idx_status	NON_UNIQUE	BTREE	status	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
local_classifieds_ibfk_1	poster_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `local_classifieds` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `poster_id` int NOT NULL,
  `category` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `subcategory` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `title` varchar(300) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `price` decimal(12,2) DEFAULT NULL,
  `price_negotiable` tinyint(1) DEFAULT '1',
  `trade_accepted` tinyint(1) DEFAULT '0',
  `trade_items` text COLLATE utf8mb4_unicode_ci,
  `condition_notes` text COLLATE utf8mb4_unicode_ci,
  `images` json DEFAULT NULL,
  `location_area` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `location_neighborhood` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `location_zip` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `location_coords` json DEFAULT NULL,
  `hide_precise_location` tinyint(1) DEFAULT '1',
  `contact_method` enum('email','phone','text','platform_message') COLLATE utf8mb4_unicode_ci DEFAULT 'email',
  `contact_phone` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `contact_email` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `contact_name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `show_phone_number` tinyint(1) DEFAULT '0',
  `available_times` text COLLATE utf8mb4_unicode_ci,
  `is_urgent` tinyint(1) DEFAULT '0',
  `is_featured` tinyint(1) DEFAULT '0',
  `view_count` int DEFAULT '0',
  `reply_count` int DEFAULT '0',
  `flag_count` int DEFAULT '0',
  `status` enum('active','sold','expired','removed','flagged') COLLATE utf8mb4_unicode_ci DEFAULT 'active',
  `expires_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_poster` (`poster_id`),
  KEY `idx_category` (`category`),
  KEY `idx_location` (`location_area`),
  KEY `idx_status` (`status`),
  KEY `idx_price` (`price`),
  FULLTEXT KEY `idx_search` (`title`,`description`),
  CONSTRAINT `local_classifieds_ibfk_1` FOREIGN KEY (`poster_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: login_attempts
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.02 | TOTAL_MB: 0.03 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_0900_ai_ci | CREATE: 2025-08-04 00:34:36 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	ip_address	varchar(45)	YES	NULL		MUL	utf8mb4_0900_ai_ci	
3	email	varchar(100)	YES	NULL			utf8mb4_0900_ai_ci	
4	attempted_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_ip_time	NON_UNIQUE	BTREE	ip_address, attempted_at	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `login_attempts` (
  `id` int NOT NULL AUTO_INCREMENT,
  `ip_address` varchar(45) DEFAULT NULL,
  `email` varchar(100) DEFAULT NULL,
  `attempted_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_ip_time` (`ip_address`,`attempted_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;


============================================================
TABLE: lottery_draws
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 03:01:59 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	lottery_name	varchar(100)	NO	NULL		MUL	utf8mb4_unicode_ci	
3	draw_number	int	NO	NULL				
4	ticket_price	decimal(10,2)	NO	NULL				
5	jackpot_amount	decimal(20,2)	NO	NULL				
6	numbers_drawn	json	YES	NULL				
7	bonus_numbers	json	YES	NULL				
8	draw_date	timestamp	NO	NULL		MUL		
9	tickets_sold	int	YES	0				
10	winners_data	json	YES	NULL				
11	next_draw_date	timestamp	YES	NULL				
12	next_jackpot_estimate	decimal(20,2)	YES	NULL				
13	status	enum('upcoming','active','drawing','completed')	YES	upcoming		MUL	utf8mb4_unicode_ci	
14	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_date	NON_UNIQUE	BTREE	draw_date	0
idx_status	NON_UNIQUE	BTREE	status	0
unique_draw	UNIQUE	BTREE	lottery_name, draw_number	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `lottery_draws` (
  `id` int NOT NULL AUTO_INCREMENT,
  `lottery_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `draw_number` int NOT NULL,
  `ticket_price` decimal(10,2) NOT NULL,
  `jackpot_amount` decimal(20,2) NOT NULL,
  `numbers_drawn` json DEFAULT NULL,
  `bonus_numbers` json DEFAULT NULL,
  `draw_date` timestamp NOT NULL,
  `tickets_sold` int DEFAULT '0',
  `winners_data` json DEFAULT NULL,
  `next_draw_date` timestamp NULL DEFAULT NULL,
  `next_jackpot_estimate` decimal(20,2) DEFAULT NULL,
  `status` enum('upcoming','active','drawing','completed') COLLATE utf8mb4_unicode_ci DEFAULT 'upcoming',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_draw` (`lottery_name`,`draw_number`),
  KEY `idx_status` (`status`),
  KEY `idx_date` (`draw_date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: lottery_tickets
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 03:02:12 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	ticket_number	varchar(50)	NO	NULL		UNI	utf8mb4_unicode_ci	
3	draw_id	int	NO	NULL		MUL		
4	user_id	int	NO	NULL		MUL		
5	numbers_selected	json	NO	NULL				
6	quick_pick	tinyint(1)	YES	0				
7	price_paid	decimal(10,2)	NO	NULL				
8	is_winner	tinyint(1)	YES	0		MUL		
9	prize_tier	int	YES	NULL				
10	prize_amount	decimal(20,2)	YES	0.00				
11	prize_claimed	tinyint(1)	YES	0				
12	purchased_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_draw	NON_UNIQUE	BTREE	draw_id	0
idx_user	NON_UNIQUE	BTREE	user_id	0
idx_winner	NON_UNIQUE	BTREE	is_winner	0
ticket_number	UNIQUE	BTREE	ticket_number	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
lottery_tickets_ibfk_1	draw_id	lottery_draws	id	NO ACTION	NO ACTION
lottery_tickets_ibfk_2	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `lottery_tickets` (
  `id` int NOT NULL AUTO_INCREMENT,
  `ticket_number` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `draw_id` int NOT NULL,
  `user_id` int NOT NULL,
  `numbers_selected` json NOT NULL,
  `quick_pick` tinyint(1) DEFAULT '0',
  `price_paid` decimal(10,2) NOT NULL,
  `is_winner` tinyint(1) DEFAULT '0',
  `prize_tier` int DEFAULT NULL,
  `prize_amount` decimal(20,2) DEFAULT '0.00',
  `prize_claimed` tinyint(1) DEFAULT '0',
  `purchased_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ticket_number` (`ticket_number`),
  KEY `idx_draw` (`draw_id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_winner` (`is_winner`),
  CONSTRAINT `lottery_tickets_ibfk_1` FOREIGN KEY (`draw_id`) REFERENCES `lottery_draws` (`id`),
  CONSTRAINT `lottery_tickets_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: make_offer
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:52:02 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	listing_id	bigint	NO	NULL		MUL		
3	buyer_id	int	NO	NULL		MUL		
4	offer_amount	decimal(12,2)	NO	NULL				
5	message	text	YES	NULL			utf8mb4_unicode_ci	
6	quantity	int	YES	1				
7	expires_at	timestamp	NO	NULL				
8	status	enum('pending','accepted','rejected','countered','expired','withdrawn')	YES	pending		MUL	utf8mb4_unicode_ci	
9	counter_amount	decimal(12,2)	YES	NULL				
10	counter_message	text	YES	NULL			utf8mb4_unicode_ci	
11	seller_response_time	timestamp	YES	NULL				
12	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_buyer	NON_UNIQUE	BTREE	buyer_id	0
idx_listing	NON_UNIQUE	BTREE	listing_id	0
idx_status	NON_UNIQUE	BTREE	status	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
make_offer_ibfk_1	listing_id	auction_listings	id	NO ACTION	NO ACTION
make_offer_ibfk_2	buyer_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `make_offer` (
  `id` int NOT NULL AUTO_INCREMENT,
  `listing_id` bigint NOT NULL,
  `buyer_id` int NOT NULL,
  `offer_amount` decimal(12,2) NOT NULL,
  `message` text COLLATE utf8mb4_unicode_ci,
  `quantity` int DEFAULT '1',
  `expires_at` timestamp NOT NULL,
  `status` enum('pending','accepted','rejected','countered','expired','withdrawn') COLLATE utf8mb4_unicode_ci DEFAULT 'pending',
  `counter_amount` decimal(12,2) DEFAULT NULL,
  `counter_message` text COLLATE utf8mb4_unicode_ci,
  `seller_response_time` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_listing` (`listing_id`),
  KEY `idx_buyer` (`buyer_id`),
  KEY `idx_status` (`status`),
  CONSTRAINT `make_offer_ibfk_1` FOREIGN KEY (`listing_id`) REFERENCES `auction_listings` (`id`),
  CONSTRAINT `make_offer_ibfk_2` FOREIGN KEY (`buyer_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: market_intelligence
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:53:58 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	intelligence_type	varchar(100)	NO	NULL		MUL	utf8mb4_unicode_ci	
3	market_segment	varchar(200)	YES	NULL		MUL	utf8mb4_unicode_ci	
4	data_source	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
5	insights	json	NO	NULL				
6	trends	json	YES	NULL				
7	opportunities	json	YES	NULL				
8	threats	json	YES	NULL				
9	recommendations	json	YES	NULL				
10	confidence_level	decimal(5,4)	YES	NULL				
11	report_date	date	NO	NULL		MUL		
12	expires_date	date	YES	NULL				
13	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_date	NON_UNIQUE	BTREE	report_date	0
idx_segment	NON_UNIQUE	BTREE	market_segment	0
idx_type	NON_UNIQUE	BTREE	intelligence_type	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `market_intelligence` (
  `id` int NOT NULL AUTO_INCREMENT,
  `intelligence_type` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `market_segment` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `data_source` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `insights` json NOT NULL,
  `trends` json DEFAULT NULL,
  `opportunities` json DEFAULT NULL,
  `threats` json DEFAULT NULL,
  `recommendations` json DEFAULT NULL,
  `confidence_level` decimal(5,4) DEFAULT NULL,
  `report_date` date NOT NULL,
  `expires_date` date DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_type` (`intelligence_type`),
  KEY `idx_segment` (`market_segment`),
  KEY `idx_date` (`report_date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: marketplace_listings
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:39:42 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	seller_id	int	NO	NULL		MUL		
3	title	varchar(200)	NO	NULL			utf8mb4_unicode_ci	
4	description	text	YES	NULL			utf8mb4_unicode_ci	
5	price	decimal(10,2)	NO	NULL		MUL		
6	currency	varchar(3)	YES	USD			utf8mb4_unicode_ci	
7	category	varchar(100)	YES	NULL		MUL	utf8mb4_unicode_ci	
8	condition_type	enum('new','like_new','good','fair')	YES	good			utf8mb4_unicode_ci	
9	brand	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
10	model	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
11	year	int	YES	NULL				
12	photos	json	YES	NULL				
13	location	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
14	location_coordinates	json	YES	NULL				
15	delivery_method	enum('pickup','delivery','shipping','all')	YES	all			utf8mb4_unicode_ci	
16	shipping_cost	decimal(10,2)	YES	NULL				
17	is_firm_price	tinyint(1)	YES	0				
18	is_available	tinyint(1)	YES	1		MUL		
19	view_count	int	YES	0				
20	save_count	int	YES	0				
21	message_count	int	YES	0				
22	boost_expires	timestamp	YES	NULL				
23	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
24	sold_at	timestamp	YES	NULL				

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_available	NON_UNIQUE	BTREE	is_available	0
idx_category	NON_UNIQUE	BTREE	category	0
idx_price	NON_UNIQUE	BTREE	price	0
idx_seller	NON_UNIQUE	BTREE	seller_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
marketplace_listings_ibfk_1	seller_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `marketplace_listings` (
  `id` int NOT NULL AUTO_INCREMENT,
  `seller_id` int NOT NULL,
  `title` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `price` decimal(10,2) NOT NULL,
  `currency` varchar(3) COLLATE utf8mb4_unicode_ci DEFAULT 'USD',
  `category` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `condition_type` enum('new','like_new','good','fair') COLLATE utf8mb4_unicode_ci DEFAULT 'good',
  `brand` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `model` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `year` int DEFAULT NULL,
  `photos` json DEFAULT NULL,
  `location` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `location_coordinates` json DEFAULT NULL,
  `delivery_method` enum('pickup','delivery','shipping','all') COLLATE utf8mb4_unicode_ci DEFAULT 'all',
  `shipping_cost` decimal(10,2) DEFAULT NULL,
  `is_firm_price` tinyint(1) DEFAULT '0',
  `is_available` tinyint(1) DEFAULT '1',
  `view_count` int DEFAULT '0',
  `save_count` int DEFAULT '0',
  `message_count` int DEFAULT '0',
  `boost_expires` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `sold_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_seller` (`seller_id`),
  KEY `idx_category` (`category`),
  KEY `idx_price` (`price`),
  KEY `idx_available` (`is_available`),
  CONSTRAINT `marketplace_listings_ibfk_1` FOREIGN KEY (`seller_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: match_analytics
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-04 00:00:20 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user1_id	int	YES	NULL		MUL		
3	user2_id	int	YES	NULL				
4	wait_time_seconds	int	YES	NULL				
5	connection_time_ms	int	YES	NULL				
6	matched_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED	MUL		

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_matched	NON_UNIQUE	BTREE	matched_at	0
idx_users	NON_UNIQUE	BTREE	user1_id, user2_id	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `match_analytics` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user1_id` int DEFAULT NULL,
  `user2_id` int DEFAULT NULL,
  `wait_time_seconds` int DEFAULT NULL,
  `connection_time_ms` int DEFAULT NULL,
  `matched_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_users` (`user1_id`,`user2_id`),
  KEY `idx_matched` (`matched_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: media_content
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.11 | TOTAL_MB: 0.13 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:30:09 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	content_type	enum('movie','series','documentary','special','short')	NO	NULL		MUL	utf8mb4_unicode_ci	
3	title	varchar(200)	NO	NULL		MUL	utf8mb4_unicode_ci	
4	original_title	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
5	slug	varchar(200)	YES	NULL		UNI	utf8mb4_unicode_ci	
6	synopsis	text	YES	NULL			utf8mb4_unicode_ci	
7	detailed_plot	text	YES	NULL			utf8mb4_unicode_ci	
8	release_date	date	YES	NULL				
9	runtime_minutes	int	YES	NULL				
10	seasons	int	YES	NULL				
11	episodes	int	YES	NULL				
12	genres	json	YES	NULL				
13	tags	json	YES	NULL				
14	cast_members	json	YES	NULL				
15	crew_members	json	YES	NULL				
16	production_companies	json	YES	NULL				
17	countries	json	YES	NULL				
18	languages	json	YES	NULL				
19	subtitles_available	json	YES	NULL				
20	age_rating	varchar(20)	YES	NULL			utf8mb4_unicode_ci	
21	content_rating	decimal(3,1)	YES	0.0		MUL		
22	imdb_id	varchar(20)	YES	NULL			utf8mb4_unicode_ci	
23	tmdb_id	int	YES	NULL				
24	poster_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
25	backdrop_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
26	trailer_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
27	is_original	tinyint(1)	YES	0				
28	is_exclusive	tinyint(1)	YES	0				
29	is_featured	tinyint(1)	YES	0				
30	is_trending	tinyint(1)	YES	0				
31	view_count	bigint	YES	0				
32	popularity_score	decimal(10,4)	YES	0.0000		MUL		
33	available_from	timestamp	YES	NULL				
34	available_until	timestamp	YES	NULL				
35	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_popularity	NON_UNIQUE	BTREE	popularity_score	0
idx_rating	NON_UNIQUE	BTREE	content_rating	0
idx_search	NON_UNIQUE	FULLTEXT	title, synopsis	0
idx_slug	NON_UNIQUE	BTREE	slug	0
idx_type	NON_UNIQUE	BTREE	content_type	0
slug	UNIQUE	BTREE	slug	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `media_content` (
  `id` int NOT NULL AUTO_INCREMENT,
  `content_type` enum('movie','series','documentary','special','short') COLLATE utf8mb4_unicode_ci NOT NULL,
  `title` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `original_title` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `slug` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `synopsis` text COLLATE utf8mb4_unicode_ci,
  `detailed_plot` text COLLATE utf8mb4_unicode_ci,
  `release_date` date DEFAULT NULL,
  `runtime_minutes` int DEFAULT NULL,
  `seasons` int DEFAULT NULL,
  `episodes` int DEFAULT NULL,
  `genres` json DEFAULT NULL,
  `tags` json DEFAULT NULL,
  `cast_members` json DEFAULT NULL,
  `crew_members` json DEFAULT NULL,
  `production_companies` json DEFAULT NULL,
  `countries` json DEFAULT NULL,
  `languages` json DEFAULT NULL,
  `subtitles_available` json DEFAULT NULL,
  `age_rating` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `content_rating` decimal(3,1) DEFAULT '0.0',
  `imdb_id` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tmdb_id` int DEFAULT NULL,
  `poster_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `backdrop_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `trailer_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_original` tinyint(1) DEFAULT '0',
  `is_exclusive` tinyint(1) DEFAULT '0',
  `is_featured` tinyint(1) DEFAULT '0',
  `is_trending` tinyint(1) DEFAULT '0',
  `view_count` bigint DEFAULT '0',
  `popularity_score` decimal(10,4) DEFAULT '0.0000',
  `available_from` timestamp NULL DEFAULT NULL,
  `available_until` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `slug` (`slug`),
  KEY `idx_type` (`content_type`),
  KEY `idx_slug` (`slug`),
  KEY `idx_rating` (`content_rating`),
  KEY `idx_popularity` (`popularity_score`),
  FULLTEXT KEY `idx_search` (`title`,`synopsis`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: media_episodes
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:30:09 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	series_id	int	NO	NULL		MUL		
3	season_number	int	NO	NULL		MUL		
4	episode_number	int	NO	NULL				
5	title	varchar(200)	NO	NULL			utf8mb4_unicode_ci	
6	synopsis	text	YES	NULL			utf8mb4_unicode_ci	
7	runtime_minutes	int	YES	NULL				
8	air_date	date	YES	NULL				
9	director	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
10	writers	json	YES	NULL				
11	guest_stars	json	YES	NULL				
12	thumbnail_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
13	video_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
14	is_premiere	tinyint(1)	YES	0				
15	is_finale	tinyint(1)	YES	0				
16	view_count	bigint	YES	0				
17	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_season	NON_UNIQUE	BTREE	season_number	0
idx_series	NON_UNIQUE	BTREE	series_id	0
unique_episode	UNIQUE	BTREE	series_id, season_number, episode_number	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
media_episodes_ibfk_1	series_id	media_content	id	NO ACTION	CASCADE

--- SHOW CREATE TABLE ---
CREATE TABLE `media_episodes` (
  `id` int NOT NULL AUTO_INCREMENT,
  `series_id` int NOT NULL,
  `season_number` int NOT NULL,
  `episode_number` int NOT NULL,
  `title` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `synopsis` text COLLATE utf8mb4_unicode_ci,
  `runtime_minutes` int DEFAULT NULL,
  `air_date` date DEFAULT NULL,
  `director` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `writers` json DEFAULT NULL,
  `guest_stars` json DEFAULT NULL,
  `thumbnail_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `video_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_premiere` tinyint(1) DEFAULT '0',
  `is_finale` tinyint(1) DEFAULT '0',
  `view_count` bigint DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_episode` (`series_id`,`season_number`,`episode_number`),
  KEY `idx_series` (`series_id`),
  KEY `idx_season` (`season_number`),
  CONSTRAINT `media_episodes_ibfk_1` FOREIGN KEY (`series_id`) REFERENCES `media_content` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: media_streams
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:30:09 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	content_id	int	NO	NULL		MUL		
3	episode_id	int	YES	NULL		MUL		
4	quality	varchar(20)	NO	NULL		MUL	utf8mb4_unicode_ci	
5	resolution	varchar(20)	YES	NULL			utf8mb4_unicode_ci	
6	bitrate	int	YES	NULL				
7	codec	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
8	stream_url	varchar(500)	NO	NULL			utf8mb4_unicode_ci	
9	cdn_provider	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
10	file_size	bigint	YES	NULL				
11	duration_seconds	int	YES	NULL				
12	is_default	tinyint(1)	YES	0				
13	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_content	NON_UNIQUE	BTREE	content_id	0
idx_episode	NON_UNIQUE	BTREE	episode_id	0
idx_quality	NON_UNIQUE	BTREE	quality	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
media_streams_ibfk_1	content_id	media_content	id	NO ACTION	NO ACTION
media_streams_ibfk_2	episode_id	media_episodes	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `media_streams` (
  `id` int NOT NULL AUTO_INCREMENT,
  `content_id` int NOT NULL,
  `episode_id` int DEFAULT NULL,
  `quality` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `resolution` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `bitrate` int DEFAULT NULL,
  `codec` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `stream_url` varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL,
  `cdn_provider` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `file_size` bigint DEFAULT NULL,
  `duration_seconds` int DEFAULT NULL,
  `is_default` tinyint(1) DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_content` (`content_id`),
  KEY `idx_episode` (`episode_id`),
  KEY `idx_quality` (`quality`),
  CONSTRAINT `media_streams_ibfk_1` FOREIGN KEY (`content_id`) REFERENCES `media_content` (`id`),
  CONSTRAINT `media_streams_ibfk_2` FOREIGN KEY (`episode_id`) REFERENCES `media_episodes` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: message_encryption
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:53:38 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	conversation_id	varchar(100)	NO	NULL		MUL	utf8mb4_unicode_ci	
3	user_id	int	NO	NULL		MUL		
4	public_key	text	NO	NULL			utf8mb4_unicode_ci	
5	private_key_encrypted	text	NO	NULL			utf8mb4_unicode_ci	
6	key_version	int	YES	1				
7	device_id	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
8	is_primary	tinyint(1)	YES	1				
9	last_rotation	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
10	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_conversation	NON_UNIQUE	BTREE	conversation_id	0
idx_user	NON_UNIQUE	BTREE	user_id	0
unique_conversation_user	UNIQUE	BTREE	conversation_id, user_id, device_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
message_encryption_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `message_encryption` (
  `id` int NOT NULL AUTO_INCREMENT,
  `conversation_id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` int NOT NULL,
  `public_key` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `private_key_encrypted` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `key_version` int DEFAULT '1',
  `device_id` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_primary` tinyint(1) DEFAULT '1',
  `last_rotation` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_conversation_user` (`conversation_id`,`user_id`,`device_id`),
  KEY `idx_conversation` (`conversation_id`),
  KEY `idx_user` (`user_id`),
  CONSTRAINT `message_encryption_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: message_reactions
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_0900_ai_ci | CREATE: 2025-08-04 01:43:53 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	message_id	int	NO	NULL		MUL		
3	user_id	int	NO	NULL		MUL		
4	reaction	varchar(10)	NO	NULL			utf8mb4_0900_ai_ci	
5	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
unique_user_reaction	UNIQUE	BTREE	message_id, user_id	0
user_id	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
message_reactions_ibfk_1	message_id	messages	id	NO ACTION	CASCADE
message_reactions_ibfk_2	user_id	users	id	NO ACTION	CASCADE

--- SHOW CREATE TABLE ---
CREATE TABLE `message_reactions` (
  `id` int NOT NULL AUTO_INCREMENT,
  `message_id` int NOT NULL,
  `user_id` int NOT NULL,
  `reaction` varchar(10) NOT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_user_reaction` (`message_id`,`user_id`),
  KEY `user_id` (`user_id`),
  CONSTRAINT `message_reactions_ibfk_1` FOREIGN KEY (`message_id`) REFERENCES `messages` (`id`) ON DELETE CASCADE,
  CONSTRAINT `message_reactions_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;


============================================================
TABLE: message_scheduling
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:54:04 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	sender_id	int	NO	NULL		MUL		
3	recipient_type	enum('user','group','channel','broadcast')	NO	NULL			utf8mb4_unicode_ci	
4	recipient_id	int	NO	NULL				
5	message_content	text	NO	NULL			utf8mb4_unicode_ci	
6	media_urls	json	YES	NULL				
7	scheduled_time	timestamp	NO	NULL		MUL		
8	repeat_pattern	enum('none','daily','weekly','monthly')	YES	none			utf8mb4_unicode_ci	
9	repeat_until	date	YES	NULL				
10	timezone	varchar(50)	YES	UTC			utf8mb4_unicode_ci	
11	status	enum('scheduled','sent','failed','cancelled')	YES	scheduled		MUL	utf8mb4_unicode_ci	
12	sent_at	timestamp	YES	NULL				
13	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_scheduled	NON_UNIQUE	BTREE	scheduled_time	0
idx_sender	NON_UNIQUE	BTREE	sender_id	0
idx_status	NON_UNIQUE	BTREE	status	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
message_scheduling_ibfk_1	sender_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `message_scheduling` (
  `id` int NOT NULL AUTO_INCREMENT,
  `sender_id` int NOT NULL,
  `recipient_type` enum('user','group','channel','broadcast') COLLATE utf8mb4_unicode_ci NOT NULL,
  `recipient_id` int NOT NULL,
  `message_content` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `media_urls` json DEFAULT NULL,
  `scheduled_time` timestamp NOT NULL,
  `repeat_pattern` enum('none','daily','weekly','monthly') COLLATE utf8mb4_unicode_ci DEFAULT 'none',
  `repeat_until` date DEFAULT NULL,
  `timezone` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT 'UTC',
  `status` enum('scheduled','sent','failed','cancelled') COLLATE utf8mb4_unicode_ci DEFAULT 'scheduled',
  `sent_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_sender` (`sender_id`),
  KEY `idx_scheduled` (`scheduled_time`),
  KEY `idx_status` (`status`),
  CONSTRAINT `message_scheduling_ibfk_1` FOREIGN KEY (`sender_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: messages
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 2 | COLLATION: utf8mb4_0900_ai_ci | CREATE: 2025-08-02 17:22:28 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	session_id	int	YES	NULL		MUL		
3	sender_id	int	YES	NULL		MUL		
4	message	text	YES	NULL			utf8mb4_0900_ai_ci	
5	message_type	enum('text','image','emoji')	YES	text			utf8mb4_0900_ai_ci	
6	sent_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_messages_session	NON_UNIQUE	BTREE	session_id	0
sender_id	NON_UNIQUE	BTREE	sender_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
messages_ibfk_1	session_id	chat_sessions	id	NO ACTION	NO ACTION
messages_ibfk_2	sender_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `messages` (
  `id` int NOT NULL AUTO_INCREMENT,
  `session_id` int DEFAULT NULL,
  `sender_id` int DEFAULT NULL,
  `message` text,
  `message_type` enum('text','image','emoji') DEFAULT 'text',
  `sent_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `sender_id` (`sender_id`),
  KEY `idx_messages_session` (`session_id`),
  CONSTRAINT `messages_ibfk_1` FOREIGN KEY (`session_id`) REFERENCES `chat_sessions` (`id`),
  CONSTRAINT `messages_ibfk_2` FOREIGN KEY (`sender_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;


============================================================
TABLE: moderation_logs
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:28:29 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	community_id	int	NO	NULL		MUL		
3	moderator_id	int	NO	NULL		MUL		
4	action_type	varchar(50)	NO	NULL		MUL	utf8mb4_unicode_ci	
5	target_type	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
6	target_id	bigint	YES	NULL				
7	target_user_id	int	YES	NULL				
8	reason	text	YES	NULL			utf8mb4_unicode_ci	
9	details	json	YES	NULL				
10	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_action	NON_UNIQUE	BTREE	action_type	0
idx_community	NON_UNIQUE	BTREE	community_id	0
idx_moderator	NON_UNIQUE	BTREE	moderator_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
moderation_logs_ibfk_1	community_id	communities	id	NO ACTION	NO ACTION
moderation_logs_ibfk_2	moderator_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `moderation_logs` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `community_id` int NOT NULL,
  `moderator_id` int NOT NULL,
  `action_type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `target_type` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `target_id` bigint DEFAULT NULL,
  `target_user_id` int DEFAULT NULL,
  `reason` text COLLATE utf8mb4_unicode_ci,
  `details` json DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_community` (`community_id`),
  KEY `idx_moderator` (`moderator_id`),
  KEY `idx_action` (`action_type`),
  CONSTRAINT `moderation_logs_ibfk_1` FOREIGN KEY (`community_id`) REFERENCES `communities` (`id`),
  CONSTRAINT `moderation_logs_ibfk_2` FOREIGN KEY (`moderator_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: moderator_dashboard
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 16:04:26 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	moderator_id	int	NO	NULL		UNI		
3	items_to_review	int	YES	0				
4	items_reviewed_today	int	YES	0				
5	reports_pending	int	YES	0				
6	content_removed_today	int	YES	0				
7	users_warned_today	int	YES	0				
8	users_banned_today	int	YES	0				
9	accuracy_rate	decimal(5,2)	YES	0.00				
10	average_review_time_seconds	int	YES	0				
11	priority_items	int	YES	0				
12	escalated_items	int	YES	0				
13	last_updated	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_moderator	NON_UNIQUE	BTREE	moderator_id	0
unique_moderator	UNIQUE	BTREE	moderator_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
moderator_dashboard_ibfk_1	moderator_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `moderator_dashboard` (
  `id` int NOT NULL AUTO_INCREMENT,
  `moderator_id` int NOT NULL,
  `items_to_review` int DEFAULT '0',
  `items_reviewed_today` int DEFAULT '0',
  `reports_pending` int DEFAULT '0',
  `content_removed_today` int DEFAULT '0',
  `users_warned_today` int DEFAULT '0',
  `users_banned_today` int DEFAULT '0',
  `accuracy_rate` decimal(5,2) DEFAULT '0.00',
  `average_review_time_seconds` int DEFAULT '0',
  `priority_items` int DEFAULT '0',
  `escalated_items` int DEFAULT '0',
  `last_updated` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_moderator` (`moderator_id`),
  KEY `idx_moderator` (`moderator_id`),
  CONSTRAINT `moderator_dashboard_ibfk_1` FOREIGN KEY (`moderator_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: music_tracks
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.08 | TOTAL_MB: 0.09 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:12:57 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	artist_id	int	NO	NULL		MUL		
3	title	varchar(200)	NO	NULL		MUL	utf8mb4_unicode_ci	
4	album_name	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
5	genre	varchar(100)	YES	NULL		MUL	utf8mb4_unicode_ci	
6	subgenre	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
7	duration_seconds	int	NO	NULL				
8	audio_url	varchar(500)	NO	NULL			utf8mb4_unicode_ci	
9	audio_quality	varchar(20)	YES	320kbps			utf8mb4_unicode_ci	
10	waveform_data	json	YES	NULL				
11	bpm	int	YES	NULL				
12	key_signature	varchar(10)	YES	NULL			utf8mb4_unicode_ci	
13	lyrics	text	YES	NULL			utf8mb4_unicode_ci	
14	lyrics_language	varchar(10)	YES	NULL			utf8mb4_unicode_ci	
15	cover_art_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
16	release_date	date	YES	NULL				
17	record_label	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
18	isrc_code	varchar(20)	YES	NULL			utf8mb4_unicode_ci	
19	copyright_info	text	YES	NULL			utf8mb4_unicode_ci	
20	play_count	bigint	YES	0		MUL		
21	like_count	int	YES	0				
22	share_count	int	YES	0				
23	is_explicit	tinyint(1)	YES	0				
24	is_instrumental	tinyint(1)	YES	0				
25	available_territories	json	YES	NULL				
26	streaming_revenue	decimal(20,4)	YES	0.0000				
27	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_artist	NON_UNIQUE	BTREE	artist_id	0
idx_genre	NON_UNIQUE	BTREE	genre	0
idx_plays	NON_UNIQUE	BTREE	play_count	0
idx_search	NON_UNIQUE	FULLTEXT	title, album_name	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
music_tracks_ibfk_1	artist_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `music_tracks` (
  `id` int NOT NULL AUTO_INCREMENT,
  `artist_id` int NOT NULL,
  `title` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `album_name` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `genre` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `subgenre` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `duration_seconds` int NOT NULL,
  `audio_url` varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL,
  `audio_quality` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT '320kbps',
  `waveform_data` json DEFAULT NULL,
  `bpm` int DEFAULT NULL,
  `key_signature` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `lyrics` text COLLATE utf8mb4_unicode_ci,
  `lyrics_language` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cover_art_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `release_date` date DEFAULT NULL,
  `record_label` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `isrc_code` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `copyright_info` text COLLATE utf8mb4_unicode_ci,
  `play_count` bigint DEFAULT '0',
  `like_count` int DEFAULT '0',
  `share_count` int DEFAULT '0',
  `is_explicit` tinyint(1) DEFAULT '0',
  `is_instrumental` tinyint(1) DEFAULT '0',
  `available_territories` json DEFAULT NULL,
  `streaming_revenue` decimal(20,4) DEFAULT '0.0000',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_artist` (`artist_id`),
  KEY `idx_genre` (`genre`),
  KEY `idx_plays` (`play_count`),
  FULLTEXT KEY `idx_search` (`title`,`album_name`),
  CONSTRAINT `music_tracks_ibfk_1` FOREIGN KEY (`artist_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: nft_collections
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:12:40 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	creator_id	int	NO	NULL		MUL		
3	collection_name	varchar(200)	NO	NULL			utf8mb4_unicode_ci	
4	symbol	varchar(20)	YES	NULL			utf8mb4_unicode_ci	
5	description	text	YES	NULL			utf8mb4_unicode_ci	
6	blockchain	varchar(50)	NO	NULL		MUL	utf8mb4_unicode_ci	
7	contract_address	varchar(100)	YES	NULL		UNI	utf8mb4_unicode_ci	
8	total_supply	int	YES	NULL				
9	minted_count	int	YES	0				
10	floor_price_eth	decimal(20,8)	YES	NULL				
11	floor_price_usd	decimal(20,2)	YES	NULL				
12	volume_traded_eth	decimal(30,8)	YES	0.00000000				
13	volume_traded_usd	decimal(30,2)	YES	0.00				
14	royalty_percentage	decimal(5,2)	YES	2.50				
15	category	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
16	website_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
17	metadata_base_uri	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
18	banner_image	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
19	featured_image	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
20	is_verified	tinyint(1)	YES	0				
21	is_featured	tinyint(1)	YES	0				
22	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
contract_address	UNIQUE	BTREE	contract_address	0
idx_blockchain	NON_UNIQUE	BTREE	blockchain	0
idx_contract	NON_UNIQUE	BTREE	contract_address	0
idx_creator	NON_UNIQUE	BTREE	creator_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
nft_collections_ibfk_1	creator_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `nft_collections` (
  `id` int NOT NULL AUTO_INCREMENT,
  `creator_id` int NOT NULL,
  `collection_name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `symbol` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `blockchain` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `contract_address` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `total_supply` int DEFAULT NULL,
  `minted_count` int DEFAULT '0',
  `floor_price_eth` decimal(20,8) DEFAULT NULL,
  `floor_price_usd` decimal(20,2) DEFAULT NULL,
  `volume_traded_eth` decimal(30,8) DEFAULT '0.00000000',
  `volume_traded_usd` decimal(30,2) DEFAULT '0.00',
  `royalty_percentage` decimal(5,2) DEFAULT '2.50',
  `category` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `website_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `metadata_base_uri` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `banner_image` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `featured_image` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_verified` tinyint(1) DEFAULT '0',
  `is_featured` tinyint(1) DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `contract_address` (`contract_address`),
  KEY `idx_creator` (`creator_id`),
  KEY `idx_blockchain` (`blockchain`),
  KEY `idx_contract` (`contract_address`),
  CONSTRAINT `nft_collections_ibfk_1` FOREIGN KEY (`creator_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: nft_items
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.08 | TOTAL_MB: 0.09 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:12:40 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	collection_id	int	NO	NULL		MUL		
3	token_id	bigint	NO	NULL				
4	owner_id	int	NO	NULL		MUL		
5	creator_id	int	NO	NULL		MUL		
6	name	varchar(200)	NO	NULL			utf8mb4_unicode_ci	
7	description	text	YES	NULL			utf8mb4_unicode_ci	
8	image_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
9	animation_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
10	metadata	json	YES	NULL				
11	attributes	json	YES	NULL				
12	rarity_score	decimal(10,4)	YES	NULL				
13	rarity_rank	int	YES	NULL				
14	listing_price_eth	decimal(20,8)	YES	NULL				
15	listing_price_usd	decimal(20,2)	YES	NULL				
16	last_sale_price_eth	decimal(20,8)	YES	NULL				
17	last_sale_price_usd	decimal(20,2)	YES	NULL				
18	is_listed	tinyint(1)	YES	0		MUL		
19	is_auction	tinyint(1)	YES	0				
20	auction_end_time	timestamp	YES	NULL				
21	view_count	int	YES	0				
22	like_count	int	YES	0				
23	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
24	minted_at	timestamp	YES	NULL				

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_collection	NON_UNIQUE	BTREE	collection_id	0
idx_creator	NON_UNIQUE	BTREE	creator_id	0
idx_listed	NON_UNIQUE	BTREE	is_listed	0
idx_owner	NON_UNIQUE	BTREE	owner_id	0
unique_nft	UNIQUE	BTREE	collection_id, token_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
nft_items_ibfk_1	collection_id	nft_collections	id	NO ACTION	NO ACTION
nft_items_ibfk_2	owner_id	users	id	NO ACTION	NO ACTION
nft_items_ibfk_3	creator_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `nft_items` (
  `id` int NOT NULL AUTO_INCREMENT,
  `collection_id` int NOT NULL,
  `token_id` bigint NOT NULL,
  `owner_id` int NOT NULL,
  `creator_id` int NOT NULL,
  `name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `image_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `animation_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `metadata` json DEFAULT NULL,
  `attributes` json DEFAULT NULL,
  `rarity_score` decimal(10,4) DEFAULT NULL,
  `rarity_rank` int DEFAULT NULL,
  `listing_price_eth` decimal(20,8) DEFAULT NULL,
  `listing_price_usd` decimal(20,2) DEFAULT NULL,
  `last_sale_price_eth` decimal(20,8) DEFAULT NULL,
  `last_sale_price_usd` decimal(20,2) DEFAULT NULL,
  `is_listed` tinyint(1) DEFAULT '0',
  `is_auction` tinyint(1) DEFAULT '0',
  `auction_end_time` timestamp NULL DEFAULT NULL,
  `view_count` int DEFAULT '0',
  `like_count` int DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `minted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_nft` (`collection_id`,`token_id`),
  KEY `idx_collection` (`collection_id`),
  KEY `idx_owner` (`owner_id`),
  KEY `idx_creator` (`creator_id`),
  KEY `idx_listed` (`is_listed`),
  CONSTRAINT `nft_items_ibfk_1` FOREIGN KEY (`collection_id`) REFERENCES `nft_collections` (`id`),
  CONSTRAINT `nft_items_ibfk_2` FOREIGN KEY (`owner_id`) REFERENCES `users` (`id`),
  CONSTRAINT `nft_items_ibfk_3` FOREIGN KEY (`creator_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: notifications
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_0900_ai_ci | CREATE: 2025-08-04 01:43:53 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	type	varchar(50)	NO	NULL			utf8mb4_0900_ai_ci	
4	from_user_id	int	YES	NULL		MUL		
5	message	text	YES	NULL			utf8mb4_0900_ai_ci	
6	is_read	tinyint(1)	YES	0				
7	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
from_user_id	NON_UNIQUE	BTREE	from_user_id	0
idx_user_unread	NON_UNIQUE	BTREE	user_id, is_read	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
notifications_ibfk_1	user_id	users	id	NO ACTION	CASCADE
notifications_ibfk_2	from_user_id	users	id	NO ACTION	SET NULL

--- SHOW CREATE TABLE ---
CREATE TABLE `notifications` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `type` varchar(50) NOT NULL,
  `from_user_id` int DEFAULT NULL,
  `message` text,
  `is_read` tinyint(1) DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `from_user_id` (`from_user_id`),
  KEY `idx_user_unread` (`user_id`,`is_read`),
  CONSTRAINT `notifications_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  CONSTRAINT `notifications_ibfk_2` FOREIGN KEY (`from_user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;


============================================================
TABLE: nutrition_logs
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:13:15 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	meal_type	enum('breakfast','lunch','dinner','snack','drink','supplement')	NO	NULL		MUL	utf8mb4_unicode_ci	
4	food_items	json	NO	NULL				
5	total_calories	int	YES	NULL				
6	protein_g	decimal(10,2)	YES	NULL				
7	carbs_g	decimal(10,2)	YES	NULL				
8	fat_g	decimal(10,2)	YES	NULL				
9	fiber_g	decimal(10,2)	YES	NULL				
10	sugar_g	decimal(10,2)	YES	NULL				
11	sodium_mg	decimal(10,2)	YES	NULL				
12	water_ml	int	YES	NULL				
13	vitamins	json	YES	NULL				
14	minerals	json	YES	NULL				
15	meal_photo	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
16	restaurant_name	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
17	recipe_id	int	YES	NULL				
18	mood	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
19	hunger_level_before	int	YES	NULL				
20	hunger_level_after	int	YES	NULL				
21	logged_date	date	NO	NULL		MUL		
22	logged_time	time	YES	NULL				
23	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_date	NON_UNIQUE	BTREE	logged_date	0
idx_meal	NON_UNIQUE	BTREE	meal_type	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
nutrition_logs_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `nutrition_logs` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `meal_type` enum('breakfast','lunch','dinner','snack','drink','supplement') COLLATE utf8mb4_unicode_ci NOT NULL,
  `food_items` json NOT NULL,
  `total_calories` int DEFAULT NULL,
  `protein_g` decimal(10,2) DEFAULT NULL,
  `carbs_g` decimal(10,2) DEFAULT NULL,
  `fat_g` decimal(10,2) DEFAULT NULL,
  `fiber_g` decimal(10,2) DEFAULT NULL,
  `sugar_g` decimal(10,2) DEFAULT NULL,
  `sodium_mg` decimal(10,2) DEFAULT NULL,
  `water_ml` int DEFAULT NULL,
  `vitamins` json DEFAULT NULL,
  `minerals` json DEFAULT NULL,
  `meal_photo` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `restaurant_name` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `recipe_id` int DEFAULT NULL,
  `mood` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `hunger_level_before` int DEFAULT NULL,
  `hunger_level_after` int DEFAULT NULL,
  `logged_date` date NOT NULL,
  `logged_time` time DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_date` (`logged_date`),
  KEY `idx_meal` (`meal_type`),
  CONSTRAINT `nutrition_logs_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: online_stores
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.08 | TOTAL_MB: 0.09 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:52:35 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	owner_id	int	NO	NULL		MUL		
3	store_name	varchar(200)	NO	NULL			utf8mb4_unicode_ci	
4	store_domain	varchar(200)	YES	NULL		UNI	utf8mb4_unicode_ci	
5	custom_domain	varchar(200)	YES	NULL		UNI	utf8mb4_unicode_ci	
6	store_type	enum('retail','wholesale','dropship','digital','subscription','marketplace')	YES	retail			utf8mb4_unicode_ci	
7	business_info	json	YES	NULL				
8	theme_id	int	YES	NULL				
9	custom_css	text	YES	NULL			utf8mb4_unicode_ci	
10	custom_js	text	YES	NULL			utf8mb4_unicode_ci	
11	logo_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
12	favicon_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
13	meta_tags	json	YES	NULL				
14	analytics_codes	json	YES	NULL				
15	payment_gateways	json	YES	NULL				
16	shipping_zones	json	YES	NULL				
17	tax_settings	json	YES	NULL				
18	currency_settings	json	YES	NULL				
19	inventory_tracking	tinyint(1)	YES	1				
20	customer_accounts	tinyint(1)	YES	1				
21	guest_checkout	tinyint(1)	YES	1				
22	ssl_certificate	tinyint(1)	YES	1				
23	maintenance_mode	tinyint(1)	YES	0				
24	launch_date	date	YES	NULL				
25	plan_type	enum('basic','standard','advanced','plus')	YES	basic		MUL	utf8mb4_unicode_ci	
26	monthly_fee	decimal(10,2)	YES	NULL				
27	transaction_fee_percentage	decimal(5,2)	YES	NULL				
28	storage_used_mb	int	YES	0				
29	bandwidth_used_gb	int	YES	0				
30	is_active	tinyint(1)	YES	1				
31	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
custom_domain	UNIQUE	BTREE	custom_domain	0
idx_domain	NON_UNIQUE	BTREE	store_domain	0
idx_owner	NON_UNIQUE	BTREE	owner_id	0
idx_plan	NON_UNIQUE	BTREE	plan_type	0
store_domain	UNIQUE	BTREE	store_domain	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
online_stores_ibfk_1	owner_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `online_stores` (
  `id` int NOT NULL AUTO_INCREMENT,
  `owner_id` int NOT NULL,
  `store_name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `store_domain` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `custom_domain` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `store_type` enum('retail','wholesale','dropship','digital','subscription','marketplace') COLLATE utf8mb4_unicode_ci DEFAULT 'retail',
  `business_info` json DEFAULT NULL,
  `theme_id` int DEFAULT NULL,
  `custom_css` text COLLATE utf8mb4_unicode_ci,
  `custom_js` text COLLATE utf8mb4_unicode_ci,
  `logo_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `favicon_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `meta_tags` json DEFAULT NULL,
  `analytics_codes` json DEFAULT NULL,
  `payment_gateways` json DEFAULT NULL,
  `shipping_zones` json DEFAULT NULL,
  `tax_settings` json DEFAULT NULL,
  `currency_settings` json DEFAULT NULL,
  `inventory_tracking` tinyint(1) DEFAULT '1',
  `customer_accounts` tinyint(1) DEFAULT '1',
  `guest_checkout` tinyint(1) DEFAULT '1',
  `ssl_certificate` tinyint(1) DEFAULT '1',
  `maintenance_mode` tinyint(1) DEFAULT '0',
  `launch_date` date DEFAULT NULL,
  `plan_type` enum('basic','standard','advanced','plus') COLLATE utf8mb4_unicode_ci DEFAULT 'basic',
  `monthly_fee` decimal(10,2) DEFAULT NULL,
  `transaction_fee_percentage` decimal(5,2) DEFAULT NULL,
  `storage_used_mb` int DEFAULT '0',
  `bandwidth_used_gb` int DEFAULT '0',
  `is_active` tinyint(1) DEFAULT '1',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `store_domain` (`store_domain`),
  UNIQUE KEY `custom_domain` (`custom_domain`),
  KEY `idx_owner` (`owner_id`),
  KEY `idx_domain` (`store_domain`),
  KEY `idx_plan` (`plan_type`),
  CONSTRAINT `online_stores_ibfk_1` FOREIGN KEY (`owner_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: order_items
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:51:43 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	order_id	bigint	NO	NULL		MUL		
3	product_id	bigint	NO	NULL		MUL		
4	store_id	int	NO	NULL		MUL		
5	sku	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
6	product_name	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
7	variant_details	json	YES	NULL				
8	quantity	int	NO	NULL				
9	unit_price	decimal(12,2)	NO	NULL				
10	discount_amount	decimal(10,2)	YES	0.00				
11	tax_amount	decimal(10,2)	YES	0.00				
12	total_price	decimal(12,2)	NO	NULL				
13	fulfillment_status	enum('pending','processing','shipped','delivered','cancelled','returned')	YES	pending		MUL	utf8mb4_unicode_ci	
14	tracking_number	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
15	shipped_date	timestamp	YES	NULL				
16	delivered_date	timestamp	YES	NULL				
17	return_window_ends	date	YES	NULL				
18	commission_amount	decimal(10,2)	YES	NULL				
19	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_fulfillment	NON_UNIQUE	BTREE	fulfillment_status	0
idx_order	NON_UNIQUE	BTREE	order_id	0
idx_product	NON_UNIQUE	BTREE	product_id	0
idx_store	NON_UNIQUE	BTREE	store_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
order_items_ibfk_1	order_id	purchase_orders	id	NO ACTION	NO ACTION
order_items_ibfk_2	product_id	products_catalog	id	NO ACTION	NO ACTION
order_items_ibfk_3	store_id	vendor_stores	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `order_items` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `order_id` bigint NOT NULL,
  `product_id` bigint NOT NULL,
  `store_id` int NOT NULL,
  `sku` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `product_name` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `variant_details` json DEFAULT NULL,
  `quantity` int NOT NULL,
  `unit_price` decimal(12,2) NOT NULL,
  `discount_amount` decimal(10,2) DEFAULT '0.00',
  `tax_amount` decimal(10,2) DEFAULT '0.00',
  `total_price` decimal(12,2) NOT NULL,
  `fulfillment_status` enum('pending','processing','shipped','delivered','cancelled','returned') COLLATE utf8mb4_unicode_ci DEFAULT 'pending',
  `tracking_number` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `shipped_date` timestamp NULL DEFAULT NULL,
  `delivered_date` timestamp NULL DEFAULT NULL,
  `return_window_ends` date DEFAULT NULL,
  `commission_amount` decimal(10,2) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_order` (`order_id`),
  KEY `idx_product` (`product_id`),
  KEY `idx_store` (`store_id`),
  KEY `idx_fulfillment` (`fulfillment_status`),
  CONSTRAINT `order_items_ibfk_1` FOREIGN KEY (`order_id`) REFERENCES `purchase_orders` (`id`),
  CONSTRAINT `order_items_ibfk_2` FOREIGN KEY (`product_id`) REFERENCES `products_catalog` (`id`),
  CONSTRAINT `order_items_ibfk_3` FOREIGN KEY (`store_id`) REFERENCES `vendor_stores` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: orders
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.08 | TOTAL_MB: 0.09 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:53:04 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	order_number	varchar(50)	NO	NULL		UNI	utf8mb4_unicode_ci	
3	buyer_id	int	NO	NULL		MUL		
4	seller_id	int	NO	NULL		MUL		
5	status	enum('pending','processing','paid','shipped','delivered','cancelled','refunded')	YES	pending		MUL	utf8mb4_unicode_ci	
6	payment_status	enum('pending','paid','failed','refunded')	YES	pending			utf8mb4_unicode_ci	
7	payment_method	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
8	transaction_id	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
9	subtotal	decimal(10,2)	NO	NULL				
10	tax_amount	decimal(10,2)	YES	0.00				
11	shipping_cost	decimal(10,2)	YES	0.00				
12	discount_amount	decimal(10,2)	YES	0.00				
13	total_amount	decimal(10,2)	NO	NULL				
14	currency	varchar(3)	YES	USD			utf8mb4_unicode_ci	
15	shipping_address	json	YES	NULL				
16	billing_address	json	YES	NULL				
17	tracking_number	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
18	carrier	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
19	notes	text	YES	NULL			utf8mb4_unicode_ci	
20	estimated_delivery	date	YES	NULL				
21	delivered_at	timestamp	YES	NULL				
22	cancelled_reason	text	YES	NULL			utf8mb4_unicode_ci	
23	refund_amount	decimal(10,2)	YES	NULL				
24	refunded_at	timestamp	YES	NULL				
25	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
26	updated_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_buyer	NON_UNIQUE	BTREE	buyer_id	0
idx_order_number	NON_UNIQUE	BTREE	order_number	0
idx_seller	NON_UNIQUE	BTREE	seller_id	0
idx_status	NON_UNIQUE	BTREE	status	0
order_number	UNIQUE	BTREE	order_number	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
orders_ibfk_1	buyer_id	users	id	NO ACTION	NO ACTION
orders_ibfk_2	seller_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `orders` (
  `id` int NOT NULL AUTO_INCREMENT,
  `order_number` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `buyer_id` int NOT NULL,
  `seller_id` int NOT NULL,
  `status` enum('pending','processing','paid','shipped','delivered','cancelled','refunded') COLLATE utf8mb4_unicode_ci DEFAULT 'pending',
  `payment_status` enum('pending','paid','failed','refunded') COLLATE utf8mb4_unicode_ci DEFAULT 'pending',
  `payment_method` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `transaction_id` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `subtotal` decimal(10,2) NOT NULL,
  `tax_amount` decimal(10,2) DEFAULT '0.00',
  `shipping_cost` decimal(10,2) DEFAULT '0.00',
  `discount_amount` decimal(10,2) DEFAULT '0.00',
  `total_amount` decimal(10,2) NOT NULL,
  `currency` varchar(3) COLLATE utf8mb4_unicode_ci DEFAULT 'USD',
  `shipping_address` json DEFAULT NULL,
  `billing_address` json DEFAULT NULL,
  `tracking_number` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `carrier` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `estimated_delivery` date DEFAULT NULL,
  `delivered_at` timestamp NULL DEFAULT NULL,
  `cancelled_reason` text COLLATE utf8mb4_unicode_ci,
  `refund_amount` decimal(10,2) DEFAULT NULL,
  `refunded_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `order_number` (`order_number`),
  KEY `idx_buyer` (`buyer_id`),
  KEY `idx_seller` (`seller_id`),
  KEY `idx_status` (`status`),
  KEY `idx_order_number` (`order_number`),
  CONSTRAINT `orders_ibfk_1` FOREIGN KEY (`buyer_id`) REFERENCES `users` (`id`),
  CONSTRAINT `orders_ibfk_2` FOREIGN KEY (`seller_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: page_posts
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:30:51 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	page_id	int	NO	NULL		MUL		
3	author_id	int	NO	NULL		MUL		
4	post_type	enum('status','photo','video','link','event','offer','job','live')	YES	status			utf8mb4_unicode_ci	
5	content	text	YES	NULL			utf8mb4_unicode_ci	
6	media_urls	json	YES	NULL				
7	link_preview	json	YES	NULL				
8	location	json	YES	NULL				
9	tagged_users	json	YES	NULL				
10	feeling	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
11	activity	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
12	privacy	enum('public','followers','custom')	YES	public			utf8mb4_unicode_ci	
13	is_pinned	tinyint(1)	YES	0				
14	is_promoted	tinyint(1)	YES	0				
15	promotion_budget	decimal(10,2)	YES	NULL				
16	reach_count	bigint	YES	0				
17	engagement_count	int	YES	0				
18	like_count	int	YES	0				
19	comment_count	int	YES	0				
20	share_count	int	YES	0				
21	scheduled_publish	timestamp	YES	NULL				
22	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED	MUL		

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_author	NON_UNIQUE	BTREE	author_id	0
idx_created	NON_UNIQUE	BTREE	created_at	0
idx_page	NON_UNIQUE	BTREE	page_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
page_posts_ibfk_1	page_id	pages	id	NO ACTION	NO ACTION
page_posts_ibfk_2	author_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `page_posts` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `page_id` int NOT NULL,
  `author_id` int NOT NULL,
  `post_type` enum('status','photo','video','link','event','offer','job','live') COLLATE utf8mb4_unicode_ci DEFAULT 'status',
  `content` text COLLATE utf8mb4_unicode_ci,
  `media_urls` json DEFAULT NULL,
  `link_preview` json DEFAULT NULL,
  `location` json DEFAULT NULL,
  `tagged_users` json DEFAULT NULL,
  `feeling` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `activity` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `privacy` enum('public','followers','custom') COLLATE utf8mb4_unicode_ci DEFAULT 'public',
  `is_pinned` tinyint(1) DEFAULT '0',
  `is_promoted` tinyint(1) DEFAULT '0',
  `promotion_budget` decimal(10,2) DEFAULT NULL,
  `reach_count` bigint DEFAULT '0',
  `engagement_count` int DEFAULT '0',
  `like_count` int DEFAULT '0',
  `comment_count` int DEFAULT '0',
  `share_count` int DEFAULT '0',
  `scheduled_publish` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_page` (`page_id`),
  KEY `idx_author` (`author_id`),
  KEY `idx_created` (`created_at`),
  CONSTRAINT `page_posts_ibfk_1` FOREIGN KEY (`page_id`) REFERENCES `pages` (`id`),
  CONSTRAINT `page_posts_ibfk_2` FOREIGN KEY (`author_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: pages
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.08 | TOTAL_MB: 0.09 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:30:51 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	page_name	varchar(200)	NO	NULL			utf8mb4_unicode_ci	
3	page_username	varchar(100)	YES	NULL		UNI	utf8mb4_unicode_ci	
4	category	varchar(100)	NO	NULL		MUL	utf8mb4_unicode_ci	
5	subcategory	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
6	about	text	YES	NULL			utf8mb4_unicode_ci	
7	description	text	YES	NULL			utf8mb4_unicode_ci	
8	cover_photo	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
9	profile_photo	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
10	website	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
11	email	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
12	phone	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
13	address	text	YES	NULL			utf8mb4_unicode_ci	
14	location	json	YES	NULL				
15	business_hours	json	YES	NULL				
16	price_range	varchar(20)	YES	NULL			utf8mb4_unicode_ci	
17	payment_options	json	YES	NULL				
18	services	json	YES	NULL				
19	amenities	json	YES	NULL				
20	founder_id	int	NO	NULL		MUL		
21	admins	json	YES	NULL				
22	moderators	json	YES	NULL				
23	editors	json	YES	NULL				
24	like_count	int	YES	0		MUL		
25	follower_count	int	YES	0				
26	checkin_count	int	YES	0				
27	rating_average	decimal(3,2)	YES	0.00				
28	rating_count	int	YES	0				
29	is_verified	tinyint(1)	YES	0				
30	is_published	tinyint(1)	YES	1				
31	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_category	NON_UNIQUE	BTREE	category	0
idx_founder	NON_UNIQUE	BTREE	founder_id	0
idx_likes	NON_UNIQUE	BTREE	like_count	0
idx_username	NON_UNIQUE	BTREE	page_username	0
page_username	UNIQUE	BTREE	page_username	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
pages_ibfk_1	founder_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `pages` (
  `id` int NOT NULL AUTO_INCREMENT,
  `page_name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `page_username` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `category` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `subcategory` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `about` text COLLATE utf8mb4_unicode_ci,
  `description` text COLLATE utf8mb4_unicode_ci,
  `cover_photo` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `profile_photo` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `website` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address` text COLLATE utf8mb4_unicode_ci,
  `location` json DEFAULT NULL,
  `business_hours` json DEFAULT NULL,
  `price_range` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `payment_options` json DEFAULT NULL,
  `services` json DEFAULT NULL,
  `amenities` json DEFAULT NULL,
  `founder_id` int NOT NULL,
  `admins` json DEFAULT NULL,
  `moderators` json DEFAULT NULL,
  `editors` json DEFAULT NULL,
  `like_count` int DEFAULT '0',
  `follower_count` int DEFAULT '0',
  `checkin_count` int DEFAULT '0',
  `rating_average` decimal(3,2) DEFAULT '0.00',
  `rating_count` int DEFAULT '0',
  `is_verified` tinyint(1) DEFAULT '0',
  `is_published` tinyint(1) DEFAULT '1',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `page_username` (`page_username`),
  KEY `idx_username` (`page_username`),
  KEY `idx_category` (`category`),
  KEY `idx_founder` (`founder_id`),
  KEY `idx_likes` (`like_count`),
  CONSTRAINT `pages_ibfk_1` FOREIGN KEY (`founder_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: performance_metrics
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 16:03:29 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	metric_type	varchar(100)	NO	NULL		MUL	utf8mb4_unicode_ci	
3	endpoint	varchar(500)	YES	NULL		MUL	utf8mb4_unicode_ci	
4	response_time_ms	int	YES	NULL				
5	cpu_usage	decimal(5,2)	YES	NULL				
6	memory_usage	decimal(5,2)	YES	NULL				
7	disk_io	decimal(10,2)	YES	NULL				
8	network_io	decimal(10,2)	YES	NULL				
9	database_queries	int	YES	NULL				
10	cache_hits	int	YES	NULL				
11	cache_misses	int	YES	NULL				
12	error_count	int	YES	NULL				
13	success_rate	decimal(5,2)	YES	NULL				
14	concurrent_users	int	YES	NULL				
15	requests_per_second	decimal(10,2)	YES	NULL				
16	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED	MUL		

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_created	NON_UNIQUE	BTREE	created_at	0
idx_endpoint	NON_UNIQUE	BTREE	endpoint	0
idx_type	NON_UNIQUE	BTREE	metric_type	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `performance_metrics` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `metric_type` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `endpoint` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `response_time_ms` int DEFAULT NULL,
  `cpu_usage` decimal(5,2) DEFAULT NULL,
  `memory_usage` decimal(5,2) DEFAULT NULL,
  `disk_io` decimal(10,2) DEFAULT NULL,
  `network_io` decimal(10,2) DEFAULT NULL,
  `database_queries` int DEFAULT NULL,
  `cache_hits` int DEFAULT NULL,
  `cache_misses` int DEFAULT NULL,
  `error_count` int DEFAULT NULL,
  `success_rate` decimal(5,2) DEFAULT NULL,
  `concurrent_users` int DEFAULT NULL,
  `requests_per_second` decimal(10,2) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_type` (`metric_type`),
  KEY `idx_endpoint` (`endpoint`),
  KEY `idx_created` (`created_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: personal_ads
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:52:18 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	poster_id	int	NO	NULL		MUL		
3	ad_type	enum('missed_connection','strictly_platonic','activity_partner','rideshare','volunteer','lost_found')	NO	NULL		MUL	utf8mb4_unicode_ci	
4	title	varchar(300)	NO	NULL			utf8mb4_unicode_ci	
5	description	text	YES	NULL			utf8mb4_unicode_ci	
6	location	varchar(200)	YES	NULL		MUL	utf8mb4_unicode_ci	
7	when_where	text	YES	NULL			utf8mb4_unicode_ci	
8	age	int	YES	NULL				
9	gender	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
10	looking_for	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
11	images	json	YES	NULL				
12	contact_method	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
13	is_anonymous	tinyint(1)	YES	1				
14	view_count	int	YES	0				
15	response_count	int	YES	0				
16	expires_at	timestamp	YES	NULL				
17	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_location	NON_UNIQUE	BTREE	location	0
idx_poster	NON_UNIQUE	BTREE	poster_id	0
idx_type	NON_UNIQUE	BTREE	ad_type	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
personal_ads_ibfk_1	poster_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `personal_ads` (
  `id` int NOT NULL AUTO_INCREMENT,
  `poster_id` int NOT NULL,
  `ad_type` enum('missed_connection','strictly_platonic','activity_partner','rideshare','volunteer','lost_found') COLLATE utf8mb4_unicode_ci NOT NULL,
  `title` varchar(300) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `location` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `when_where` text COLLATE utf8mb4_unicode_ci,
  `age` int DEFAULT NULL,
  `gender` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `looking_for` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `images` json DEFAULT NULL,
  `contact_method` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_anonymous` tinyint(1) DEFAULT '1',
  `view_count` int DEFAULT '0',
  `response_count` int DEFAULT '0',
  `expires_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_poster` (`poster_id`),
  KEY `idx_type` (`ad_type`),
  KEY `idx_location` (`location`),
  CONSTRAINT `personal_ads_ibfk_1` FOREIGN KEY (`poster_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: pin_analytics
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:30:33 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	pin_id	bigint	NO	NULL		MUL		
3	date	date	NO	NULL		MUL		
4	impressions	int	YES	0				
5	closeups	int	YES	0				
6	link_clicks	int	YES	0				
7	saves	int	YES	0				
8	profile_visits	int	YES	0				
9	follows	int	YES	0				
10	engagement_rate	decimal(10,4)	YES	0.0000				
11	audience_demographics	json	YES	NULL				
12	traffic_sources	json	YES	NULL				
13	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_date	NON_UNIQUE	BTREE	date	0
idx_pin	NON_UNIQUE	BTREE	pin_id	0
unique_analytics	UNIQUE	BTREE	pin_id, date	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
pin_analytics_ibfk_1	pin_id	pins	id	NO ACTION	CASCADE

--- SHOW CREATE TABLE ---
CREATE TABLE `pin_analytics` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `pin_id` bigint NOT NULL,
  `date` date NOT NULL,
  `impressions` int DEFAULT '0',
  `closeups` int DEFAULT '0',
  `link_clicks` int DEFAULT '0',
  `saves` int DEFAULT '0',
  `profile_visits` int DEFAULT '0',
  `follows` int DEFAULT '0',
  `engagement_rate` decimal(10,4) DEFAULT '0.0000',
  `audience_demographics` json DEFAULT NULL,
  `traffic_sources` json DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_analytics` (`pin_id`,`date`),
  KEY `idx_pin` (`pin_id`),
  KEY `idx_date` (`date`),
  CONSTRAINT `pin_analytics_ibfk_1` FOREIGN KEY (`pin_id`) REFERENCES `pins` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: pin_comments
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:30:33 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	pin_id	bigint	NO	NULL		MUL		
3	user_id	int	NO	NULL		MUL		
4	comment_text	text	NO	NULL			utf8mb4_unicode_ci	
5	parent_comment_id	int	YES	NULL				
6	likes_count	int	YES	0				
7	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_pin	NON_UNIQUE	BTREE	pin_id	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
pin_comments_ibfk_1	pin_id	pins	id	NO ACTION	CASCADE
pin_comments_ibfk_2	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `pin_comments` (
  `id` int NOT NULL AUTO_INCREMENT,
  `pin_id` bigint NOT NULL,
  `user_id` int NOT NULL,
  `comment_text` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `parent_comment_id` int DEFAULT NULL,
  `likes_count` int DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_pin` (`pin_id`),
  KEY `idx_user` (`user_id`),
  CONSTRAINT `pin_comments_ibfk_1` FOREIGN KEY (`pin_id`) REFERENCES `pins` (`id`) ON DELETE CASCADE,
  CONSTRAINT `pin_comments_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: pins
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.08 | TOTAL_MB: 0.09 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:30:33 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	board_id	int	YES	NULL		MUL		
4	pin_type	enum('image','video','story','product','recipe','article')	YES	image			utf8mb4_unicode_ci	
5	title	varchar(500)	YES	NULL		MUL	utf8mb4_unicode_ci	
6	description	text	YES	NULL			utf8mb4_unicode_ci	
7	image_url	varchar(500)	NO	NULL			utf8mb4_unicode_ci	
8	video_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
9	link_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
10	domain	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
11	metadata	json	YES	NULL				
12	alt_text	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
13	hashtags	json	YES	NULL				
14	is_promoted	tinyint(1)	YES	0				
15	repin_count	int	YES	0				
16	like_count	int	YES	0				
17	comment_count	int	YES	0				
18	click_count	int	YES	0				
19	save_count	int	YES	0				
20	original_pin_id	bigint	YES	NULL		MUL		
21	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_board	NON_UNIQUE	BTREE	board_id	0
idx_original	NON_UNIQUE	BTREE	original_pin_id	0
idx_search	NON_UNIQUE	FULLTEXT	title, description	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
pins_ibfk_1	user_id	users	id	NO ACTION	NO ACTION
pins_ibfk_2	board_id	boards	id	NO ACTION	NO ACTION
pins_ibfk_3	original_pin_id	pins	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `pins` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `board_id` int DEFAULT NULL,
  `pin_type` enum('image','video','story','product','recipe','article') COLLATE utf8mb4_unicode_ci DEFAULT 'image',
  `title` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `image_url` varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL,
  `video_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `link_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `domain` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `metadata` json DEFAULT NULL,
  `alt_text` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `hashtags` json DEFAULT NULL,
  `is_promoted` tinyint(1) DEFAULT '0',
  `repin_count` int DEFAULT '0',
  `like_count` int DEFAULT '0',
  `comment_count` int DEFAULT '0',
  `click_count` int DEFAULT '0',
  `save_count` int DEFAULT '0',
  `original_pin_id` bigint DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_board` (`board_id`),
  KEY `idx_original` (`original_pin_id`),
  FULLTEXT KEY `idx_search` (`title`,`description`),
  CONSTRAINT `pins_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
  CONSTRAINT `pins_ibfk_2` FOREIGN KEY (`board_id`) REFERENCES `boards` (`id`),
  CONSTRAINT `pins_ibfk_3` FOREIGN KEY (`original_pin_id`) REFERENCES `pins` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: platform_integrations
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:53:41 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	platform_name	varchar(100)	NO	NULL		MUL	utf8mb4_unicode_ci	
4	integration_type	enum('import','export','sync','api')	NO	NULL			utf8mb4_unicode_ci	
5	api_credentials	json	YES	NULL				
6	webhook_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
7	sync_frequency	enum('realtime','hourly','daily','weekly','manual')	YES	daily			utf8mb4_unicode_ci	
8	last_sync	timestamp	YES	NULL				
9	next_sync	timestamp	YES	NULL				
10	sync_status	enum('active','paused','error','disconnected')	YES	active		MUL	utf8mb4_unicode_ci	
11	error_message	text	YES	NULL			utf8mb4_unicode_ci	
12	data_mapping	json	YES	NULL				
13	filters	json	YES	NULL				
14	is_active	tinyint(1)	YES	1				
15	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_platform	NON_UNIQUE	BTREE	platform_name	0
idx_status	NON_UNIQUE	BTREE	sync_status	0
idx_user	NON_UNIQUE	BTREE	user_id	0
unique_integration	UNIQUE	BTREE	user_id, platform_name	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
platform_integrations_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `platform_integrations` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `platform_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `integration_type` enum('import','export','sync','api') COLLATE utf8mb4_unicode_ci NOT NULL,
  `api_credentials` json DEFAULT NULL,
  `webhook_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `sync_frequency` enum('realtime','hourly','daily','weekly','manual') COLLATE utf8mb4_unicode_ci DEFAULT 'daily',
  `last_sync` timestamp NULL DEFAULT NULL,
  `next_sync` timestamp NULL DEFAULT NULL,
  `sync_status` enum('active','paused','error','disconnected') COLLATE utf8mb4_unicode_ci DEFAULT 'active',
  `error_message` text COLLATE utf8mb4_unicode_ci,
  `data_mapping` json DEFAULT NULL,
  `filters` json DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT '1',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_integration` (`user_id`,`platform_name`),
  KEY `idx_user` (`user_id`),
  KEY `idx_platform` (`platform_name`),
  KEY `idx_status` (`sync_status`),
  CONSTRAINT `platform_integrations_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: platform_migrations
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:31:20 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	source_platform	varchar(100)	NO	NULL			utf8mb4_unicode_ci	
4	import_type	varchar(50)	NO	NULL			utf8mb4_unicode_ci	
5	data_categories	json	YES	NULL				
6	total_items	int	YES	0				
7	processed_items	int	YES	0				
8	failed_items	int	YES	0				
9	mapping_rules	json	YES	NULL				
10	status	enum('preparing','importing','completed','failed')	YES	preparing		MUL	utf8mb4_unicode_ci	
11	error_log	json	YES	NULL				
12	started_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
13	completed_at	timestamp	YES	NULL				

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_status	NON_UNIQUE	BTREE	status	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
platform_migrations_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `platform_migrations` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `source_platform` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `import_type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `data_categories` json DEFAULT NULL,
  `total_items` int DEFAULT '0',
  `processed_items` int DEFAULT '0',
  `failed_items` int DEFAULT '0',
  `mapping_rules` json DEFAULT NULL,
  `status` enum('preparing','importing','completed','failed') COLLATE utf8mb4_unicode_ci DEFAULT 'preparing',
  `error_log` json DEFAULT NULL,
  `started_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `completed_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_status` (`status`),
  CONSTRAINT `platform_migrations_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: platform_notifications
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:53:41 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	platform	varchar(100)	NO	NULL		MUL	utf8mb4_unicode_ci	
4	notification_type	varchar(100)	NO	NULL			utf8mb4_unicode_ci	
5	title	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
6	message	text	NO	NULL			utf8mb4_unicode_ci	
7	data	json	YES	NULL				
8	priority	enum('low','medium','high','urgent')	YES	medium		MUL	utf8mb4_unicode_ci	
9	is_read	tinyint(1)	YES	0		MUL		
10	is_actioned	tinyint(1)	YES	0				
11	action_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
12	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
13	read_at	timestamp	YES	NULL				

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_platform	NON_UNIQUE	BTREE	platform	0
idx_priority	NON_UNIQUE	BTREE	priority	0
idx_read	NON_UNIQUE	BTREE	is_read	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
platform_notifications_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `platform_notifications` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `platform` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `notification_type` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `title` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `message` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `data` json DEFAULT NULL,
  `priority` enum('low','medium','high','urgent') COLLATE utf8mb4_unicode_ci DEFAULT 'medium',
  `is_read` tinyint(1) DEFAULT '0',
  `is_actioned` tinyint(1) DEFAULT '0',
  `action_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `read_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_platform` (`platform`),
  KEY `idx_read` (`is_read`),
  KEY `idx_priority` (`priority`),
  CONSTRAINT `platform_notifications_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: platform_webhooks
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:53:41 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	platform	varchar(100)	NO	NULL		MUL	utf8mb4_unicode_ci	
3	event_type	varchar(100)	NO	NULL		MUL	utf8mb4_unicode_ci	
4	payload	json	NO	NULL				
5	signature	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
6	verified	tinyint(1)	YES	0				
7	processed	tinyint(1)	YES	0		MUL		
8	process_attempts	int	YES	0				
9	last_attempt	timestamp	YES	NULL				
10	error_message	text	YES	NULL			utf8mb4_unicode_ci	
11	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_event	NON_UNIQUE	BTREE	event_type	0
idx_platform	NON_UNIQUE	BTREE	platform	0
idx_processed	NON_UNIQUE	BTREE	processed	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `platform_webhooks` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `platform` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `event_type` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `payload` json NOT NULL,
  `signature` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `verified` tinyint(1) DEFAULT '0',
  `processed` tinyint(1) DEFAULT '0',
  `process_attempts` int DEFAULT '0',
  `last_attempt` timestamp NULL DEFAULT NULL,
  `error_message` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_platform` (`platform`),
  KEY `idx_event` (`event_type`),
  KEY `idx_processed` (`processed`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: playlists
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:12:57 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	title	varchar(200)	NO	NULL			utf8mb4_unicode_ci	
4	description	text	YES	NULL			utf8mb4_unicode_ci	
5	cover_image	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
6	playlist_type	enum('music','podcast','mixed','radio')	YES	music		MUL	utf8mb4_unicode_ci	
7	items	json	YES	NULL				
8	total_duration_seconds	int	YES	0				
9	item_count	int	YES	0				
10	is_public	tinyint(1)	YES	1		MUL		
11	is_collaborative	tinyint(1)	YES	0				
12	collaborators	json	YES	NULL				
13	follow_count	int	YES	0				
14	play_count	int	YES	0				
15	is_official	tinyint(1)	YES	0				
16	is_featured	tinyint(1)	YES	0				
17	tags	json	YES	NULL				
18	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
19	updated_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_public	NON_UNIQUE	BTREE	is_public	0
idx_type	NON_UNIQUE	BTREE	playlist_type	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
playlists_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `playlists` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `title` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `cover_image` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `playlist_type` enum('music','podcast','mixed','radio') COLLATE utf8mb4_unicode_ci DEFAULT 'music',
  `items` json DEFAULT NULL,
  `total_duration_seconds` int DEFAULT '0',
  `item_count` int DEFAULT '0',
  `is_public` tinyint(1) DEFAULT '1',
  `is_collaborative` tinyint(1) DEFAULT '0',
  `collaborators` json DEFAULT NULL,
  `follow_count` int DEFAULT '0',
  `play_count` int DEFAULT '0',
  `is_official` tinyint(1) DEFAULT '0',
  `is_featured` tinyint(1) DEFAULT '0',
  `tags` json DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_type` (`playlist_type`),
  KEY `idx_public` (`is_public`),
  CONSTRAINT `playlists_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: podcast_episodes
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:12:57 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	podcast_id	int	NO	NULL		MUL		
3	episode_number	int	YES	NULL				
4	season_number	int	YES	NULL				
5	title	varchar(200)	NO	NULL			utf8mb4_unicode_ci	
6	description	text	YES	NULL			utf8mb4_unicode_ci	
7	audio_url	varchar(500)	NO	NULL			utf8mb4_unicode_ci	
8	duration_seconds	int	NO	NULL				
9	transcript	text	YES	NULL			utf8mb4_unicode_ci	
10	show_notes	text	YES	NULL			utf8mb4_unicode_ci	
11	guest_names	json	YES	NULL				
12	tags	json	YES	NULL				
13	chapters	json	YES	NULL				
14	publish_date	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED	MUL		
15	play_count	bigint	YES	0		MUL		
16	completion_rate	decimal(5,2)	YES	0.00				
17	like_count	int	YES	0				
18	comment_count	int	YES	0				
19	is_bonus	tinyint(1)	YES	0				
20	is_trailer	tinyint(1)	YES	0				
21	sponsor_segments	json	YES	NULL				
22	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_plays	NON_UNIQUE	BTREE	play_count	0
idx_podcast	NON_UNIQUE	BTREE	podcast_id	0
idx_publish	NON_UNIQUE	BTREE	publish_date	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
podcast_episodes_ibfk_1	podcast_id	podcasts	id	NO ACTION	CASCADE

--- SHOW CREATE TABLE ---
CREATE TABLE `podcast_episodes` (
  `id` int NOT NULL AUTO_INCREMENT,
  `podcast_id` int NOT NULL,
  `episode_number` int DEFAULT NULL,
  `season_number` int DEFAULT NULL,
  `title` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `audio_url` varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL,
  `duration_seconds` int NOT NULL,
  `transcript` text COLLATE utf8mb4_unicode_ci,
  `show_notes` text COLLATE utf8mb4_unicode_ci,
  `guest_names` json DEFAULT NULL,
  `tags` json DEFAULT NULL,
  `chapters` json DEFAULT NULL,
  `publish_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `play_count` bigint DEFAULT '0',
  `completion_rate` decimal(5,2) DEFAULT '0.00',
  `like_count` int DEFAULT '0',
  `comment_count` int DEFAULT '0',
  `is_bonus` tinyint(1) DEFAULT '0',
  `is_trailer` tinyint(1) DEFAULT '0',
  `sponsor_segments` json DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_podcast` (`podcast_id`),
  KEY `idx_publish` (`publish_date`),
  KEY `idx_plays` (`play_count`),
  CONSTRAINT `podcast_episodes_ibfk_1` FOREIGN KEY (`podcast_id`) REFERENCES `podcasts` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: podcasts
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:12:57 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	host_id	int	NO	NULL		MUL		
3	title	varchar(200)	NO	NULL			utf8mb4_unicode_ci	
4	description	text	YES	NULL			utf8mb4_unicode_ci	
5	category	varchar(100)	YES	NULL		MUL	utf8mb4_unicode_ci	
6	subcategory	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
7	language	varchar(10)	YES	en			utf8mb4_unicode_ci	
8	cover_image	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
9	trailer_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
10	rss_feed_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
11	website_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
12	email	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
13	is_explicit	tinyint(1)	YES	0				
14	is_complete	tinyint(1)	YES	0				
15	episode_count	int	YES	0				
16	total_duration_hours	decimal(10,2)	YES	0.00				
17	average_episode_length	int	YES	30				
18	publishing_frequency	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
19	subscriber_count	int	YES	0		MUL		
20	average_rating	decimal(3,2)	YES	0.00				
21	total_plays	bigint	YES	0				
22	is_verified	tinyint(1)	YES	0				
23	is_featured	tinyint(1)	YES	0				
24	monetization_enabled	tinyint(1)	YES	0				
25	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_category	NON_UNIQUE	BTREE	category	0
idx_host	NON_UNIQUE	BTREE	host_id	0
idx_subscribers	NON_UNIQUE	BTREE	subscriber_count	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
podcasts_ibfk_1	host_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `podcasts` (
  `id` int NOT NULL AUTO_INCREMENT,
  `host_id` int NOT NULL,
  `title` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `category` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `subcategory` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `language` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT 'en',
  `cover_image` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `trailer_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `rss_feed_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `website_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_explicit` tinyint(1) DEFAULT '0',
  `is_complete` tinyint(1) DEFAULT '0',
  `episode_count` int DEFAULT '0',
  `total_duration_hours` decimal(10,2) DEFAULT '0.00',
  `average_episode_length` int DEFAULT '30',
  `publishing_frequency` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `subscriber_count` int DEFAULT '0',
  `average_rating` decimal(3,2) DEFAULT '0.00',
  `total_plays` bigint DEFAULT '0',
  `is_verified` tinyint(1) DEFAULT '0',
  `is_featured` tinyint(1) DEFAULT '0',
  `monetization_enabled` tinyint(1) DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_host` (`host_id`),
  KEY `idx_category` (`category`),
  KEY `idx_subscribers` (`subscriber_count`),
  CONSTRAINT `podcasts_ibfk_1` FOREIGN KEY (`host_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: pos_systems
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.02 | TOTAL_MB: 0.03 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:52:35 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	store_id	int	NO	NULL		MUL		
3	location_name	varchar(200)	NO	NULL			utf8mb4_unicode_ci	
4	address	text	YES	NULL			utf8mb4_unicode_ci	
5	terminal_count	int	YES	1				
6	hardware_setup	json	YES	NULL				
7	staff_pins	json	YES	NULL				
8	cash_drawer_float	decimal(10,2)	YES	0.00				
9	current_shift_id	int	YES	NULL				
10	daily_sales	decimal(12,2)	YES	0.00				
11	is_online	tinyint(1)	YES	1				
12	last_sync	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
13	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_store	NON_UNIQUE	BTREE	store_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
pos_systems_ibfk_1	store_id	online_stores	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `pos_systems` (
  `id` int NOT NULL AUTO_INCREMENT,
  `store_id` int NOT NULL,
  `location_name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `address` text COLLATE utf8mb4_unicode_ci,
  `terminal_count` int DEFAULT '1',
  `hardware_setup` json DEFAULT NULL,
  `staff_pins` json DEFAULT NULL,
  `cash_drawer_float` decimal(10,2) DEFAULT '0.00',
  `current_shift_id` int DEFAULT NULL,
  `daily_sales` decimal(12,2) DEFAULT '0.00',
  `is_online` tinyint(1) DEFAULT '1',
  `last_sync` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_store` (`store_id`),
  CONSTRAINT `pos_systems_ibfk_1` FOREIGN KEY (`store_id`) REFERENCES `online_stores` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: post_comments
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.08 | TOTAL_MB: 0.09 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:28:29 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	post_id	bigint	NO	NULL		MUL		
3	parent_comment_id	bigint	YES	NULL		MUL		
4	author_id	int	NO	NULL		MUL		
5	comment_text	text	NO	NULL			utf8mb4_unicode_ci	
6	depth_level	int	YES	0				
7	path	varchar(500)	YES	NULL		MUL	utf8mb4_unicode_ci	
8	upvotes	int	YES	1				
9	downvotes	int	YES	0				
10	score	int	YES	1		MUL		
11	is_edited	tinyint(1)	YES	0				
12	is_deleted	tinyint(1)	YES	0				
13	is_removed	tinyint(1)	YES	0				
14	is_distinguished	tinyint(1)	YES	0				
15	awards	json	YES	NULL				
16	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
17	edited_at	timestamp	YES	NULL				

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_author	NON_UNIQUE	BTREE	author_id	0
idx_parent	NON_UNIQUE	BTREE	parent_comment_id	0
idx_path	NON_UNIQUE	BTREE	path	0
idx_post	NON_UNIQUE	BTREE	post_id	0
idx_score	NON_UNIQUE	BTREE	score	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
post_comments_ibfk_1	post_id	community_posts	id	NO ACTION	NO ACTION
post_comments_ibfk_2	parent_comment_id	post_comments	id	NO ACTION	NO ACTION
post_comments_ibfk_3	author_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `post_comments` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `post_id` bigint NOT NULL,
  `parent_comment_id` bigint DEFAULT NULL,
  `author_id` int NOT NULL,
  `comment_text` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `depth_level` int DEFAULT '0',
  `path` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `upvotes` int DEFAULT '1',
  `downvotes` int DEFAULT '0',
  `score` int DEFAULT '1',
  `is_edited` tinyint(1) DEFAULT '0',
  `is_deleted` tinyint(1) DEFAULT '0',
  `is_removed` tinyint(1) DEFAULT '0',
  `is_distinguished` tinyint(1) DEFAULT '0',
  `awards` json DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `edited_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_post` (`post_id`),
  KEY `idx_parent` (`parent_comment_id`),
  KEY `idx_author` (`author_id`),
  KEY `idx_score` (`score` DESC),
  KEY `idx_path` (`path`),
  CONSTRAINT `post_comments_ibfk_1` FOREIGN KEY (`post_id`) REFERENCES `community_posts` (`id`),
  CONSTRAINT `post_comments_ibfk_2` FOREIGN KEY (`parent_comment_id`) REFERENCES `post_comments` (`id`),
  CONSTRAINT `post_comments_ibfk_3` FOREIGN KEY (`author_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: post_notes
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:28:08 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	post_id	bigint	NO	NULL		MUL		
3	user_id	int	NO	NULL		MUL		
4	note_type	enum('like','reblog','reply','mention')	NO	NULL		MUL	utf8mb4_unicode_ci	
5	note_content	text	YES	NULL			utf8mb4_unicode_ci	
6	reblog_post_id	bigint	YES	NULL				
7	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_post	NON_UNIQUE	BTREE	post_id	0
idx_type	NON_UNIQUE	BTREE	note_type	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
post_notes_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `post_notes` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `post_id` bigint NOT NULL,
  `user_id` int NOT NULL,
  `note_type` enum('like','reblog','reply','mention') COLLATE utf8mb4_unicode_ci NOT NULL,
  `note_content` text COLLATE utf8mb4_unicode_ci,
  `reblog_post_id` bigint DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_post` (`post_id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_type` (`note_type`),
  CONSTRAINT `post_notes_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: power_seller_status
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:52:02 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	seller_id	int	NO	NULL		UNI		
3	level	enum('bronze','silver','gold','platinum','titanium')	YES	bronze		MUL	utf8mb4_unicode_ci	
4	total_sales	int	YES	0				
5	total_revenue	decimal(20,2)	YES	0.00				
6	positive_feedback_percentage	decimal(5,2)	YES	0.00				
7	average_shipping_time_days	decimal(5,2)	YES	NULL				
8	defect_rate	decimal(5,2)	YES	0.00				
9	case_closed_without_resolution_rate	decimal(5,2)	YES	0.00				
10	late_shipment_rate	decimal(5,2)	YES	0.00				
11	benefits	json	YES	NULL				
12	achieved_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
13	expires_at	timestamp	YES	NULL				

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_level	NON_UNIQUE	BTREE	level	0
idx_seller	NON_UNIQUE	BTREE	seller_id	0
seller_id	UNIQUE	BTREE	seller_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
power_seller_status_ibfk_1	seller_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `power_seller_status` (
  `id` int NOT NULL AUTO_INCREMENT,
  `seller_id` int NOT NULL,
  `level` enum('bronze','silver','gold','platinum','titanium') COLLATE utf8mb4_unicode_ci DEFAULT 'bronze',
  `total_sales` int DEFAULT '0',
  `total_revenue` decimal(20,2) DEFAULT '0.00',
  `positive_feedback_percentage` decimal(5,2) DEFAULT '0.00',
  `average_shipping_time_days` decimal(5,2) DEFAULT NULL,
  `defect_rate` decimal(5,2) DEFAULT '0.00',
  `case_closed_without_resolution_rate` decimal(5,2) DEFAULT '0.00',
  `late_shipment_rate` decimal(5,2) DEFAULT '0.00',
  `benefits` json DEFAULT NULL,
  `achieved_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `expires_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `seller_id` (`seller_id`),
  KEY `idx_seller` (`seller_id`),
  KEY `idx_level` (`level`),
  CONSTRAINT `power_seller_status_ibfk_1` FOREIGN KEY (`seller_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: predictive_analytics
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:53:58 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	prediction_type	varchar(100)	NO	NULL		MUL	utf8mb4_unicode_ci	
3	entity_type	varchar(100)	NO	NULL		MUL	utf8mb4_unicode_ci	
4	entity_id	varchar(200)	NO	NULL			utf8mb4_unicode_ci	
5	prediction_value	json	NO	NULL				
6	confidence_score	decimal(5,4)	YES	NULL				
7	model_version	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
8	feature_importance	json	YES	NULL				
9	prediction_date	date	NO	NULL		MUL		
10	valid_until	date	YES	NULL				
11	actual_value	json	YES	NULL				
12	accuracy_score	decimal(5,4)	YES	NULL				
13	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_date	NON_UNIQUE	BTREE	prediction_date	0
idx_entity	NON_UNIQUE	BTREE	entity_type, entity_id	0
idx_type	NON_UNIQUE	BTREE	prediction_type	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `predictive_analytics` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `prediction_type` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `entity_type` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `entity_id` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `prediction_value` json NOT NULL,
  `confidence_score` decimal(5,4) DEFAULT NULL,
  `model_version` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `feature_importance` json DEFAULT NULL,
  `prediction_date` date NOT NULL,
  `valid_until` date DEFAULT NULL,
  `actual_value` json DEFAULT NULL,
  `accuracy_score` decimal(5,4) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_type` (`prediction_type`),
  KEY `idx_entity` (`entity_type`,`entity_id`),
  KEY `idx_date` (`prediction_date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: predictive_models
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 16:04:49 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	model_name	varchar(200)	NO	NULL			utf8mb4_unicode_ci	
3	model_type	varchar(100)	YES	NULL		MUL	utf8mb4_unicode_ci	
4	target_variable	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
5	features	json	YES	NULL				
6	algorithm	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
7	hyperparameters	json	YES	NULL				
8	training_data_size	int	YES	NULL				
9	accuracy_score	decimal(5,4)	YES	NULL				
10	precision_score	decimal(5,4)	YES	NULL				
11	recall_score	decimal(5,4)	YES	NULL				
12	f1_score	decimal(5,4)	YES	NULL				
13	confusion_matrix	json	YES	NULL				
14	feature_importance	json	YES	NULL				
15	version	varchar(20)	YES	NULL			utf8mb4_unicode_ci	
16	is_active	tinyint(1)	YES	1		MUL		
17	trained_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_active	NON_UNIQUE	BTREE	is_active	0
idx_type	NON_UNIQUE	BTREE	model_type	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `predictive_models` (
  `id` int NOT NULL AUTO_INCREMENT,
  `model_name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `model_type` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `target_variable` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `features` json DEFAULT NULL,
  `algorithm` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `hyperparameters` json DEFAULT NULL,
  `training_data_size` int DEFAULT NULL,
  `accuracy_score` decimal(5,4) DEFAULT NULL,
  `precision_score` decimal(5,4) DEFAULT NULL,
  `recall_score` decimal(5,4) DEFAULT NULL,
  `f1_score` decimal(5,4) DEFAULT NULL,
  `confusion_matrix` json DEFAULT NULL,
  `feature_importance` json DEFAULT NULL,
  `version` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT '1',
  `trained_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_type` (`model_type`),
  KEY `idx_active` (`is_active`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: premium_content
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:48:02 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	creator_id	int	NO	NULL		MUL		
3	title	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
4	description	text	YES	NULL			utf8mb4_unicode_ci	
5	content_type	enum('photo','video','audio','text','live','bundle')	NO	NULL		MUL	utf8mb4_unicode_ci	
6	media_urls	json	YES	NULL				
7	thumbnail_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
8	preview_urls	json	YES	NULL				
9	duration_seconds	int	YES	NULL				
10	price	decimal(10,2)	YES	0.00				
11	is_ppv	tinyint(1)	YES	0		MUL		
12	ppv_price	decimal(10,2)	YES	NULL				
13	is_subscriber_only	tinyint(1)	YES	1				
14	unlock_count	int	YES	0				
15	likes_count	int	YES	0				
16	comments_count	int	YES	0				
17	tips_received	decimal(10,2)	YES	0.00				
18	tags	json	YES	NULL				
19	scheduled_publish	timestamp	YES	NULL				
20	expires_at	timestamp	YES	NULL				
21	is_pinned	tinyint(1)	YES	0				
22	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_creator	NON_UNIQUE	BTREE	creator_id	0
idx_ppv	NON_UNIQUE	BTREE	is_ppv	0
idx_type	NON_UNIQUE	BTREE	content_type	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
premium_content_ibfk_1	creator_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `premium_content` (
  `id` int NOT NULL AUTO_INCREMENT,
  `creator_id` int NOT NULL,
  `title` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `content_type` enum('photo','video','audio','text','live','bundle') COLLATE utf8mb4_unicode_ci NOT NULL,
  `media_urls` json DEFAULT NULL,
  `thumbnail_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `preview_urls` json DEFAULT NULL,
  `duration_seconds` int DEFAULT NULL,
  `price` decimal(10,2) DEFAULT '0.00',
  `is_ppv` tinyint(1) DEFAULT '0',
  `ppv_price` decimal(10,2) DEFAULT NULL,
  `is_subscriber_only` tinyint(1) DEFAULT '1',
  `unlock_count` int DEFAULT '0',
  `likes_count` int DEFAULT '0',
  `comments_count` int DEFAULT '0',
  `tips_received` decimal(10,2) DEFAULT '0.00',
  `tags` json DEFAULT NULL,
  `scheduled_publish` timestamp NULL DEFAULT NULL,
  `expires_at` timestamp NULL DEFAULT NULL,
  `is_pinned` tinyint(1) DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_creator` (`creator_id`),
  KEY `idx_type` (`content_type`),
  KEY `idx_ppv` (`is_ppv`),
  CONSTRAINT `premium_content_ibfk_1` FOREIGN KEY (`creator_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: premium_user_dashboard
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 16:04:26 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		UNI		
3	premium_expires	date	YES	NULL				
4	features_unlocked	json	YES	NULL				
5	storage_bonus_gb	int	YES	0				
6	exclusive_content_available	int	YES	0				
7	early_access_items	int	YES	0				
8	monthly_bonus_claimed	tinyint(1)	YES	0				
9	loyalty_points	int	YES	0				
10	support_tickets_priority	int	YES	0				
11	average_response_time_minutes	int	YES	0				
12	total_saved_with_premium	decimal(12,2)	YES	0.00				
13	free_shipping_used	int	YES	0				
14	last_updated	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_user	NON_UNIQUE	BTREE	user_id	0
unique_user	UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
premium_user_dashboard_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `premium_user_dashboard` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `premium_expires` date DEFAULT NULL,
  `features_unlocked` json DEFAULT NULL,
  `storage_bonus_gb` int DEFAULT '0',
  `exclusive_content_available` int DEFAULT '0',
  `early_access_items` int DEFAULT '0',
  `monthly_bonus_claimed` tinyint(1) DEFAULT '0',
  `loyalty_points` int DEFAULT '0',
  `support_tickets_priority` int DEFAULT '0',
  `average_response_time_minutes` int DEFAULT '0',
  `total_saved_with_premium` decimal(12,2) DEFAULT '0.00',
  `free_shipping_used` int DEFAULT '0',
  `last_updated` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_user` (`user_id`),
  KEY `idx_user` (`user_id`),
  CONSTRAINT `premium_user_dashboard_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: product_questions
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:51:43 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	product_id	bigint	NO	NULL		MUL		
3	asker_id	int	NO	NULL		MUL		
4	question	text	NO	NULL			utf8mb4_unicode_ci	
5	answer	text	YES	NULL			utf8mb4_unicode_ci	
6	answered_by	int	YES	NULL		MUL		
7	is_vendor_answer	tinyint(1)	YES	0				
8	helpful_count	int	YES	0				
9	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
10	answered_at	timestamp	YES	NULL				

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
answered_by	NON_UNIQUE	BTREE	answered_by	0
idx_asker	NON_UNIQUE	BTREE	asker_id	0
idx_product	NON_UNIQUE	BTREE	product_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
product_questions_ibfk_1	product_id	products_catalog	id	NO ACTION	NO ACTION
product_questions_ibfk_2	asker_id	users	id	NO ACTION	NO ACTION
product_questions_ibfk_3	answered_by	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `product_questions` (
  `id` int NOT NULL AUTO_INCREMENT,
  `product_id` bigint NOT NULL,
  `asker_id` int NOT NULL,
  `question` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `answer` text COLLATE utf8mb4_unicode_ci,
  `answered_by` int DEFAULT NULL,
  `is_vendor_answer` tinyint(1) DEFAULT '0',
  `helpful_count` int DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `answered_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_product` (`product_id`),
  KEY `idx_asker` (`asker_id`),
  KEY `answered_by` (`answered_by`),
  CONSTRAINT `product_questions_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `products_catalog` (`id`),
  CONSTRAINT `product_questions_ibfk_2` FOREIGN KEY (`asker_id`) REFERENCES `users` (`id`),
  CONSTRAINT `product_questions_ibfk_3` FOREIGN KEY (`answered_by`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: product_reviews
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:51:43 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	product_id	bigint	NO	NULL		MUL		
3	order_item_id	bigint	YES	NULL				
4	reviewer_id	int	NO	NULL		MUL		
5	rating	int	NO	NULL		MUL		
6	title	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
7	review_text	text	YES	NULL			utf8mb4_unicode_ci	
8	pros	text	YES	NULL			utf8mb4_unicode_ci	
9	cons	text	YES	NULL			utf8mb4_unicode_ci	
10	verified_purchase	tinyint(1)	YES	0		MUL		
11	images	json	YES	NULL				
12	videos	json	YES	NULL				
13	helpful_count	int	YES	0				
14	unhelpful_count	int	YES	0				
15	vendor_response	text	YES	NULL			utf8mb4_unicode_ci	
16	vendor_response_date	timestamp	YES	NULL				
17	ai_sentiment_score	decimal(5,4)	YES	NULL				
18	ai_topics_extracted	json	YES	NULL				
19	ai_verified_authentic	tinyint(1)	YES	1				
20	is_featured	tinyint(1)	YES	0				
21	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
22	updated_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_product	NON_UNIQUE	BTREE	product_id	0
idx_rating	NON_UNIQUE	BTREE	rating	0
idx_reviewer	NON_UNIQUE	BTREE	reviewer_id	0
idx_verified	NON_UNIQUE	BTREE	verified_purchase	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
product_reviews_ibfk_1	product_id	products_catalog	id	NO ACTION	NO ACTION
product_reviews_ibfk_2	reviewer_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `product_reviews` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `product_id` bigint NOT NULL,
  `order_item_id` bigint DEFAULT NULL,
  `reviewer_id` int NOT NULL,
  `rating` int NOT NULL,
  `title` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `review_text` text COLLATE utf8mb4_unicode_ci,
  `pros` text COLLATE utf8mb4_unicode_ci,
  `cons` text COLLATE utf8mb4_unicode_ci,
  `verified_purchase` tinyint(1) DEFAULT '0',
  `images` json DEFAULT NULL,
  `videos` json DEFAULT NULL,
  `helpful_count` int DEFAULT '0',
  `unhelpful_count` int DEFAULT '0',
  `vendor_response` text COLLATE utf8mb4_unicode_ci,
  `vendor_response_date` timestamp NULL DEFAULT NULL,
  `ai_sentiment_score` decimal(5,4) DEFAULT NULL,
  `ai_topics_extracted` json DEFAULT NULL,
  `ai_verified_authentic` tinyint(1) DEFAULT '1',
  `is_featured` tinyint(1) DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_product` (`product_id`),
  KEY `idx_reviewer` (`reviewer_id`),
  KEY `idx_rating` (`rating`),
  KEY `idx_verified` (`verified_purchase`),
  CONSTRAINT `product_reviews_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `products_catalog` (`id`),
  CONSTRAINT `product_reviews_ibfk_2` FOREIGN KEY (`reviewer_id`) REFERENCES `users` (`id`),
  CONSTRAINT `product_reviews_chk_1` CHECK ((`rating` between 1 and 5))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: products_catalog
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.16 | TOTAL_MB: 0.17 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:51:43 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	store_id	int	NO	NULL		MUL		
3	sku	varchar(100)	NO	NULL		UNI	utf8mb4_unicode_ci	
4	barcode	varchar(100)	YES	NULL		MUL	utf8mb4_unicode_ci	
5	asin	varchar(20)	YES	NULL			utf8mb4_unicode_ci	
6	product_name	varchar(500)	NO	NULL		MUL	utf8mb4_unicode_ci	
7	brand	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
8	manufacturer	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
9	category_path	json	YES	NULL				
10	description	text	YES	NULL			utf8mb4_unicode_ci	
11	features	json	YES	NULL				
12	specifications	json	YES	NULL				
13	dimensions	json	YES	NULL				
14	weight_kg	decimal(10,3)	YES	NULL				
15	materials	json	YES	NULL				
16	colors_available	json	YES	NULL				
17	sizes_available	json	YES	NULL				
18	variants	json	YES	NULL				
19	main_image	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
20	image_gallery	json	YES	NULL				
21	video_urls	json	YES	NULL				
22	ar_model_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
23	price	decimal(12,2)	NO	NULL		MUL		
24	compare_at_price	decimal(12,2)	YES	NULL				
25	cost_price	decimal(12,2)	YES	NULL				
26	currency	varchar(3)	YES	USD			utf8mb4_unicode_ci	
27	tax_class	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
28	inventory_quantity	int	YES	0				
29	reserved_quantity	int	YES	0				
30	reorder_point	int	YES	10				
31	track_inventory	tinyint(1)	YES	1				
32	allow_backorder	tinyint(1)	YES	0				
33	shipping_class	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
34	shipping_weight	decimal(10,3)	YES	NULL				
35	requires_shipping	tinyint(1)	YES	1				
36	is_digital	tinyint(1)	YES	0				
37	download_files	json	YES	NULL				
38	is_gift_card	tinyint(1)	YES	0				
39	seo_title	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
40	seo_description	text	YES	NULL			utf8mb4_unicode_ci	
41	seo_keywords	json	YES	NULL				
42	tags	json	YES	NULL				
43	view_count	bigint	YES	0				
44	sale_count	int	YES	0		MUL		
45	wishlist_count	int	YES	0				
46	average_rating	decimal(3,2)	YES	0.00		MUL		
47	review_count	int	YES	0				
48	q_and_a_count	int	YES	0				
49	is_bestseller	tinyint(1)	YES	0				
50	is_featured	tinyint(1)	YES	0				
51	is_new_arrival	tinyint(1)	YES	0				
52	is_on_sale	tinyint(1)	YES	0				
53	sale_price	decimal(12,2)	YES	NULL				
54	sale_start_date	timestamp	YES	NULL				
55	sale_end_date	timestamp	YES	NULL				
56	status	enum('active','draft','out_of_stock','discontinued','pending')	YES	active		MUL	utf8mb4_unicode_ci	
57	ai_generated_tags	json	YES	NULL				
58	ai_category_confidence	decimal(5,4)	YES	NULL				
59	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
60	updated_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_barcode	NON_UNIQUE	BTREE	barcode	0
idx_price	NON_UNIQUE	BTREE	price	0
idx_rating	NON_UNIQUE	BTREE	average_rating	0
idx_sales	NON_UNIQUE	BTREE	sale_count	0
idx_search	NON_UNIQUE	FULLTEXT	product_name, description	0
idx_sku	NON_UNIQUE	BTREE	sku	0
idx_status	NON_UNIQUE	BTREE	status	0
idx_store	NON_UNIQUE	BTREE	store_id	0
sku	UNIQUE	BTREE	sku	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
products_catalog_ibfk_1	store_id	vendor_stores	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `products_catalog` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `store_id` int NOT NULL,
  `sku` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `barcode` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `asin` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `product_name` varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL,
  `brand` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `manufacturer` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `category_path` json DEFAULT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `features` json DEFAULT NULL,
  `specifications` json DEFAULT NULL,
  `dimensions` json DEFAULT NULL,
  `weight_kg` decimal(10,3) DEFAULT NULL,
  `materials` json DEFAULT NULL,
  `colors_available` json DEFAULT NULL,
  `sizes_available` json DEFAULT NULL,
  `variants` json DEFAULT NULL,
  `main_image` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `image_gallery` json DEFAULT NULL,
  `video_urls` json DEFAULT NULL,
  `ar_model_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `price` decimal(12,2) NOT NULL,
  `compare_at_price` decimal(12,2) DEFAULT NULL,
  `cost_price` decimal(12,2) DEFAULT NULL,
  `currency` varchar(3) COLLATE utf8mb4_unicode_ci DEFAULT 'USD',
  `tax_class` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `inventory_quantity` int DEFAULT '0',
  `reserved_quantity` int DEFAULT '0',
  `reorder_point` int DEFAULT '10',
  `track_inventory` tinyint(1) DEFAULT '1',
  `allow_backorder` tinyint(1) DEFAULT '0',
  `shipping_class` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `shipping_weight` decimal(10,3) DEFAULT NULL,
  `requires_shipping` tinyint(1) DEFAULT '1',
  `is_digital` tinyint(1) DEFAULT '0',
  `download_files` json DEFAULT NULL,
  `is_gift_card` tinyint(1) DEFAULT '0',
  `seo_title` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `seo_description` text COLLATE utf8mb4_unicode_ci,
  `seo_keywords` json DEFAULT NULL,
  `tags` json DEFAULT NULL,
  `view_count` bigint DEFAULT '0',
  `sale_count` int DEFAULT '0',
  `wishlist_count` int DEFAULT '0',
  `average_rating` decimal(3,2) DEFAULT '0.00',
  `review_count` int DEFAULT '0',
  `q_and_a_count` int DEFAULT '0',
  `is_bestseller` tinyint(1) DEFAULT '0',
  `is_featured` tinyint(1) DEFAULT '0',
  `is_new_arrival` tinyint(1) DEFAULT '0',
  `is_on_sale` tinyint(1) DEFAULT '0',
  `sale_price` decimal(12,2) DEFAULT NULL,
  `sale_start_date` timestamp NULL DEFAULT NULL,
  `sale_end_date` timestamp NULL DEFAULT NULL,
  `status` enum('active','draft','out_of_stock','discontinued','pending') COLLATE utf8mb4_unicode_ci DEFAULT 'active',
  `ai_generated_tags` json DEFAULT NULL,
  `ai_category_confidence` decimal(5,4) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `sku` (`sku`),
  KEY `idx_store` (`store_id`),
  KEY `idx_sku` (`sku`),
  KEY `idx_barcode` (`barcode`),
  KEY `idx_price` (`price`),
  KEY `idx_rating` (`average_rating`),
  KEY `idx_sales` (`sale_count`),
  KEY `idx_status` (`status`),
  FULLTEXT KEY `idx_search` (`product_name`,`description`),
  CONSTRAINT `products_catalog_ibfk_1` FOREIGN KEY (`store_id`) REFERENCES `vendor_stores` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: profile_history
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_0900_ai_ci | CREATE: 2025-08-04 01:43:53 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	field_name	varchar(50)	YES	NULL			utf8mb4_0900_ai_ci	
4	old_value	text	YES	NULL			utf8mb4_0900_ai_ci	
5	new_value	text	YES	NULL			utf8mb4_0900_ai_ci	
6	changed_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED	MUL		
7	ip_address	varchar(45)	YES	NULL			utf8mb4_0900_ai_ci	

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_changed	NON_UNIQUE	BTREE	changed_at	0
idx_user_field	NON_UNIQUE	BTREE	user_id, field_name	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
profile_history_ibfk_1	user_id	users	id	NO ACTION	CASCADE

--- SHOW CREATE TABLE ---
CREATE TABLE `profile_history` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `field_name` varchar(50) DEFAULT NULL,
  `old_value` text,
  `new_value` text,
  `changed_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `ip_address` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_user_field` (`user_id`,`field_name`),
  KEY `idx_changed` (`changed_at`),
  CONSTRAINT `profile_history_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;


============================================================
TABLE: progressive_jackpots
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:59:21 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	jackpot_name	varchar(100)	NO	NULL			utf8mb4_unicode_ci	
3	jackpot_type	enum('mini','minor','major','mega','grand')	NO	NULL		MUL	utf8mb4_unicode_ci	
4	current_amount	decimal(20,2)	YES	0.00				
5	seed_amount	decimal(20,2)	YES	100.00				
6	contribution_rate	decimal(5,2)	YES	1.00				
7	must_hit_by	decimal(20,2)	YES	NULL				
8	last_won_amount	decimal(20,2)	YES	NULL				
9	last_won_by	int	YES	NULL		MUL		
10	last_won_at	timestamp	YES	NULL				
11	total_won_count	int	YES	0				
12	total_won_amount	decimal(20,2)	YES	0.00				
13	eligible_games	json	YES	NULL				
14	min_bet_required	decimal(10,2)	YES	1.00				
15	is_active	tinyint(1)	YES	1		MUL		
16	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
17	updated_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_active	NON_UNIQUE	BTREE	is_active	0
idx_type	NON_UNIQUE	BTREE	jackpot_type	0
last_won_by	NON_UNIQUE	BTREE	last_won_by	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
progressive_jackpots_ibfk_1	last_won_by	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `progressive_jackpots` (
  `id` int NOT NULL AUTO_INCREMENT,
  `jackpot_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `jackpot_type` enum('mini','minor','major','mega','grand') COLLATE utf8mb4_unicode_ci NOT NULL,
  `current_amount` decimal(20,2) DEFAULT '0.00',
  `seed_amount` decimal(20,2) DEFAULT '100.00',
  `contribution_rate` decimal(5,2) DEFAULT '1.00',
  `must_hit_by` decimal(20,2) DEFAULT NULL,
  `last_won_amount` decimal(20,2) DEFAULT NULL,
  `last_won_by` int DEFAULT NULL,
  `last_won_at` timestamp NULL DEFAULT NULL,
  `total_won_count` int DEFAULT '0',
  `total_won_amount` decimal(20,2) DEFAULT '0.00',
  `eligible_games` json DEFAULT NULL,
  `min_bet_required` decimal(10,2) DEFAULT '1.00',
  `is_active` tinyint(1) DEFAULT '1',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_type` (`jackpot_type`),
  KEY `idx_active` (`is_active`),
  KEY `last_won_by` (`last_won_by`),
  CONSTRAINT `progressive_jackpots_ibfk_1` FOREIGN KEY (`last_won_by`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: purchase_orders
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.09 | TOTAL_MB: 0.11 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:51:43 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	order_number	varchar(50)	NO	NULL		UNI	utf8mb4_unicode_ci	
3	customer_id	int	NO	NULL		MUL		
4	billing_address	json	NO	NULL				
5	shipping_address	json	NO	NULL				
6	shipping_method	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
7	shipping_carrier	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
8	tracking_numbers	json	YES	NULL				
9	items	json	NO	NULL				
10	subtotal	decimal(12,2)	NO	NULL				
11	tax_amount	decimal(10,2)	YES	0.00				
12	shipping_cost	decimal(10,2)	YES	0.00				
13	handling_fee	decimal(10,2)	YES	0.00				
14	insurance_fee	decimal(10,2)	YES	0.00				
15	discount_amount	decimal(10,2)	YES	0.00				
16	total_amount	decimal(12,2)	NO	NULL				
17	currency	varchar(3)	YES	USD			utf8mb4_unicode_ci	
18	exchange_rate	decimal(10,6)	YES	1.000000				
19	payment_method	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
20	payment_status	enum('pending','processing','paid','partially_paid','failed','refunded','partially_refunded')	YES	pending		MUL	utf8mb4_unicode_ci	
21	payment_details	json	YES	NULL				
22	order_status	enum('pending','confirmed','processing','shipped','out_for_delivery','delivered','cancelled','returned','refunded')	YES	pending		MUL	utf8mb4_unicode_ci	
23	fulfillment_status	enum('unfulfilled','partially_fulfilled','fulfilled','cancelled')	YES	unfulfilled			utf8mb4_unicode_ci	
24	estimated_delivery	date	YES	NULL				
25	actual_delivery	timestamp	YES	NULL				
26	notes	text	YES	NULL			utf8mb4_unicode_ci	
27	gift_message	text	YES	NULL			utf8mb4_unicode_ci	
28	is_gift	tinyint(1)	YES	0				
29	customer_ip	varchar(45)	YES	NULL			utf8mb4_unicode_ci	
30	user_agent	text	YES	NULL			utf8mb4_unicode_ci	
31	referrer_source	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
32	utm_parameters	json	YES	NULL				
33	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED	MUL		
34	updated_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_created	NON_UNIQUE	BTREE	created_at	0
idx_customer	NON_UNIQUE	BTREE	customer_id	0
idx_order_number	NON_UNIQUE	BTREE	order_number	0
idx_order_status	NON_UNIQUE	BTREE	order_status	0
idx_payment_status	NON_UNIQUE	BTREE	payment_status	0
order_number	UNIQUE	BTREE	order_number	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
purchase_orders_ibfk_1	customer_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `purchase_orders` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `order_number` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `customer_id` int NOT NULL,
  `billing_address` json NOT NULL,
  `shipping_address` json NOT NULL,
  `shipping_method` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `shipping_carrier` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tracking_numbers` json DEFAULT NULL,
  `items` json NOT NULL,
  `subtotal` decimal(12,2) NOT NULL,
  `tax_amount` decimal(10,2) DEFAULT '0.00',
  `shipping_cost` decimal(10,2) DEFAULT '0.00',
  `handling_fee` decimal(10,2) DEFAULT '0.00',
  `insurance_fee` decimal(10,2) DEFAULT '0.00',
  `discount_amount` decimal(10,2) DEFAULT '0.00',
  `total_amount` decimal(12,2) NOT NULL,
  `currency` varchar(3) COLLATE utf8mb4_unicode_ci DEFAULT 'USD',
  `exchange_rate` decimal(10,6) DEFAULT '1.000000',
  `payment_method` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `payment_status` enum('pending','processing','paid','partially_paid','failed','refunded','partially_refunded') COLLATE utf8mb4_unicode_ci DEFAULT 'pending',
  `payment_details` json DEFAULT NULL,
  `order_status` enum('pending','confirmed','processing','shipped','out_for_delivery','delivered','cancelled','returned','refunded') COLLATE utf8mb4_unicode_ci DEFAULT 'pending',
  `fulfillment_status` enum('unfulfilled','partially_fulfilled','fulfilled','cancelled') COLLATE utf8mb4_unicode_ci DEFAULT 'unfulfilled',
  `estimated_delivery` date DEFAULT NULL,
  `actual_delivery` timestamp NULL DEFAULT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `gift_message` text COLLATE utf8mb4_unicode_ci,
  `is_gift` tinyint(1) DEFAULT '0',
  `customer_ip` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_agent` text COLLATE utf8mb4_unicode_ci,
  `referrer_source` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `utm_parameters` json DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `order_number` (`order_number`),
  KEY `idx_order_number` (`order_number`),
  KEY `idx_customer` (`customer_id`),
  KEY `idx_payment_status` (`payment_status`),
  KEY `idx_order_status` (`order_status`),
  KEY `idx_created` (`created_at`),
  CONSTRAINT `purchase_orders_ibfk_1` FOREIGN KEY (`customer_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: purchase_orders_supplier
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:53:00 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	supplier_id	int	NO	NULL		MUL		
3	po_number	varchar(50)	NO	NULL		UNI	utf8mb4_unicode_ci	
4	items	json	NO	NULL				
5	subtotal	decimal(12,2)	NO	NULL				
6	tax_amount	decimal(10,2)	YES	0.00				
7	shipping_cost	decimal(10,2)	YES	0.00				
8	total_amount	decimal(12,2)	NO	NULL				
9	currency	varchar(3)	YES	USD			utf8mb4_unicode_ci	
10	payment_terms	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
11	expected_delivery	date	YES	NULL				
12	actual_delivery	date	YES	NULL				
13	status	enum('draft','sent','confirmed','partially_received','received','cancelled')	YES	draft		MUL	utf8mb4_unicode_ci	
14	notes	text	YES	NULL			utf8mb4_unicode_ci	
15	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
16	received_at	timestamp	YES	NULL				

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_po_number	NON_UNIQUE	BTREE	po_number	0
idx_status	NON_UNIQUE	BTREE	status	0
idx_supplier	NON_UNIQUE	BTREE	supplier_id	0
po_number	UNIQUE	BTREE	po_number	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
purchase_orders_supplier_ibfk_1	supplier_id	supplier_management	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `purchase_orders_supplier` (
  `id` int NOT NULL AUTO_INCREMENT,
  `supplier_id` int NOT NULL,
  `po_number` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `items` json NOT NULL,
  `subtotal` decimal(12,2) NOT NULL,
  `tax_amount` decimal(10,2) DEFAULT '0.00',
  `shipping_cost` decimal(10,2) DEFAULT '0.00',
  `total_amount` decimal(12,2) NOT NULL,
  `currency` varchar(3) COLLATE utf8mb4_unicode_ci DEFAULT 'USD',
  `payment_terms` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `expected_delivery` date DEFAULT NULL,
  `actual_delivery` date DEFAULT NULL,
  `status` enum('draft','sent','confirmed','partially_received','received','cancelled') COLLATE utf8mb4_unicode_ci DEFAULT 'draft',
  `notes` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `received_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `po_number` (`po_number`),
  KEY `idx_supplier` (`supplier_id`),
  KEY `idx_po_number` (`po_number`),
  KEY `idx_status` (`status`),
  CONSTRAINT `purchase_orders_supplier_ibfk_1` FOREIGN KEY (`supplier_id`) REFERENCES `supplier_management` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: push_subscriptions
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:55:14 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	device_type	enum('web','ios','android')	NO	NULL		MUL	utf8mb4_unicode_ci	
4	device_token	text	NO	NULL			utf8mb4_unicode_ci	
5	device_id	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
6	device_name	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
7	app_version	varchar(20)	YES	NULL			utf8mb4_unicode_ci	
8	os_version	varchar(20)	YES	NULL			utf8mb4_unicode_ci	
9	endpoint	text	YES	NULL			utf8mb4_unicode_ci	
10	p256dh	text	YES	NULL			utf8mb4_unicode_ci	
11	auth	text	YES	NULL			utf8mb4_unicode_ci	
12	notifications_enabled	tinyint(1)	YES	1				
13	categories_enabled	json	YES	NULL				
14	quiet_hours	json	YES	NULL				
15	last_active	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			
16	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_device_type	NON_UNIQUE	BTREE	device_type	0
idx_user	NON_UNIQUE	BTREE	user_id	0
unique_user_device	UNIQUE	BTREE	user_id, device_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
push_subscriptions_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `push_subscriptions` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `device_type` enum('web','ios','android') COLLATE utf8mb4_unicode_ci NOT NULL,
  `device_token` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `device_id` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `device_name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `app_version` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `os_version` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `endpoint` text COLLATE utf8mb4_unicode_ci,
  `p256dh` text COLLATE utf8mb4_unicode_ci,
  `auth` text COLLATE utf8mb4_unicode_ci,
  `notifications_enabled` tinyint(1) DEFAULT '1',
  `categories_enabled` json DEFAULT NULL,
  `quiet_hours` json DEFAULT NULL,
  `last_active` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_user_device` (`user_id`,`device_id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_device_type` (`device_type`),
  CONSTRAINT `push_subscriptions_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: pvp_games
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:57:52 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	game_code	varchar(50)	NO	NULL		UNI	utf8mb4_unicode_ci	
3	name	varchar(100)	NO	NULL			utf8mb4_unicode_ci	
4	game_type	enum('duel','tournament','battle_royale','team','ranked')	NO	NULL		MUL	utf8mb4_unicode_ci	
5	category	varchar(50)	YES	NULL		MUL	utf8mb4_unicode_ci	
6	min_players	int	YES	2				
7	max_players	int	YES	2				
8	entry_fee	decimal(20,2)	YES	0.00				
9	prize_pool	decimal(20,2)	YES	0.00				
10	commission_rate	decimal(5,2)	YES	5.00				
11	time_limit_seconds	int	YES	NULL				
12	rules	json	YES	NULL				
13	scoring_system	json	YES	NULL				
14	is_skill_based	tinyint(1)	YES	0				
15	elo_enabled	tinyint(1)	YES	0				
16	thumbnail_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
17	is_active	tinyint(1)	YES	1				
18	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
game_code	UNIQUE	BTREE	game_code	0
idx_category	NON_UNIQUE	BTREE	category	0
idx_type	NON_UNIQUE	BTREE	game_type	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `pvp_games` (
  `id` int NOT NULL AUTO_INCREMENT,
  `game_code` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `game_type` enum('duel','tournament','battle_royale','team','ranked') COLLATE utf8mb4_unicode_ci NOT NULL,
  `category` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `min_players` int DEFAULT '2',
  `max_players` int DEFAULT '2',
  `entry_fee` decimal(20,2) DEFAULT '0.00',
  `prize_pool` decimal(20,2) DEFAULT '0.00',
  `commission_rate` decimal(5,2) DEFAULT '5.00',
  `time_limit_seconds` int DEFAULT NULL,
  `rules` json DEFAULT NULL,
  `scoring_system` json DEFAULT NULL,
  `is_skill_based` tinyint(1) DEFAULT '0',
  `elo_enabled` tinyint(1) DEFAULT '0',
  `thumbnail_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT '1',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `game_code` (`game_code`),
  KEY `idx_type` (`game_type`),
  KEY `idx_category` (`category`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: pvp_match_players
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:58:15 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	match_id	varchar(100)	NO	NULL		MUL	utf8mb4_unicode_ci	
3	user_id	int	NO	NULL		MUL		
4	team_id	int	YES	NULL				
5	position	int	YES	NULL				
6	score	decimal(20,2)	YES	0.00				
7	placement	int	YES	NULL				
8	prize_won	decimal(20,2)	YES	0.00				
9	elo_before	int	YES	NULL				
10	elo_after	int	YES	NULL				
11	stats	json	YES	NULL				
12	is_ready	tinyint(1)	YES	0				
13	is_disconnected	tinyint(1)	YES	0				
14	joined_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
15	left_at	timestamp	YES	NULL				

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_match	NON_UNIQUE	BTREE	match_id	0
idx_user	NON_UNIQUE	BTREE	user_id	0
unique_match_player	UNIQUE	BTREE	match_id, user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
pvp_match_players_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `pvp_match_players` (
  `id` int NOT NULL AUTO_INCREMENT,
  `match_id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` int NOT NULL,
  `team_id` int DEFAULT NULL,
  `position` int DEFAULT NULL,
  `score` decimal(20,2) DEFAULT '0.00',
  `placement` int DEFAULT NULL,
  `prize_won` decimal(20,2) DEFAULT '0.00',
  `elo_before` int DEFAULT NULL,
  `elo_after` int DEFAULT NULL,
  `stats` json DEFAULT NULL,
  `is_ready` tinyint(1) DEFAULT '0',
  `is_disconnected` tinyint(1) DEFAULT '0',
  `joined_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `left_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_match_player` (`match_id`,`user_id`),
  KEY `idx_match` (`match_id`),
  KEY `idx_user` (`user_id`),
  CONSTRAINT `pvp_match_players_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: pvp_matches
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.08 | TOTAL_MB: 0.09 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:58:05 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	match_id	varchar(100)	NO	NULL		UNI	utf8mb4_unicode_ci	
3	game_id	int	NO	NULL		MUL		
4	room_code	varchar(20)	YES	NULL		UNI	utf8mb4_unicode_ci	
5	status	enum('waiting','starting','in_progress','finished','cancelled','disputed')	YES	waiting		MUL	utf8mb4_unicode_ci	
6	entry_fee	decimal(20,2)	YES	0.00				
7	prize_pool	decimal(20,2)	YES	0.00				
8	commission_amount	decimal(20,2)	YES	0.00				
9	max_players	int	YES	2				
10	current_players	int	YES	0				
11	game_data	json	YES	NULL				
12	settings	json	YES	NULL				
13	is_private	tinyint(1)	YES	0				
14	password_hash	varchar(255)	YES	NULL			utf8mb4_unicode_ci	
15	is_ranked	tinyint(1)	YES	0				
16	tournament_id	int	YES	NULL				
17	started_at	timestamp	YES	NULL				
18	ended_at	timestamp	YES	NULL				
19	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_game	NON_UNIQUE	BTREE	game_id	0
idx_room	NON_UNIQUE	BTREE	room_code	0
idx_status	NON_UNIQUE	BTREE	status	0
match_id	UNIQUE	BTREE	match_id	0
room_code	UNIQUE	BTREE	room_code	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
pvp_matches_ibfk_1	game_id	pvp_games	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `pvp_matches` (
  `id` int NOT NULL AUTO_INCREMENT,
  `match_id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `game_id` int NOT NULL,
  `room_code` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` enum('waiting','starting','in_progress','finished','cancelled','disputed') COLLATE utf8mb4_unicode_ci DEFAULT 'waiting',
  `entry_fee` decimal(20,2) DEFAULT '0.00',
  `prize_pool` decimal(20,2) DEFAULT '0.00',
  `commission_amount` decimal(20,2) DEFAULT '0.00',
  `max_players` int DEFAULT '2',
  `current_players` int DEFAULT '0',
  `game_data` json DEFAULT NULL,
  `settings` json DEFAULT NULL,
  `is_private` tinyint(1) DEFAULT '0',
  `password_hash` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_ranked` tinyint(1) DEFAULT '0',
  `tournament_id` int DEFAULT NULL,
  `started_at` timestamp NULL DEFAULT NULL,
  `ended_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `match_id` (`match_id`),
  UNIQUE KEY `room_code` (`room_code`),
  KEY `idx_game` (`game_id`),
  KEY `idx_status` (`status`),
  KEY `idx_room` (`room_code`),
  CONSTRAINT `pvp_matches_ibfk_1` FOREIGN KEY (`game_id`) REFERENCES `pvp_games` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: rate_limits
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 16354 | COLLATION: utf8mb4_0900_ai_ci | CREATE: 2025-08-02 19:49:10 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	YES	NULL		MUL		
3	action	varchar(50)	YES	NULL			utf8mb4_0900_ai_ci	
4	count	int	YES	1				
5	window_start	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED	MUL		

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_window_start	NON_UNIQUE	BTREE	window_start	0
user_action	UNIQUE	BTREE	user_id, action	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `rate_limits` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int DEFAULT NULL,
  `action` varchar(50) DEFAULT NULL,
  `count` int DEFAULT '1',
  `window_start` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_action` (`user_id`,`action`),
  KEY `idx_window_start` (`window_start`)
) ENGINE=InnoDB AUTO_INCREMENT=16354 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;


============================================================
TABLE: reactions
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-07 01:09:42 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	session_id	int	NO	NULL		MUL		
3	user_id	int	NO	NULL		MUL		
4	reaction_type	varchar(20)	NO	NULL			utf8mb4_unicode_ci	
5	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_session	NON_UNIQUE	BTREE	session_id	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
reactions_ibfk_1	session_id	chat_sessions	id	NO ACTION	CASCADE
reactions_ibfk_2	user_id	users	id	NO ACTION	CASCADE

--- SHOW CREATE TABLE ---
CREATE TABLE `reactions` (
  `id` int NOT NULL AUTO_INCREMENT,
  `session_id` int NOT NULL,
  `user_id` int NOT NULL,
  `reaction_type` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_session` (`session_id`),
  KEY `idx_user` (`user_id`),
  CONSTRAINT `reactions_ibfk_1` FOREIGN KEY (`session_id`) REFERENCES `chat_sessions` (`id`) ON DELETE CASCADE,
  CONSTRAINT `reactions_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: recordings
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 2 | COLLATION: utf8mb4_0900_ai_ci | CREATE: 2025-08-02 17:22:28 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	YES	NULL		MUL		
3	session_id	int	YES	NULL		MUL		
4	filename	varchar(255)	YES	NULL			utf8mb4_0900_ai_ci	
5	file_size	bigint	YES	NULL				
6	duration	int	YES	NULL				
7	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
session_id	NON_UNIQUE	BTREE	session_id	0
user_id	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
recordings_ibfk_1	user_id	users	id	NO ACTION	NO ACTION
recordings_ibfk_2	session_id	chat_sessions	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `recordings` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int DEFAULT NULL,
  `session_id` int DEFAULT NULL,
  `filename` varchar(255) DEFAULT NULL,
  `file_size` bigint DEFAULT NULL,
  `duration` int DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `session_id` (`session_id`),
  CONSTRAINT `recordings_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
  CONSTRAINT `recordings_ibfk_2` FOREIGN KEY (`session_id`) REFERENCES `chat_sessions` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;


============================================================
TABLE: remember_tokens
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_0900_ai_ci | CREATE: 2025-08-04 01:43:53 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	token_hash	varchar(64)	NO	NULL		MUL	utf8mb4_0900_ai_ci	
4	expires_at	timestamp	NO	NULL		MUL		
5	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_expires	NON_UNIQUE	BTREE	expires_at	0
idx_token	NON_UNIQUE	BTREE	token_hash	0
user_id	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
remember_tokens_ibfk_1	user_id	users	id	NO ACTION	CASCADE

--- SHOW CREATE TABLE ---
CREATE TABLE `remember_tokens` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `token_hash` varchar(64) NOT NULL,
  `expires_at` timestamp NOT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `idx_token` (`token_hash`),
  KEY `idx_expires` (`expires_at`),
  CONSTRAINT `remember_tokens_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;


============================================================
TABLE: reports
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_0900_ai_ci | CREATE: 2025-08-02 17:22:28 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	reporter_id	int	YES	NULL		MUL		
3	reported_user_id	int	YES	NULL		MUL		
4	session_id	int	YES	NULL		MUL		
5	reason	varchar(100)	YES	NULL			utf8mb4_0900_ai_ci	
6	description	text	YES	NULL			utf8mb4_0900_ai_ci	
7	status	enum('pending','reviewed','resolved')	YES	pending			utf8mb4_0900_ai_ci	
8	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
reported_user_id	NON_UNIQUE	BTREE	reported_user_id	0
reporter_id	NON_UNIQUE	BTREE	reporter_id	0
session_id	NON_UNIQUE	BTREE	session_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
reports_ibfk_1	reporter_id	users	id	NO ACTION	NO ACTION
reports_ibfk_2	reported_user_id	users	id	NO ACTION	NO ACTION
reports_ibfk_3	session_id	chat_sessions	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `reports` (
  `id` int NOT NULL AUTO_INCREMENT,
  `reporter_id` int DEFAULT NULL,
  `reported_user_id` int DEFAULT NULL,
  `session_id` int DEFAULT NULL,
  `reason` varchar(100) DEFAULT NULL,
  `description` text,
  `status` enum('pending','reviewed','resolved') DEFAULT 'pending',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `reporter_id` (`reporter_id`),
  KEY `reported_user_id` (`reported_user_id`),
  KEY `session_id` (`session_id`),
  CONSTRAINT `reports_ibfk_1` FOREIGN KEY (`reporter_id`) REFERENCES `users` (`id`),
  CONSTRAINT `reports_ibfk_2` FOREIGN KEY (`reported_user_id`) REFERENCES `users` (`id`),
  CONSTRAINT `reports_ibfk_3` FOREIGN KEY (`session_id`) REFERENCES `chat_sessions` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;


============================================================
TABLE: responsible_gaming
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 03:01:35 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		UNI		
3	daily_deposit_limit	decimal(10,2)	YES	NULL				
4	weekly_deposit_limit	decimal(10,2)	YES	NULL				
5	monthly_deposit_limit	decimal(10,2)	YES	NULL				
6	daily_loss_limit	decimal(10,2)	YES	NULL				
7	weekly_loss_limit	decimal(10,2)	YES	NULL				
8	monthly_loss_limit	decimal(10,2)	YES	NULL				
9	session_time_limit_minutes	int	YES	NULL				
10	reality_check_minutes	int	YES	60				
11	cool_off_until	date	YES	NULL				
12	self_exclusion_until	date	YES	NULL				
13	permanent_exclusion	tinyint(1)	YES	0				
14	panic_button_active	tinyint(1)	YES	0				
15	panic_button_until	timestamp	YES	NULL				
16	last_limit_change	timestamp	YES	NULL				
17	limit_change_cooldown_hours	int	YES	24				
18	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
19	updated_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_user	NON_UNIQUE	BTREE	user_id	0
user_id	UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
responsible_gaming_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `responsible_gaming` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `daily_deposit_limit` decimal(10,2) DEFAULT NULL,
  `weekly_deposit_limit` decimal(10,2) DEFAULT NULL,
  `monthly_deposit_limit` decimal(10,2) DEFAULT NULL,
  `daily_loss_limit` decimal(10,2) DEFAULT NULL,
  `weekly_loss_limit` decimal(10,2) DEFAULT NULL,
  `monthly_loss_limit` decimal(10,2) DEFAULT NULL,
  `session_time_limit_minutes` int DEFAULT NULL,
  `reality_check_minutes` int DEFAULT '60',
  `cool_off_until` date DEFAULT NULL,
  `self_exclusion_until` date DEFAULT NULL,
  `permanent_exclusion` tinyint(1) DEFAULT '0',
  `panic_button_active` tinyint(1) DEFAULT '0',
  `panic_button_until` timestamp NULL DEFAULT NULL,
  `last_limit_change` timestamp NULL DEFAULT NULL,
  `limit_change_cooldown_hours` int DEFAULT '24',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_id` (`user_id`),
  KEY `idx_user` (`user_id`),
  CONSTRAINT `responsible_gaming_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: restaurants
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:13:35 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	owner_id	int	NO	NULL		MUL		
3	name	varchar(200)	NO	NULL			utf8mb4_unicode_ci	
4	description	text	YES	NULL			utf8mb4_unicode_ci	
5	cuisine_type	json	YES	NULL				
6	logo_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
7	banner_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
8	menu	json	YES	NULL				
9	location	json	NO	NULL				
10	address	text	NO	NULL			utf8mb4_unicode_ci	
11	phone	varchar(20)	YES	NULL			utf8mb4_unicode_ci	
12	email	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
13	operating_hours	json	YES	NULL				
14	delivery_radius_km	int	YES	10				
15	minimum_order	decimal(10,2)	YES	0.00				
16	delivery_fee	decimal(10,2)	YES	0.00				
17	preparation_time_minutes	int	YES	30				
18	is_featured	tinyint(1)	YES	0				
19	is_verified	tinyint(1)	YES	0				
20	accepts_orders	tinyint(1)	YES	1				
21	total_orders	int	YES	0				
22	average_rating	decimal(3,2)	YES	0.00		MUL		
23	commission_rate	decimal(5,2)	YES	20.00				
24	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_owner	NON_UNIQUE	BTREE	owner_id	0
idx_rating	NON_UNIQUE	BTREE	average_rating	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
restaurants_ibfk_1	owner_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `restaurants` (
  `id` int NOT NULL AUTO_INCREMENT,
  `owner_id` int NOT NULL,
  `name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `cuisine_type` json DEFAULT NULL,
  `logo_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `banner_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `menu` json DEFAULT NULL,
  `location` json NOT NULL,
  `address` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `phone` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `operating_hours` json DEFAULT NULL,
  `delivery_radius_km` int DEFAULT '10',
  `minimum_order` decimal(10,2) DEFAULT '0.00',
  `delivery_fee` decimal(10,2) DEFAULT '0.00',
  `preparation_time_minutes` int DEFAULT '30',
  `is_featured` tinyint(1) DEFAULT '0',
  `is_verified` tinyint(1) DEFAULT '0',
  `accepts_orders` tinyint(1) DEFAULT '1',
  `total_orders` int DEFAULT '0',
  `average_rating` decimal(3,2) DEFAULT '0.00',
  `commission_rate` decimal(5,2) DEFAULT '20.00',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_owner` (`owner_id`),
  KEY `idx_rating` (`average_rating`),
  CONSTRAINT `restaurants_ibfk_1` FOREIGN KEY (`owner_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: return_merchandise
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.08 | TOTAL_MB: 0.09 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:53:00 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	order_id	bigint	NO	NULL		MUL		
3	customer_id	int	NO	NULL		MUL		
4	rma_number	varchar(50)	NO	NULL		UNI	utf8mb4_unicode_ci	
5	items	json	NO	NULL				
6	return_reason	enum('defective','wrong_item','not_as_described','no_longer_needed','better_price','damaged','other')	NO	NULL			utf8mb4_unicode_ci	
7	detailed_reason	text	YES	NULL			utf8mb4_unicode_ci	
8	photos	json	YES	NULL				
9	status	enum('requested','approved','label_sent','shipped','received','inspecting','processed','rejected')	YES	requested		MUL	utf8mb4_unicode_ci	
10	return_method	enum('mail','dropoff','pickup')	YES	mail			utf8mb4_unicode_ci	
11	return_label_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
12	tracking_number	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
13	inspection_notes	text	YES	NULL			utf8mb4_unicode_ci	
14	refund_amount	decimal(12,2)	YES	NULL				
15	restocking_fee	decimal(10,2)	YES	0.00				
16	refund_method	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
17	replacement_sent	tinyint(1)	YES	0				
18	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
19	processed_at	timestamp	YES	NULL				

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_customer	NON_UNIQUE	BTREE	customer_id	0
idx_order	NON_UNIQUE	BTREE	order_id	0
idx_rma	NON_UNIQUE	BTREE	rma_number	0
idx_status	NON_UNIQUE	BTREE	status	0
rma_number	UNIQUE	BTREE	rma_number	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
return_merchandise_ibfk_1	order_id	purchase_orders	id	NO ACTION	NO ACTION
return_merchandise_ibfk_2	customer_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `return_merchandise` (
  `id` int NOT NULL AUTO_INCREMENT,
  `order_id` bigint NOT NULL,
  `customer_id` int NOT NULL,
  `rma_number` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `items` json NOT NULL,
  `return_reason` enum('defective','wrong_item','not_as_described','no_longer_needed','better_price','damaged','other') COLLATE utf8mb4_unicode_ci NOT NULL,
  `detailed_reason` text COLLATE utf8mb4_unicode_ci,
  `photos` json DEFAULT NULL,
  `status` enum('requested','approved','label_sent','shipped','received','inspecting','processed','rejected') COLLATE utf8mb4_unicode_ci DEFAULT 'requested',
  `return_method` enum('mail','dropoff','pickup') COLLATE utf8mb4_unicode_ci DEFAULT 'mail',
  `return_label_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tracking_number` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `inspection_notes` text COLLATE utf8mb4_unicode_ci,
  `refund_amount` decimal(12,2) DEFAULT NULL,
  `restocking_fee` decimal(10,2) DEFAULT '0.00',
  `refund_method` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `replacement_sent` tinyint(1) DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `processed_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `rma_number` (`rma_number`),
  KEY `idx_order` (`order_id`),
  KEY `idx_customer` (`customer_id`),
  KEY `idx_rma` (`rma_number`),
  KEY `idx_status` (`status`),
  CONSTRAINT `return_merchandise_ibfk_1` FOREIGN KEY (`order_id`) REFERENCES `purchase_orders` (`id`),
  CONSTRAINT `return_merchandise_ibfk_2` FOREIGN KEY (`customer_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: revenue_streams
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:13:51 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	user_id	int	YES	NULL		MUL		
3	revenue_type	varchar(100)	NO	NULL		MUL	utf8mb4_unicode_ci	
4	source_table	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
5	source_id	int	YES	NULL				
6	amount	decimal(20,2)	NO	NULL				
7	currency	varchar(3)	YES	USD			utf8mb4_unicode_ci	
8	commission_rate	decimal(5,2)	YES	NULL				
9	platform_fee	decimal(20,2)	YES	NULL				
10	net_amount	decimal(20,2)	YES	NULL				
11	payment_method	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
12	payment_status	enum('pending','processing','completed','failed')	YES	pending		MUL	utf8mb4_unicode_ci	
13	description	text	YES	NULL			utf8mb4_unicode_ci	
14	metadata	json	YES	NULL				
15	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED	MUL		
16	processed_at	timestamp	YES	NULL				

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_created	NON_UNIQUE	BTREE	created_at	0
idx_status	NON_UNIQUE	BTREE	payment_status	0
idx_type	NON_UNIQUE	BTREE	revenue_type	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
revenue_streams_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `revenue_streams` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `user_id` int DEFAULT NULL,
  `revenue_type` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `source_table` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `source_id` int DEFAULT NULL,
  `amount` decimal(20,2) NOT NULL,
  `currency` varchar(3) COLLATE utf8mb4_unicode_ci DEFAULT 'USD',
  `commission_rate` decimal(5,2) DEFAULT NULL,
  `platform_fee` decimal(20,2) DEFAULT NULL,
  `net_amount` decimal(20,2) DEFAULT NULL,
  `payment_method` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `payment_status` enum('pending','processing','completed','failed') COLLATE utf8mb4_unicode_ci DEFAULT 'pending',
  `description` text COLLATE utf8mb4_unicode_ci,
  `metadata` json DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `processed_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_type` (`revenue_type`),
  KEY `idx_status` (`payment_status`),
  KEY `idx_created` (`created_at`),
  CONSTRAINT `revenue_streams_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: revenue_streams_detailed
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 16:03:29 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	stream_date	date	NO	NULL		MUL		
3	stream_hour	int	YES	NULL		MUL		
4	sales_direct	decimal(20,2)	YES	0.00				
5	sales_marketplace	decimal(20,2)	YES	0.00				
6	sales_dropship	decimal(20,2)	YES	0.00				
7	sales_affiliate	decimal(20,2)	YES	0.00				
8	sales_subscription_boxes	decimal(20,2)	YES	0.00				
9	listing_fees	decimal(20,2)	YES	0.00				
10	transaction_fees	decimal(20,2)	YES	0.00				
11	payment_processing_fees	decimal(20,2)	YES	0.00				
12	seller_subscription_fees	decimal(20,2)	YES	0.00				
13	featured_listing_fees	decimal(20,2)	YES	0.00				
14	premium_subscriptions	decimal(20,2)	YES	0.00				
15	vip_memberships	decimal(20,2)	YES	0.00				
16	content_subscriptions	decimal(20,2)	YES	0.00				
17	service_subscriptions	decimal(20,2)	YES	0.00				
18	game_purchases	decimal(20,2)	YES	0.00				
19	in_game_purchases	decimal(20,2)	YES	0.00				
20	betting_revenue	decimal(20,2)	YES	0.00				
21	tournament_fees	decimal(20,2)	YES	0.00				
22	casino_revenue	decimal(20,2)	YES	0.00				
23	streaming_subscriptions	decimal(20,2)	YES	0.00				
24	pay_per_view	decimal(20,2)	YES	0.00				
25	content_purchases	decimal(20,2)	YES	0.00				
26	tips_donations	decimal(20,2)	YES	0.00				
27	super_chats	decimal(20,2)	YES	0.00				
28	display_ads	decimal(20,2)	YES	0.00				
29	video_ads	decimal(20,2)	YES	0.00				
30	sponsored_content	decimal(20,2)	YES	0.00				
31	affiliate_commissions	decimal(20,2)	YES	0.00				
32	crypto_trading_fees	decimal(20,2)	YES	0.00				
33	nft_sales	decimal(20,2)	YES	0.00				
34	nft_royalties	decimal(20,2)	YES	0.00				
35	staking_rewards	decimal(20,2)	YES	0.00				
36	delivery_fees	decimal(20,2)	YES	0.00				
37	service_bookings	decimal(20,2)	YES	0.00				
38	consultation_fees	decimal(20,2)	YES	0.00				
39	api_usage_fees	decimal(20,2)	YES	0.00				
40	data_licensing	decimal(20,2)	YES	0.00				
41	white_label_fees	decimal(20,2)	YES	0.00				
42	total_revenue	decimal(20,2)	YES	0.00				
43	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_date	NON_UNIQUE	BTREE	stream_date	0
idx_hour	NON_UNIQUE	BTREE	stream_hour	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `revenue_streams_detailed` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `stream_date` date NOT NULL,
  `stream_hour` int DEFAULT NULL,
  `sales_direct` decimal(20,2) DEFAULT '0.00',
  `sales_marketplace` decimal(20,2) DEFAULT '0.00',
  `sales_dropship` decimal(20,2) DEFAULT '0.00',
  `sales_affiliate` decimal(20,2) DEFAULT '0.00',
  `sales_subscription_boxes` decimal(20,2) DEFAULT '0.00',
  `listing_fees` decimal(20,2) DEFAULT '0.00',
  `transaction_fees` decimal(20,2) DEFAULT '0.00',
  `payment_processing_fees` decimal(20,2) DEFAULT '0.00',
  `seller_subscription_fees` decimal(20,2) DEFAULT '0.00',
  `featured_listing_fees` decimal(20,2) DEFAULT '0.00',
  `premium_subscriptions` decimal(20,2) DEFAULT '0.00',
  `vip_memberships` decimal(20,2) DEFAULT '0.00',
  `content_subscriptions` decimal(20,2) DEFAULT '0.00',
  `service_subscriptions` decimal(20,2) DEFAULT '0.00',
  `game_purchases` decimal(20,2) DEFAULT '0.00',
  `in_game_purchases` decimal(20,2) DEFAULT '0.00',
  `betting_revenue` decimal(20,2) DEFAULT '0.00',
  `tournament_fees` decimal(20,2) DEFAULT '0.00',
  `casino_revenue` decimal(20,2) DEFAULT '0.00',
  `streaming_subscriptions` decimal(20,2) DEFAULT '0.00',
  `pay_per_view` decimal(20,2) DEFAULT '0.00',
  `content_purchases` decimal(20,2) DEFAULT '0.00',
  `tips_donations` decimal(20,2) DEFAULT '0.00',
  `super_chats` decimal(20,2) DEFAULT '0.00',
  `display_ads` decimal(20,2) DEFAULT '0.00',
  `video_ads` decimal(20,2) DEFAULT '0.00',
  `sponsored_content` decimal(20,2) DEFAULT '0.00',
  `affiliate_commissions` decimal(20,2) DEFAULT '0.00',
  `crypto_trading_fees` decimal(20,2) DEFAULT '0.00',
  `nft_sales` decimal(20,2) DEFAULT '0.00',
  `nft_royalties` decimal(20,2) DEFAULT '0.00',
  `staking_rewards` decimal(20,2) DEFAULT '0.00',
  `delivery_fees` decimal(20,2) DEFAULT '0.00',
  `service_bookings` decimal(20,2) DEFAULT '0.00',
  `consultation_fees` decimal(20,2) DEFAULT '0.00',
  `api_usage_fees` decimal(20,2) DEFAULT '0.00',
  `data_licensing` decimal(20,2) DEFAULT '0.00',
  `white_label_fees` decimal(20,2) DEFAULT '0.00',
  `total_revenue` decimal(20,2) DEFAULT '0.00',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_date` (`stream_date`),
  KEY `idx_hour` (`stream_hour`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: reward_boxes
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:54:33 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	box_type	varchar(50)	NO	NULL		MUL	utf8mb4_unicode_ci	
3	name	varchar(100)	NO	NULL			utf8mb4_unicode_ci	
4	description	text	YES	NULL			utf8mb4_unicode_ci	
5	icon_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
6	rarity	enum('common','rare','epic','legendary','mythic')	YES	common		MUL	utf8mb4_unicode_ci	
7	price_coins	int	YES	NULL				
8	price_cash	decimal(10,2)	YES	NULL				
9	possible_rewards	json	YES	NULL				
10	drop_rates	json	YES	NULL				
11	guaranteed_rare_at	int	YES	NULL				
12	daily_limit	int	YES	NULL				
13	is_available	tinyint(1)	YES	1		MUL		
14	available_from	timestamp	YES	NULL				
15	available_until	timestamp	YES	NULL				
16	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_available	NON_UNIQUE	BTREE	is_available	0
idx_rarity	NON_UNIQUE	BTREE	rarity	0
idx_type	NON_UNIQUE	BTREE	box_type	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `reward_boxes` (
  `id` int NOT NULL AUTO_INCREMENT,
  `box_type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `icon_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `rarity` enum('common','rare','epic','legendary','mythic') COLLATE utf8mb4_unicode_ci DEFAULT 'common',
  `price_coins` int DEFAULT NULL,
  `price_cash` decimal(10,2) DEFAULT NULL,
  `possible_rewards` json DEFAULT NULL,
  `drop_rates` json DEFAULT NULL,
  `guaranteed_rare_at` int DEFAULT NULL,
  `daily_limit` int DEFAULT NULL,
  `is_available` tinyint(1) DEFAULT '1',
  `available_from` timestamp NULL DEFAULT NULL,
  `available_until` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_type` (`box_type`),
  KEY `idx_rarity` (`rarity`),
  KEY `idx_available` (`is_available`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: reward_multipliers
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 03:06:26 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	multiplier_type	varchar(50)	NO	NULL			utf8mb4_unicode_ci	
4	multiplier_value	decimal(5,2)	YES	1.00				
5	source	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
6	expires_at	timestamp	YES	NULL		MUL		
7	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_expires	NON_UNIQUE	BTREE	expires_at	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
reward_multipliers_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `reward_multipliers` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `multiplier_type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `multiplier_value` decimal(5,2) DEFAULT '1.00',
  `source` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `expires_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_expires` (`expires_at`),
  CONSTRAINT `reward_multipliers_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: ride_requests
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:13:35 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	rider_id	int	NO	NULL		MUL		
3	driver_id	int	YES	NULL		MUL		
4	ride_type	enum('economy','comfort','premium','xl','pool','delivery')	YES	economy			utf8mb4_unicode_ci	
5	pickup_location	json	NO	NULL				
6	pickup_address	text	NO	NULL			utf8mb4_unicode_ci	
7	dropoff_location	json	NO	NULL				
8	dropoff_address	text	NO	NULL			utf8mb4_unicode_ci	
9	distance_km	decimal(10,2)	YES	NULL				
10	duration_minutes	int	YES	NULL				
11	estimated_fare	decimal(10,2)	YES	NULL				
12	final_fare	decimal(10,2)	YES	NULL				
13	surge_multiplier	decimal(3,2)	YES	1.00				
14	payment_method	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
15	status	enum('searching','accepted','arriving','in_progress','completed','cancelled')	YES	searching		MUL	utf8mb4_unicode_ci	
16	driver_location	json	YES	NULL				
17	driver_eta_minutes	int	YES	NULL				
18	route	json	YES	NULL				
19	rating_rider	int	YES	NULL				
20	rating_driver	int	YES	NULL				
21	tip_amount	decimal(10,2)	YES	0.00				
22	cancellation_reason	text	YES	NULL			utf8mb4_unicode_ci	
23	cancellation_fee	decimal(10,2)	YES	NULL				
24	requested_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED	MUL		
25	accepted_at	timestamp	YES	NULL				
26	started_at	timestamp	YES	NULL				
27	completed_at	timestamp	YES	NULL				

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_driver	NON_UNIQUE	BTREE	driver_id	0
idx_requested	NON_UNIQUE	BTREE	requested_at	0
idx_rider	NON_UNIQUE	BTREE	rider_id	0
idx_status	NON_UNIQUE	BTREE	status	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
ride_requests_ibfk_1	rider_id	users	id	NO ACTION	NO ACTION
ride_requests_ibfk_2	driver_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `ride_requests` (
  `id` int NOT NULL AUTO_INCREMENT,
  `rider_id` int NOT NULL,
  `driver_id` int DEFAULT NULL,
  `ride_type` enum('economy','comfort','premium','xl','pool','delivery') COLLATE utf8mb4_unicode_ci DEFAULT 'economy',
  `pickup_location` json NOT NULL,
  `pickup_address` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `dropoff_location` json NOT NULL,
  `dropoff_address` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `distance_km` decimal(10,2) DEFAULT NULL,
  `duration_minutes` int DEFAULT NULL,
  `estimated_fare` decimal(10,2) DEFAULT NULL,
  `final_fare` decimal(10,2) DEFAULT NULL,
  `surge_multiplier` decimal(3,2) DEFAULT '1.00',
  `payment_method` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` enum('searching','accepted','arriving','in_progress','completed','cancelled') COLLATE utf8mb4_unicode_ci DEFAULT 'searching',
  `driver_location` json DEFAULT NULL,
  `driver_eta_minutes` int DEFAULT NULL,
  `route` json DEFAULT NULL,
  `rating_rider` int DEFAULT NULL,
  `rating_driver` int DEFAULT NULL,
  `tip_amount` decimal(10,2) DEFAULT '0.00',
  `cancellation_reason` text COLLATE utf8mb4_unicode_ci,
  `cancellation_fee` decimal(10,2) DEFAULT NULL,
  `requested_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `accepted_at` timestamp NULL DEFAULT NULL,
  `started_at` timestamp NULL DEFAULT NULL,
  `completed_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_rider` (`rider_id`),
  KEY `idx_driver` (`driver_id`),
  KEY `idx_status` (`status`),
  KEY `idx_requested` (`requested_at`),
  CONSTRAINT `ride_requests_ibfk_1` FOREIGN KEY (`rider_id`) REFERENCES `users` (`id`),
  CONSTRAINT `ride_requests_ibfk_2` FOREIGN KEY (`driver_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: roi_tracking
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:53:58 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	investment_type	varchar(100)	NO	NULL		MUL	utf8mb4_unicode_ci	
3	investment_name	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
4	platform	varchar(100)	YES	NULL		MUL	utf8mb4_unicode_ci	
5	investment_amount	decimal(20,2)	NO	NULL				
6	return_amount	decimal(20,2)	YES	0.00				
7	roi_percentage	decimal(10,4)	YES	NULL		MUL		
8	payback_period_days	int	YES	NULL				
9	attribution_model	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
10	tracking_period_start	date	NO	NULL				
11	tracking_period_end	date	YES	NULL				
12	metrics	json	YES	NULL				
13	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_platform	NON_UNIQUE	BTREE	platform	0
idx_roi	NON_UNIQUE	BTREE	roi_percentage	0
idx_type	NON_UNIQUE	BTREE	investment_type	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `roi_tracking` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `investment_type` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `investment_name` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `platform` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `investment_amount` decimal(20,2) NOT NULL,
  `return_amount` decimal(20,2) DEFAULT '0.00',
  `roi_percentage` decimal(10,4) DEFAULT NULL,
  `payback_period_days` int DEFAULT NULL,
  `attribution_model` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tracking_period_start` date NOT NULL,
  `tracking_period_end` date DEFAULT NULL,
  `metrics` json DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_type` (`investment_type`),
  KEY `idx_platform` (`platform`),
  KEY `idx_roi` (`roi_percentage`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: room_members
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:37:36 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	room_id	int	NO	NULL		MUL		
3	user_id	int	NO	NULL		MUL		
4	role	enum('owner','admin','moderator','vip','member')	YES	member		MUL	utf8mb4_unicode_ci	
5	joined_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
6	last_active	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			
7	is_muted	tinyint(1)	YES	0				
8	is_banned	tinyint(1)	YES	0				
9	muted_until	timestamp	YES	NULL				
10	contribution_points	int	YES	0				

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_role	NON_UNIQUE	BTREE	role	0
idx_room	NON_UNIQUE	BTREE	room_id	0
idx_user	NON_UNIQUE	BTREE	user_id	0
unique_room_user	UNIQUE	BTREE	room_id, user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
room_members_ibfk_1	room_id	chat_rooms	id	NO ACTION	CASCADE
room_members_ibfk_2	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `room_members` (
  `id` int NOT NULL AUTO_INCREMENT,
  `room_id` int NOT NULL,
  `user_id` int NOT NULL,
  `role` enum('owner','admin','moderator','vip','member') COLLATE utf8mb4_unicode_ci DEFAULT 'member',
  `joined_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `last_active` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `is_muted` tinyint(1) DEFAULT '0',
  `is_banned` tinyint(1) DEFAULT '0',
  `muted_until` timestamp NULL DEFAULT NULL,
  `contribution_points` int DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_room_user` (`room_id`,`user_id`),
  KEY `idx_room` (`room_id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_role` (`role`),
  CONSTRAINT `room_members_ibfk_1` FOREIGN KEY (`room_id`) REFERENCES `chat_rooms` (`id`) ON DELETE CASCADE,
  CONSTRAINT `room_members_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: saved_searches
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.02 | TOTAL_MB: 0.03 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:52:02 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	search_name	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
4	search_query	text	YES	NULL			utf8mb4_unicode_ci	
5	filters	json	YES	NULL				
6	categories	json	YES	NULL				
7	price_min	decimal(12,2)	YES	NULL				
8	price_max	decimal(12,2)	YES	NULL				
9	condition_types	json	YES	NULL				
10	seller_types	json	YES	NULL				
11	locations	json	YES	NULL				
12	sort_order	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
13	email_alerts	tinyint(1)	YES	0				
14	push_alerts	tinyint(1)	YES	0				
15	alert_frequency	enum('instant','daily','weekly')	YES	daily			utf8mb4_unicode_ci	
16	last_alerted	timestamp	YES	NULL				
17	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
saved_searches_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `saved_searches` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `search_name` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `search_query` text COLLATE utf8mb4_unicode_ci,
  `filters` json DEFAULT NULL,
  `categories` json DEFAULT NULL,
  `price_min` decimal(12,2) DEFAULT NULL,
  `price_max` decimal(12,2) DEFAULT NULL,
  `condition_types` json DEFAULT NULL,
  `seller_types` json DEFAULT NULL,
  `locations` json DEFAULT NULL,
  `sort_order` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email_alerts` tinyint(1) DEFAULT '0',
  `push_alerts` tinyint(1) DEFAULT '0',
  `alert_frequency` enum('instant','daily','weekly') COLLATE utf8mb4_unicode_ci DEFAULT 'daily',
  `last_alerted` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  CONSTRAINT `saved_searches_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: scratch_cards
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 03:02:26 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	card_type	varchar(50)	NO	NULL		MUL	utf8mb4_unicode_ci	
3	name	varchar(100)	NO	NULL			utf8mb4_unicode_ci	
4	price	decimal(10,2)	NO	NULL				
5	max_prize	decimal(20,2)	NO	NULL				
6	prize_structure	json	YES	NULL				
7	odds	json	YES	NULL				
8	theme	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
9	image_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
10	total_cards	int	YES	NULL				
11	cards_sold	int	YES	0				
12	cards_won	int	YES	0				
13	total_prizes_paid	decimal(20,2)	YES	0.00				
14	is_active	tinyint(1)	YES	1		MUL		
15	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_active	NON_UNIQUE	BTREE	is_active	0
idx_type	NON_UNIQUE	BTREE	card_type	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `scratch_cards` (
  `id` int NOT NULL AUTO_INCREMENT,
  `card_type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `price` decimal(10,2) NOT NULL,
  `max_prize` decimal(20,2) NOT NULL,
  `prize_structure` json DEFAULT NULL,
  `odds` json DEFAULT NULL,
  `theme` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `image_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `total_cards` int DEFAULT NULL,
  `cards_sold` int DEFAULT '0',
  `cards_won` int DEFAULT '0',
  `total_prizes_paid` decimal(20,2) DEFAULT '0.00',
  `is_active` tinyint(1) DEFAULT '1',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_type` (`card_type`),
  KEY `idx_active` (`is_active`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: security_monitoring
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.08 | TOTAL_MB: 0.09 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 16:03:29 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	incident_type	enum('breach','attack','fraud','violation','suspicious','vulnerability')	NO	NULL		MUL	utf8mb4_unicode_ci	
3	severity	enum('critical','high','medium','low')	NO	NULL		MUL	utf8mb4_unicode_ci	
4	user_id	int	YES	NULL		MUL		
5	ip_address	varchar(45)	YES	NULL			utf8mb4_unicode_ci	
6	user_agent	text	YES	NULL			utf8mb4_unicode_ci	
7	endpoint	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
8	description	text	YES	NULL			utf8mb4_unicode_ci	
9	attack_vector	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
10	payload	text	YES	NULL			utf8mb4_unicode_ci	
11	action_taken	enum('blocked','logged','alerted','investigated','resolved')	NO	NULL			utf8mb4_unicode_ci	
12	admin_notified	tinyint(1)	YES	0				
13	resolved	tinyint(1)	YES	0		MUL		
14	resolved_by	int	YES	NULL		MUL		
15	resolution_notes	text	YES	NULL			utf8mb4_unicode_ci	
16	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
17	resolved_at	timestamp	YES	NULL				

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_resolved	NON_UNIQUE	BTREE	resolved	0
idx_severity	NON_UNIQUE	BTREE	severity	0
idx_type	NON_UNIQUE	BTREE	incident_type	0
idx_user	NON_UNIQUE	BTREE	user_id	0
resolved_by	NON_UNIQUE	BTREE	resolved_by	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
security_monitoring_ibfk_1	user_id	users	id	NO ACTION	NO ACTION
security_monitoring_ibfk_2	resolved_by	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `security_monitoring` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `incident_type` enum('breach','attack','fraud','violation','suspicious','vulnerability') COLLATE utf8mb4_unicode_ci NOT NULL,
  `severity` enum('critical','high','medium','low') COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` int DEFAULT NULL,
  `ip_address` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_agent` text COLLATE utf8mb4_unicode_ci,
  `endpoint` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `attack_vector` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `payload` text COLLATE utf8mb4_unicode_ci,
  `action_taken` enum('blocked','logged','alerted','investigated','resolved') COLLATE utf8mb4_unicode_ci NOT NULL,
  `admin_notified` tinyint(1) DEFAULT '0',
  `resolved` tinyint(1) DEFAULT '0',
  `resolved_by` int DEFAULT NULL,
  `resolution_notes` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `resolved_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_type` (`incident_type`),
  KEY `idx_severity` (`severity`),
  KEY `idx_user` (`user_id`),
  KEY `idx_resolved` (`resolved`),
  KEY `resolved_by` (`resolved_by`),
  CONSTRAINT `security_monitoring_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
  CONSTRAINT `security_monitoring_ibfk_2` FOREIGN KEY (`resolved_by`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: seller_dashboard
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 16:04:26 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	seller_id	int	NO	NULL		UNI		
3	sales_today	decimal(12,2)	YES	0.00				
4	sales_month	decimal(12,2)	YES	0.00				
5	orders_pending	int	YES	0				
6	orders_to_ship	int	YES	0				
7	active_listings	int	YES	0				
8	out_of_stock	int	YES	0				
9	low_stock_alerts	int	YES	0				
10	seller_rating	decimal(3,2)	YES	0.00				
11	response_time_hours	decimal(5,2)	YES	0.00				
12	fulfillment_rate	decimal(5,2)	YES	0.00				
13	available_balance	decimal(12,2)	YES	0.00				
14	pending_payout	decimal(12,2)	YES	0.00				
15	unread_questions	int	YES	0				
16	pending_reviews	int	YES	0				
17	last_updated	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_seller	NON_UNIQUE	BTREE	seller_id	0
unique_seller	UNIQUE	BTREE	seller_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
seller_dashboard_ibfk_1	seller_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `seller_dashboard` (
  `id` int NOT NULL AUTO_INCREMENT,
  `seller_id` int NOT NULL,
  `sales_today` decimal(12,2) DEFAULT '0.00',
  `sales_month` decimal(12,2) DEFAULT '0.00',
  `orders_pending` int DEFAULT '0',
  `orders_to_ship` int DEFAULT '0',
  `active_listings` int DEFAULT '0',
  `out_of_stock` int DEFAULT '0',
  `low_stock_alerts` int DEFAULT '0',
  `seller_rating` decimal(3,2) DEFAULT '0.00',
  `response_time_hours` decimal(5,2) DEFAULT '0.00',
  `fulfillment_rate` decimal(5,2) DEFAULT '0.00',
  `available_balance` decimal(12,2) DEFAULT '0.00',
  `pending_payout` decimal(12,2) DEFAULT '0.00',
  `unread_questions` int DEFAULT '0',
  `pending_reviews` int DEFAULT '0',
  `last_updated` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_seller` (`seller_id`),
  KEY `idx_seller` (`seller_id`),
  CONSTRAINT `seller_dashboard_ibfk_1` FOREIGN KEY (`seller_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: seller_feedback
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:52:02 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	transaction_type	enum('auction','purchase','service')	NO	NULL		MUL	utf8mb4_unicode_ci	
3	transaction_id	bigint	NO	NULL				
4	from_user_id	int	NO	NULL		MUL		
5	to_user_id	int	NO	NULL		MUL		
6	rating	enum('positive','neutral','negative')	NO	NULL		MUL	utf8mb4_unicode_ci	
7	comment	text	YES	NULL			utf8mb4_unicode_ci	
8	item_as_described	int	YES	NULL				
9	communication	int	YES	NULL				
10	shipping_time	int	YES	NULL				
11	shipping_cost	int	YES	NULL				
12	response	text	YES	NULL			utf8mb4_unicode_ci	
13	response_date	timestamp	YES	NULL				
14	is_revised	tinyint(1)	YES	0				
15	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_from_user	NON_UNIQUE	BTREE	from_user_id	0
idx_rating	NON_UNIQUE	BTREE	rating	0
idx_to_user	NON_UNIQUE	BTREE	to_user_id	0
idx_transaction	NON_UNIQUE	BTREE	transaction_type, transaction_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
seller_feedback_ibfk_1	from_user_id	users	id	NO ACTION	NO ACTION
seller_feedback_ibfk_2	to_user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `seller_feedback` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `transaction_type` enum('auction','purchase','service') COLLATE utf8mb4_unicode_ci NOT NULL,
  `transaction_id` bigint NOT NULL,
  `from_user_id` int NOT NULL,
  `to_user_id` int NOT NULL,
  `rating` enum('positive','neutral','negative') COLLATE utf8mb4_unicode_ci NOT NULL,
  `comment` text COLLATE utf8mb4_unicode_ci,
  `item_as_described` int DEFAULT NULL,
  `communication` int DEFAULT NULL,
  `shipping_time` int DEFAULT NULL,
  `shipping_cost` int DEFAULT NULL,
  `response` text COLLATE utf8mb4_unicode_ci,
  `response_date` timestamp NULL DEFAULT NULL,
  `is_revised` tinyint(1) DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_from_user` (`from_user_id`),
  KEY `idx_to_user` (`to_user_id`),
  KEY `idx_transaction` (`transaction_type`,`transaction_id`),
  KEY `idx_rating` (`rating`),
  CONSTRAINT `seller_feedback_ibfk_1` FOREIGN KEY (`from_user_id`) REFERENCES `users` (`id`),
  CONSTRAINT `seller_feedback_ibfk_2` FOREIGN KEY (`to_user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: service_bookings
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:12:25 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	provider_id	int	NO	NULL		MUL		
3	customer_id	int	NO	NULL		MUL		
4	service_type	varchar(100)	NO	NULL			utf8mb4_unicode_ci	
5	booking_date	date	NO	NULL		MUL		
6	time_slot_start	time	NO	NULL				
7	time_slot_end	time	NO	NULL				
8	duration_hours	decimal(4,2)	YES	NULL				
9	location_type	enum('customer_location','provider_location','online','other')	YES	customer_location			utf8mb4_unicode_ci	
10	service_address	text	YES	NULL			utf8mb4_unicode_ci	
11	service_details	json	YES	NULL				
12	special_requests	text	YES	NULL			utf8mb4_unicode_ci	
13	estimated_cost	decimal(10,2)	YES	NULL				
14	final_cost	decimal(10,2)	YES	NULL				
15	payment_method	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
16	payment_status	enum('pending','partial','paid','refunded')	YES	pending			utf8mb4_unicode_ci	
17	booking_status	enum('requested','confirmed','in_progress','completed','cancelled','no_show')	YES	requested		MUL	utf8mb4_unicode_ci	
18	cancellation_reason	text	YES	NULL			utf8mb4_unicode_ci	
19	provider_notes	text	YES	NULL			utf8mb4_unicode_ci	
20	customer_rating	int	YES	NULL				
21	provider_rating	int	YES	NULL				
22	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
23	completed_at	timestamp	YES	NULL				

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_customer	NON_UNIQUE	BTREE	customer_id	0
idx_date	NON_UNIQUE	BTREE	booking_date	0
idx_provider	NON_UNIQUE	BTREE	provider_id	0
idx_status	NON_UNIQUE	BTREE	booking_status	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
service_bookings_ibfk_1	provider_id	service_providers	id	NO ACTION	NO ACTION
service_bookings_ibfk_2	customer_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `service_bookings` (
  `id` int NOT NULL AUTO_INCREMENT,
  `provider_id` int NOT NULL,
  `customer_id` int NOT NULL,
  `service_type` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `booking_date` date NOT NULL,
  `time_slot_start` time NOT NULL,
  `time_slot_end` time NOT NULL,
  `duration_hours` decimal(4,2) DEFAULT NULL,
  `location_type` enum('customer_location','provider_location','online','other') COLLATE utf8mb4_unicode_ci DEFAULT 'customer_location',
  `service_address` text COLLATE utf8mb4_unicode_ci,
  `service_details` json DEFAULT NULL,
  `special_requests` text COLLATE utf8mb4_unicode_ci,
  `estimated_cost` decimal(10,2) DEFAULT NULL,
  `final_cost` decimal(10,2) DEFAULT NULL,
  `payment_method` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `payment_status` enum('pending','partial','paid','refunded') COLLATE utf8mb4_unicode_ci DEFAULT 'pending',
  `booking_status` enum('requested','confirmed','in_progress','completed','cancelled','no_show') COLLATE utf8mb4_unicode_ci DEFAULT 'requested',
  `cancellation_reason` text COLLATE utf8mb4_unicode_ci,
  `provider_notes` text COLLATE utf8mb4_unicode_ci,
  `customer_rating` int DEFAULT NULL,
  `provider_rating` int DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `completed_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_provider` (`provider_id`),
  KEY `idx_customer` (`customer_id`),
  KEY `idx_date` (`booking_date`),
  KEY `idx_status` (`booking_status`),
  CONSTRAINT `service_bookings_ibfk_1` FOREIGN KEY (`provider_id`) REFERENCES `service_providers` (`id`),
  CONSTRAINT `service_bookings_ibfk_2` FOREIGN KEY (`customer_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: service_providers
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:12:25 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	service_category	varchar(100)	NO	NULL		MUL	utf8mb4_unicode_ci	
4	service_name	varchar(200)	NO	NULL			utf8mb4_unicode_ci	
5	description	text	YES	NULL			utf8mb4_unicode_ci	
6	skills	json	YES	NULL				
7	certifications	json	YES	NULL				
8	portfolio_urls	json	YES	NULL				
9	hourly_rate	decimal(10,2)	YES	NULL				
10	fixed_price_services	json	YES	NULL				
11	availability_schedule	json	YES	NULL				
12	service_area_radius_km	int	YES	50				
13	service_locations	json	YES	NULL				
14	languages	json	YES	NULL				
15	experience_years	int	YES	0				
16	completed_jobs	int	YES	0				
17	average_rating	decimal(3,2)	YES	0.00		MUL		
18	response_time_minutes	int	YES	60				
19	acceptance_rate	decimal(5,2)	YES	0.00				
20	on_time_rate	decimal(5,2)	YES	0.00				
21	is_verified	tinyint(1)	YES	0				
22	is_insured	tinyint(1)	YES	0				
23	insurance_details	json	YES	NULL				
24	is_available	tinyint(1)	YES	1				
25	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_category	NON_UNIQUE	BTREE	service_category	0
idx_rating	NON_UNIQUE	BTREE	average_rating	0
idx_user	NON_UNIQUE	BTREE	user_id	0
unique_provider	UNIQUE	BTREE	user_id, service_category	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
service_providers_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `service_providers` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `service_category` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `service_name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `skills` json DEFAULT NULL,
  `certifications` json DEFAULT NULL,
  `portfolio_urls` json DEFAULT NULL,
  `hourly_rate` decimal(10,2) DEFAULT NULL,
  `fixed_price_services` json DEFAULT NULL,
  `availability_schedule` json DEFAULT NULL,
  `service_area_radius_km` int DEFAULT '50',
  `service_locations` json DEFAULT NULL,
  `languages` json DEFAULT NULL,
  `experience_years` int DEFAULT '0',
  `completed_jobs` int DEFAULT '0',
  `average_rating` decimal(3,2) DEFAULT '0.00',
  `response_time_minutes` int DEFAULT '60',
  `acceptance_rate` decimal(5,2) DEFAULT '0.00',
  `on_time_rate` decimal(5,2) DEFAULT '0.00',
  `is_verified` tinyint(1) DEFAULT '0',
  `is_insured` tinyint(1) DEFAULT '0',
  `insurance_details` json DEFAULT NULL,
  `is_available` tinyint(1) DEFAULT '1',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_provider` (`user_id`,`service_category`),
  KEY `idx_user` (`user_id`),
  KEY `idx_category` (`service_category`),
  KEY `idx_rating` (`average_rating`),
  CONSTRAINT `service_providers_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: service_reviews
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:12:25 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	service_type	enum('provider','gig','booking')	NO	NULL		MUL	utf8mb4_unicode_ci	
3	service_id	int	NO	NULL				
4	reviewer_id	int	NO	NULL		MUL		
5	reviewed_user_id	int	NO	NULL		MUL		
6	rating	int	NO	NULL		MUL		
7	title	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
8	review_text	text	YES	NULL			utf8mb4_unicode_ci	
9	pros	text	YES	NULL			utf8mb4_unicode_ci	
10	cons	text	YES	NULL			utf8mb4_unicode_ci	
11	photos	json	YES	NULL				
12	videos	json	YES	NULL				
13	criteria_ratings	json	YES	NULL				
14	is_verified_purchase	tinyint(1)	YES	0				
15	helpful_count	int	YES	0				
16	unhelpful_count	int	YES	0				
17	provider_response	text	YES	NULL			utf8mb4_unicode_ci	
18	response_date	timestamp	YES	NULL				
19	is_featured	tinyint(1)	YES	0				
20	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
21	updated_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_rating	NON_UNIQUE	BTREE	rating	0
idx_reviewed	NON_UNIQUE	BTREE	reviewed_user_id	0
idx_reviewer	NON_UNIQUE	BTREE	reviewer_id	0
idx_service	NON_UNIQUE	BTREE	service_type, service_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
service_reviews_ibfk_1	reviewer_id	users	id	NO ACTION	NO ACTION
service_reviews_ibfk_2	reviewed_user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `service_reviews` (
  `id` int NOT NULL AUTO_INCREMENT,
  `service_type` enum('provider','gig','booking') COLLATE utf8mb4_unicode_ci NOT NULL,
  `service_id` int NOT NULL,
  `reviewer_id` int NOT NULL,
  `reviewed_user_id` int NOT NULL,
  `rating` int NOT NULL,
  `title` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `review_text` text COLLATE utf8mb4_unicode_ci,
  `pros` text COLLATE utf8mb4_unicode_ci,
  `cons` text COLLATE utf8mb4_unicode_ci,
  `photos` json DEFAULT NULL,
  `videos` json DEFAULT NULL,
  `criteria_ratings` json DEFAULT NULL,
  `is_verified_purchase` tinyint(1) DEFAULT '0',
  `helpful_count` int DEFAULT '0',
  `unhelpful_count` int DEFAULT '0',
  `provider_response` text COLLATE utf8mb4_unicode_ci,
  `response_date` timestamp NULL DEFAULT NULL,
  `is_featured` tinyint(1) DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_service` (`service_type`,`service_id`),
  KEY `idx_reviewer` (`reviewer_id`),
  KEY `idx_reviewed` (`reviewed_user_id`),
  KEY `idx_rating` (`rating`),
  CONSTRAINT `service_reviews_ibfk_1` FOREIGN KEY (`reviewer_id`) REFERENCES `users` (`id`),
  CONSTRAINT `service_reviews_ibfk_2` FOREIGN KEY (`reviewed_user_id`) REFERENCES `users` (`id`),
  CONSTRAINT `service_reviews_chk_1` CHECK (((`rating` >= 1) and (`rating` <= 5)))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: services_offered
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:52:18 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	provider_id	int	NO	NULL		MUL		
3	service_category	varchar(100)	NO	NULL		MUL	utf8mb4_unicode_ci	
4	title	varchar(300)	NO	NULL			utf8mb4_unicode_ci	
5	description	text	YES	NULL			utf8mb4_unicode_ci	
6	experience_years	int	YES	NULL				
7	certifications	json	YES	NULL				
8	insurance_bonded	tinyint(1)	YES	0				
9	rate_type	enum('hourly','flat_fee','quote')	YES	quote			utf8mb4_unicode_ci	
10	rate_amount	decimal(10,2)	YES	NULL		MUL		
11	minimum_charge	decimal(10,2)	YES	NULL				
12	service_area	json	YES	NULL				
13	availability	text	YES	NULL			utf8mb4_unicode_ci	
14	portfolio_images	json	YES	NULL				
15	references_available	tinyint(1)	YES	0				
16	contact_method	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
17	response_time	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
18	view_count	int	YES	0				
19	inquiry_count	int	YES	0				
20	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_category	NON_UNIQUE	BTREE	service_category	0
idx_provider	NON_UNIQUE	BTREE	provider_id	0
idx_rate	NON_UNIQUE	BTREE	rate_amount	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
services_offered_ibfk_1	provider_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `services_offered` (
  `id` int NOT NULL AUTO_INCREMENT,
  `provider_id` int NOT NULL,
  `service_category` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `title` varchar(300) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `experience_years` int DEFAULT NULL,
  `certifications` json DEFAULT NULL,
  `insurance_bonded` tinyint(1) DEFAULT '0',
  `rate_type` enum('hourly','flat_fee','quote') COLLATE utf8mb4_unicode_ci DEFAULT 'quote',
  `rate_amount` decimal(10,2) DEFAULT NULL,
  `minimum_charge` decimal(10,2) DEFAULT NULL,
  `service_area` json DEFAULT NULL,
  `availability` text COLLATE utf8mb4_unicode_ci,
  `portfolio_images` json DEFAULT NULL,
  `references_available` tinyint(1) DEFAULT '0',
  `contact_method` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `response_time` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `view_count` int DEFAULT '0',
  `inquiry_count` int DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_provider` (`provider_id`),
  KEY `idx_category` (`service_category`),
  KEY `idx_rate` (`rate_amount`),
  CONSTRAINT `services_offered_ibfk_1` FOREIGN KEY (`provider_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: shipment_tracking
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:53:00 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	order_id	bigint	NO	NULL		MUL		
3	carrier	varchar(100)	NO	NULL			utf8mb4_unicode_ci	
4	service_type	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
5	tracking_number	varchar(200)	NO	NULL		UNI	utf8mb4_unicode_ci	
6	status	enum('label_created','picked_up','in_transit','out_for_delivery','delivered','returned','lost','damaged')	YES	label_created		MUL	utf8mb4_unicode_ci	
7	current_location	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
8	tracking_events	json	YES	NULL				
9	estimated_delivery	timestamp	YES	NULL				
10	actual_delivery	timestamp	YES	NULL				
11	signature_required	tinyint(1)	YES	0				
12	signature_image	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
13	proof_of_delivery	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
14	shipping_cost	decimal(10,2)	YES	NULL				
15	insurance_amount	decimal(10,2)	YES	NULL				
16	weight_kg	decimal(10,3)	YES	NULL				
17	dimensions	json	YES	NULL				
18	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
19	updated_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_order	NON_UNIQUE	BTREE	order_id	0
idx_status	NON_UNIQUE	BTREE	status	0
idx_tracking	NON_UNIQUE	BTREE	tracking_number	0
tracking_number	UNIQUE	BTREE	tracking_number	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
shipment_tracking_ibfk_1	order_id	purchase_orders	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `shipment_tracking` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `order_id` bigint NOT NULL,
  `carrier` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `service_type` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tracking_number` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` enum('label_created','picked_up','in_transit','out_for_delivery','delivered','returned','lost','damaged') COLLATE utf8mb4_unicode_ci DEFAULT 'label_created',
  `current_location` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tracking_events` json DEFAULT NULL,
  `estimated_delivery` timestamp NULL DEFAULT NULL,
  `actual_delivery` timestamp NULL DEFAULT NULL,
  `signature_required` tinyint(1) DEFAULT '0',
  `signature_image` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `proof_of_delivery` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `shipping_cost` decimal(10,2) DEFAULT NULL,
  `insurance_amount` decimal(10,2) DEFAULT NULL,
  `weight_kg` decimal(10,3) DEFAULT NULL,
  `dimensions` json DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `tracking_number` (`tracking_number`),
  KEY `idx_order` (`order_id`),
  KEY `idx_tracking` (`tracking_number`),
  KEY `idx_status` (`status`),
  CONSTRAINT `shipment_tracking_ibfk_1` FOREIGN KEY (`order_id`) REFERENCES `purchase_orders` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: shipping_rates
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:53:00 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	carrier	varchar(100)	NO	NULL		MUL	utf8mb4_unicode_ci	
3	service_name	varchar(200)	NO	NULL			utf8mb4_unicode_ci	
4	zone	varchar(50)	YES	NULL		MUL	utf8mb4_unicode_ci	
5	weight_min_kg	decimal(10,3)	YES	NULL		MUL		
6	weight_max_kg	decimal(10,3)	YES	NULL				
7	dimensions_max	json	YES	NULL				
8	base_rate	decimal(10,2)	NO	NULL				
9	per_kg_rate	decimal(10,2)	YES	0.00				
10	fuel_surcharge_percentage	decimal(5,2)	YES	0.00				
11	residential_surcharge	decimal(10,2)	YES	0.00				
12	signature_fee	decimal(10,2)	YES	0.00				
13	insurance_rate_percentage	decimal(5,2)	YES	0.00				
14	estimated_days_min	int	YES	NULL				
15	estimated_days_max	int	YES	NULL				
16	is_express	tinyint(1)	YES	0				
17	is_international	tinyint(1)	YES	0				
18	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_carrier	NON_UNIQUE	BTREE	carrier	0
idx_weight	NON_UNIQUE	BTREE	weight_min_kg, weight_max_kg	0
idx_zone	NON_UNIQUE	BTREE	zone	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `shipping_rates` (
  `id` int NOT NULL AUTO_INCREMENT,
  `carrier` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `service_name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `zone` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `weight_min_kg` decimal(10,3) DEFAULT NULL,
  `weight_max_kg` decimal(10,3) DEFAULT NULL,
  `dimensions_max` json DEFAULT NULL,
  `base_rate` decimal(10,2) NOT NULL,
  `per_kg_rate` decimal(10,2) DEFAULT '0.00',
  `fuel_surcharge_percentage` decimal(5,2) DEFAULT '0.00',
  `residential_surcharge` decimal(10,2) DEFAULT '0.00',
  `signature_fee` decimal(10,2) DEFAULT '0.00',
  `insurance_rate_percentage` decimal(5,2) DEFAULT '0.00',
  `estimated_days_min` int DEFAULT NULL,
  `estimated_days_max` int DEFAULT NULL,
  `is_express` tinyint(1) DEFAULT '0',
  `is_international` tinyint(1) DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_carrier` (`carrier`),
  KEY `idx_zone` (`zone`),
  KEY `idx_weight` (`weight_min_kg`,`weight_max_kg`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: shop_products
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.11 | TOTAL_MB: 0.13 | AUTO_INCREMENT: 2 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 03:14:51 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	seller_id	int	NO	NULL		MUL		
3	sku	varchar(50)	NO	NULL		UNI	utf8mb4_unicode_ci	
4	name	varchar(200)	NO	NULL		MUL	utf8mb4_unicode_ci	
5	description	text	YES	NULL			utf8mb4_unicode_ci	
6	category	varchar(100)	YES	NULL		MUL	utf8mb4_unicode_ci	
7	subcategory	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
8	brand	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
9	price	decimal(10,2)	NO	NULL		MUL		
10	compare_price	decimal(10,2)	YES	NULL				
11	cost	decimal(10,2)	YES	NULL				
12	currency	varchar(3)	YES	USD			utf8mb4_unicode_ci	
13	weight_grams	int	YES	NULL				
14	dimensions	json	YES	NULL				
15	images	json	YES	NULL				
16	videos	json	YES	NULL				
17	variants	json	YES	NULL				
18	stock_quantity	int	YES	0				
19	stock_status	enum('in_stock','out_of_stock','preorder')	YES	in_stock		MUL	utf8mb4_unicode_ci	
20	condition	enum('new','used','refurbished')	YES	new			utf8mb4_unicode_ci	
21	tags	json	YES	NULL				
22	seo_title	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
23	seo_description	text	YES	NULL			utf8mb4_unicode_ci	
24	shipping_info	json	YES	NULL				
25	return_policy	text	YES	NULL			utf8mb4_unicode_ci	
26	is_digital	tinyint(1)	YES	0				
27	download_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
28	rating	decimal(3,2)	YES	0.00				
29	reviews_count	int	YES	0				
30	sold_count	int	YES	0				
31	is_featured	tinyint(1)	YES	0				
32	is_active	tinyint(1)	YES	1				
33	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
34	updated_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_category	NON_UNIQUE	BTREE	category, subcategory	0
idx_price	NON_UNIQUE	BTREE	price	0
idx_search	NON_UNIQUE	FULLTEXT	name, description	0
idx_seller	NON_UNIQUE	BTREE	seller_id	0
idx_stock	NON_UNIQUE	BTREE	stock_status	0
sku	UNIQUE	BTREE	sku	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
shop_products_ibfk_1	seller_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `shop_products` (
  `id` int NOT NULL AUTO_INCREMENT,
  `seller_id` int NOT NULL,
  `sku` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `category` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `subcategory` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `brand` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `price` decimal(10,2) NOT NULL,
  `compare_price` decimal(10,2) DEFAULT NULL,
  `cost` decimal(10,2) DEFAULT NULL,
  `currency` varchar(3) COLLATE utf8mb4_unicode_ci DEFAULT 'USD',
  `weight_grams` int DEFAULT NULL,
  `dimensions` json DEFAULT NULL,
  `images` json DEFAULT NULL,
  `videos` json DEFAULT NULL,
  `variants` json DEFAULT NULL,
  `stock_quantity` int DEFAULT '0',
  `stock_status` enum('in_stock','out_of_stock','preorder') COLLATE utf8mb4_unicode_ci DEFAULT 'in_stock',
  `condition` enum('new','used','refurbished') COLLATE utf8mb4_unicode_ci DEFAULT 'new',
  `tags` json DEFAULT NULL,
  `seo_title` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `seo_description` text COLLATE utf8mb4_unicode_ci,
  `shipping_info` json DEFAULT NULL,
  `return_policy` text COLLATE utf8mb4_unicode_ci,
  `is_digital` tinyint(1) DEFAULT '0',
  `download_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `rating` decimal(3,2) DEFAULT '0.00',
  `reviews_count` int DEFAULT '0',
  `sold_count` int DEFAULT '0',
  `is_featured` tinyint(1) DEFAULT '0',
  `is_active` tinyint(1) DEFAULT '1',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `sku` (`sku`),
  KEY `idx_seller` (`seller_id`),
  KEY `idx_category` (`category`,`subcategory`),
  KEY `idx_price` (`price`),
  KEY `idx_stock` (`stock_status`),
  FULLTEXT KEY `idx_search` (`name`,`description`),
  CONSTRAINT `shop_products_ibfk_1` FOREIGN KEY (`seller_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: shopping_cart
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 03:17:37 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	product_id	int	NO	NULL		MUL		
4	variant_id	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
5	quantity	int	YES	1				
6	price	decimal(10,2)	NO	NULL				
7	saved_for_later	tinyint(1)	YES	0				
8	added_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
9	updated_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_product	NON_UNIQUE	BTREE	product_id	0
idx_user	NON_UNIQUE	BTREE	user_id	0
unique_cart_item	UNIQUE	BTREE	user_id, product_id, variant_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
shopping_cart_ibfk_1	user_id	users	id	NO ACTION	NO ACTION
shopping_cart_ibfk_2	product_id	shop_products	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `shopping_cart` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `product_id` int NOT NULL,
  `variant_id` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `quantity` int DEFAULT '1',
  `price` decimal(10,2) NOT NULL,
  `saved_for_later` tinyint(1) DEFAULT '0',
  `added_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_cart_item` (`user_id`,`product_id`,`variant_id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_product` (`product_id`),
  CONSTRAINT `shopping_cart_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
  CONSTRAINT `shopping_cart_ibfk_2` FOREIGN KEY (`product_id`) REFERENCES `shop_products` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: shopping_carts
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:51:43 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	session_id	varchar(100)	YES	NULL		MUL	utf8mb4_unicode_ci	
4	items	json	YES	NULL				
5	subtotal	decimal(12,2)	YES	0.00				
6	tax_amount	decimal(10,2)	YES	0.00				
7	shipping_amount	decimal(10,2)	YES	0.00				
8	discount_amount	decimal(10,2)	YES	0.00				
9	total_amount	decimal(12,2)	YES	0.00				
10	currency	varchar(3)	YES	USD			utf8mb4_unicode_ci	
11	coupon_codes	json	YES	NULL				
12	gift_cards	json	YES	NULL				
13	saved_for_later	json	YES	NULL				
14	abandoned_email_sent	int	YES	0				
15	expires_at	timestamp	YES	NULL		MUL		
16	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
17	updated_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_expires	NON_UNIQUE	BTREE	expires_at	0
idx_session	NON_UNIQUE	BTREE	session_id	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
shopping_carts_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `shopping_carts` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `session_id` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `items` json DEFAULT NULL,
  `subtotal` decimal(12,2) DEFAULT '0.00',
  `tax_amount` decimal(10,2) DEFAULT '0.00',
  `shipping_amount` decimal(10,2) DEFAULT '0.00',
  `discount_amount` decimal(10,2) DEFAULT '0.00',
  `total_amount` decimal(12,2) DEFAULT '0.00',
  `currency` varchar(3) COLLATE utf8mb4_unicode_ci DEFAULT 'USD',
  `coupon_codes` json DEFAULT NULL,
  `gift_cards` json DEFAULT NULL,
  `saved_for_later` json DEFAULT NULL,
  `abandoned_email_sent` int DEFAULT '0',
  `expires_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_session` (`session_id`),
  KEY `idx_expires` (`expires_at`),
  CONSTRAINT `shopping_carts_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: short_videos
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:50:01 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	creator_id	int	NO	NULL		MUL		
3	video_url	varchar(500)	NO	NULL			utf8mb4_unicode_ci	
4	thumbnail_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
5	title	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
6	description	text	YES	NULL			utf8mb4_unicode_ci	
7	duration_seconds	int	NO	NULL				
8	aspect_ratio	varchar(10)	YES	9:16			utf8mb4_unicode_ci	
9	original_sound_id	int	YES	NULL		MUL		
10	music_id	int	YES	NULL				
11	effects_used	json	YES	NULL				
12	hashtags	json	YES	NULL				
13	mentions	json	YES	NULL				
14	location	varchar(255)	YES	NULL			utf8mb4_unicode_ci	
15	privacy	enum('public','friends','private')	YES	public			utf8mb4_unicode_ci	
16	allow_comments	tinyint(1)	YES	1				
17	allow_duet	tinyint(1)	YES	1				
18	allow_stitch	tinyint(1)	YES	1				
19	allow_download	tinyint(1)	YES	1				
20	views_count	int	YES	0				
21	likes_count	int	YES	0				
22	comments_count	int	YES	0				
23	shares_count	int	YES	0				
24	saves_count	int	YES	0				
25	engagement_rate	decimal(5,2)	YES	0.00		MUL		
26	is_ad	tinyint(1)	YES	0				
27	is_viral	tinyint(1)	YES	0				
28	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED	MUL		

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_created	NON_UNIQUE	BTREE	created_at	0
idx_creator	NON_UNIQUE	BTREE	creator_id	0
idx_engagement	NON_UNIQUE	BTREE	engagement_rate	0
idx_sound	NON_UNIQUE	BTREE	original_sound_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
short_videos_ibfk_1	creator_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `short_videos` (
  `id` int NOT NULL AUTO_INCREMENT,
  `creator_id` int NOT NULL,
  `video_url` varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL,
  `thumbnail_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `title` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `duration_seconds` int NOT NULL,
  `aspect_ratio` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT '9:16',
  `original_sound_id` int DEFAULT NULL,
  `music_id` int DEFAULT NULL,
  `effects_used` json DEFAULT NULL,
  `hashtags` json DEFAULT NULL,
  `mentions` json DEFAULT NULL,
  `location` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `privacy` enum('public','friends','private') COLLATE utf8mb4_unicode_ci DEFAULT 'public',
  `allow_comments` tinyint(1) DEFAULT '1',
  `allow_duet` tinyint(1) DEFAULT '1',
  `allow_stitch` tinyint(1) DEFAULT '1',
  `allow_download` tinyint(1) DEFAULT '1',
  `views_count` int DEFAULT '0',
  `likes_count` int DEFAULT '0',
  `comments_count` int DEFAULT '0',
  `shares_count` int DEFAULT '0',
  `saves_count` int DEFAULT '0',
  `engagement_rate` decimal(5,2) DEFAULT '0.00',
  `is_ad` tinyint(1) DEFAULT '0',
  `is_viral` tinyint(1) DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_creator` (`creator_id`),
  KEY `idx_sound` (`original_sound_id`),
  KEY `idx_engagement` (`engagement_rate`),
  KEY `idx_created` (`created_at`),
  CONSTRAINT `short_videos_ibfk_1` FOREIGN KEY (`creator_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: signal_logs
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 486 | DATA_MB: 0.13 | INDEX_MB: 0.05 | TOTAL_MB: 0.17 | AUTO_INCREMENT: 487 | COLLATION: utf8mb4_0900_ai_ci | CREATE: 2025-08-04 00:34:36 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	YES	NULL		MUL		
3	action	varchar(50)	YES	NULL			utf8mb4_0900_ai_ci	
4	success	tinyint(1)	YES	1				
5	ip_address	varchar(45)	YES	NULL			utf8mb4_0900_ai_ci	
6	user_agent	text	YES	NULL			utf8mb4_0900_ai_ci	
7	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	486
idx_user_action	NON_UNIQUE	BTREE	user_id, action, created_at	157

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `signal_logs` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int DEFAULT NULL,
  `action` varchar(50) DEFAULT NULL,
  `success` tinyint(1) DEFAULT '1',
  `ip_address` varchar(45) DEFAULT NULL,
  `user_agent` text,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_user_action` (`user_id`,`action`,`created_at`)
) ENGINE=InnoDB AUTO_INCREMENT=487 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;


============================================================
TABLE: signals
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 970 | COLLATION: utf8mb4_0900_ai_ci | CREATE: 2025-08-02 17:37:59 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	from_user	int	YES	NULL		MUL		
3	to_user	int	YES	NULL		MUL		
4	type	varchar(50)	YES	NULL			utf8mb4_0900_ai_ci	
5	data	json	YES	NULL				
6	retrieved	tinyint(1)	YES	0				
7	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
from_user	NON_UNIQUE	BTREE	from_user	0
idx_signals_to_user	NON_UNIQUE	BTREE	to_user, retrieved	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
signals_ibfk_1	from_user	users	id	NO ACTION	NO ACTION
signals_ibfk_2	to_user	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `signals` (
  `id` int NOT NULL AUTO_INCREMENT,
  `from_user` int DEFAULT NULL,
  `to_user` int DEFAULT NULL,
  `type` varchar(50) DEFAULT NULL,
  `data` json DEFAULT NULL,
  `retrieved` tinyint(1) DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `from_user` (`from_user`),
  KEY `idx_signals_to_user` (`to_user`,`retrieved`),
  CONSTRAINT `signals_ibfk_1` FOREIGN KEY (`from_user`) REFERENCES `users` (`id`),
  CONSTRAINT `signals_ibfk_2` FOREIGN KEY (`to_user`) REFERENCES `users` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=970 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;


============================================================
TABLE: skill_assessments
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:11:42 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	skill_name	varchar(100)	NO	NULL		MUL	utf8mb4_unicode_ci	
4	assessment_type	enum('quiz','practical','interview','portfolio')	NO	NULL			utf8mb4_unicode_ci	
5	score	decimal(5,2)	NO	NULL				
6	max_score	decimal(5,2)	YES	100.00				
7	percentile	int	YES	NULL				
8	level	enum('novice','beginner','intermediate','advanced','expert')	YES	beginner		MUL	utf8mb4_unicode_ci	
9	certificate_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
10	verified_by	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
11	expires_at	date	YES	NULL				
12	is_public	tinyint(1)	YES	1				
13	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_level	NON_UNIQUE	BTREE	level	0
idx_skill	NON_UNIQUE	BTREE	skill_name	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
skill_assessments_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `skill_assessments` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `skill_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `assessment_type` enum('quiz','practical','interview','portfolio') COLLATE utf8mb4_unicode_ci NOT NULL,
  `score` decimal(5,2) NOT NULL,
  `max_score` decimal(5,2) DEFAULT '100.00',
  `percentile` int DEFAULT NULL,
  `level` enum('novice','beginner','intermediate','advanced','expert') COLLATE utf8mb4_unicode_ci DEFAULT 'beginner',
  `certificate_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `verified_by` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `expires_at` date DEFAULT NULL,
  `is_public` tinyint(1) DEFAULT '1',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_skill` (`skill_name`),
  KEY `idx_level` (`level`),
  CONSTRAINT `skill_assessments_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: snap_map_locations
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:28:58 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	latitude	decimal(10,8)	NO	NULL		MUL		
4	longitude	decimal(11,8)	NO	NULL				
5	accuracy_meters	int	YES	NULL				
6	location_name	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
7	is_ghost_mode	tinyint(1)	YES	0				
8	visible_to	enum('everyone','friends','custom','none')	YES	friends			utf8mb4_unicode_ci	
9	custom_visibility	json	YES	NULL				
10	last_updated	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP	MUL		

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_location	NON_UNIQUE	BTREE	latitude, longitude	0
idx_updated	NON_UNIQUE	BTREE	last_updated	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
snap_map_locations_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `snap_map_locations` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `latitude` decimal(10,8) NOT NULL,
  `longitude` decimal(11,8) NOT NULL,
  `accuracy_meters` int DEFAULT NULL,
  `location_name` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_ghost_mode` tinyint(1) DEFAULT '0',
  `visible_to` enum('everyone','friends','custom','none') COLLATE utf8mb4_unicode_ci DEFAULT 'friends',
  `custom_visibility` json DEFAULT NULL,
  `last_updated` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_location` (`latitude`,`longitude`),
  KEY `idx_updated` (`last_updated`),
  CONSTRAINT `snap_map_locations_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: snap_memories
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:28:58 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	memory_type	enum('snap','story','camera_roll')	NO	NULL			utf8mb4_unicode_ci	
4	original_id	bigint	YES	NULL				
5	media_url	varchar(500)	NO	NULL			utf8mb4_unicode_ci	
6	thumbnail_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
7	caption	text	YES	NULL			utf8mb4_unicode_ci	
8	location_data	json	YES	NULL				
9	date_taken	timestamp	YES	NULL		MUL		
10	is_favorite	tinyint(1)	YES	0				
11	is_hidden	tinyint(1)	YES	0				
12	albums	json	YES	NULL				
13	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_date	NON_UNIQUE	BTREE	date_taken	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
snap_memories_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `snap_memories` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `memory_type` enum('snap','story','camera_roll') COLLATE utf8mb4_unicode_ci NOT NULL,
  `original_id` bigint DEFAULT NULL,
  `media_url` varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL,
  `thumbnail_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `caption` text COLLATE utf8mb4_unicode_ci,
  `location_data` json DEFAULT NULL,
  `date_taken` timestamp NULL DEFAULT NULL,
  `is_favorite` tinyint(1) DEFAULT '0',
  `is_hidden` tinyint(1) DEFAULT '0',
  `albums` json DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_date` (`date_taken`),
  CONSTRAINT `snap_memories_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: snap_recipients
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:28:58 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	snap_id	bigint	NO	NULL		MUL		
3	recipient_id	int	NO	NULL		MUL		
4	is_viewed	tinyint(1)	YES	0				
5	viewed_at	timestamp	YES	NULL				
6	replayed	tinyint(1)	YES	0				
7	screenshot_taken	tinyint(1)	YES	0				
8	chat_saved	tinyint(1)	YES	0				
9	delivery_status	enum('sending','delivered','viewed','expired')	YES	sending		MUL	utf8mb4_unicode_ci	
10	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_recipient	NON_UNIQUE	BTREE	recipient_id	0
idx_snap	NON_UNIQUE	BTREE	snap_id	0
idx_status	NON_UNIQUE	BTREE	delivery_status	0
unique_snap_recipient	UNIQUE	BTREE	snap_id, recipient_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
snap_recipients_ibfk_1	snap_id	snaps	id	NO ACTION	CASCADE
snap_recipients_ibfk_2	recipient_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `snap_recipients` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `snap_id` bigint NOT NULL,
  `recipient_id` int NOT NULL,
  `is_viewed` tinyint(1) DEFAULT '0',
  `viewed_at` timestamp NULL DEFAULT NULL,
  `replayed` tinyint(1) DEFAULT '0',
  `screenshot_taken` tinyint(1) DEFAULT '0',
  `chat_saved` tinyint(1) DEFAULT '0',
  `delivery_status` enum('sending','delivered','viewed','expired') COLLATE utf8mb4_unicode_ci DEFAULT 'sending',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_snap_recipient` (`snap_id`,`recipient_id`),
  KEY `idx_snap` (`snap_id`),
  KEY `idx_recipient` (`recipient_id`),
  KEY `idx_status` (`delivery_status`),
  CONSTRAINT `snap_recipients_ibfk_1` FOREIGN KEY (`snap_id`) REFERENCES `snaps` (`id`) ON DELETE CASCADE,
  CONSTRAINT `snap_recipients_ibfk_2` FOREIGN KEY (`recipient_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: snap_scores
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:28:58 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		UNI		
3	total_score	bigint	YES	0		MUL		
4	snaps_sent	int	YES	0				
5	snaps_received	int	YES	0				
6	stories_posted	int	YES	0				
7	discover_views	int	YES	0				
8	trophies	json	YES	NULL				
9	achievements	json	YES	NULL				
10	updated_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_score	NON_UNIQUE	BTREE	total_score	0
idx_user	NON_UNIQUE	BTREE	user_id	0
user_id	UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
snap_scores_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `snap_scores` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `total_score` bigint DEFAULT '0',
  `snaps_sent` int DEFAULT '0',
  `snaps_received` int DEFAULT '0',
  `stories_posted` int DEFAULT '0',
  `discover_views` int DEFAULT '0',
  `trophies` json DEFAULT NULL,
  `achievements` json DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_id` (`user_id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_score` (`total_score`),
  CONSTRAINT `snap_scores_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: snap_stories
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:28:58 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	story_type	enum('photo','video','text')	NO	NULL			utf8mb4_unicode_ci	
4	media_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
5	text_content	text	YES	NULL			utf8mb4_unicode_ci	
6	location_data	json	YES	NULL				
7	music_data	json	YES	NULL				
8	filters	json	YES	NULL				
9	stickers	json	YES	NULL				
10	mentions	json	YES	NULL				
11	view_count	int	YES	0				
12	screenshot_count	int	YES	0				
13	is_private	tinyint(1)	YES	0				
14	custom_audience	json	YES	NULL				
15	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
16	expires_at	timestamp	NO	NULL		MUL		

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_expires	NON_UNIQUE	BTREE	expires_at	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
snap_stories_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `snap_stories` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `story_type` enum('photo','video','text') COLLATE utf8mb4_unicode_ci NOT NULL,
  `media_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `text_content` text COLLATE utf8mb4_unicode_ci,
  `location_data` json DEFAULT NULL,
  `music_data` json DEFAULT NULL,
  `filters` json DEFAULT NULL,
  `stickers` json DEFAULT NULL,
  `mentions` json DEFAULT NULL,
  `view_count` int DEFAULT '0',
  `screenshot_count` int DEFAULT '0',
  `is_private` tinyint(1) DEFAULT '0',
  `custom_audience` json DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `expires_at` timestamp NOT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_expires` (`expires_at`),
  CONSTRAINT `snap_stories_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: snap_streaks
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:28:58 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user1_id	int	NO	NULL		MUL		
3	user2_id	int	NO	NULL		MUL		
4	streak_count	int	YES	0		MUL		
5	longest_streak	int	YES	0				
6	last_snap_user1	timestamp	YES	NULL				
7	last_snap_user2	timestamp	YES	NULL				
8	is_active	tinyint(1)	YES	1				
9	started_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
10	ended_at	timestamp	YES	NULL				

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_count	NON_UNIQUE	BTREE	streak_count	0
idx_users	NON_UNIQUE	BTREE	user1_id, user2_id	0
unique_streak	UNIQUE	BTREE	user1_id, user2_id	0
user2_id	NON_UNIQUE	BTREE	user2_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
snap_streaks_ibfk_1	user1_id	users	id	NO ACTION	NO ACTION
snap_streaks_ibfk_2	user2_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `snap_streaks` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user1_id` int NOT NULL,
  `user2_id` int NOT NULL,
  `streak_count` int DEFAULT '0',
  `longest_streak` int DEFAULT '0',
  `last_snap_user1` timestamp NULL DEFAULT NULL,
  `last_snap_user2` timestamp NULL DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT '1',
  `started_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `ended_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_streak` (`user1_id`,`user2_id`),
  KEY `idx_users` (`user1_id`,`user2_id`),
  KEY `idx_count` (`streak_count`),
  KEY `user2_id` (`user2_id`),
  CONSTRAINT `snap_streaks_ibfk_1` FOREIGN KEY (`user1_id`) REFERENCES `users` (`id`),
  CONSTRAINT `snap_streaks_ibfk_2` FOREIGN KEY (`user2_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: snaps
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:28:58 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	sender_id	int	NO	NULL		MUL		
3	snap_type	enum('photo','video','chat')	NO	NULL			utf8mb4_unicode_ci	
4	media_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
5	message_text	text	YES	NULL			utf8mb4_unicode_ci	
6	drawing_data	json	YES	NULL				
7	filters_applied	json	YES	NULL				
8	stickers_used	json	YES	NULL				
9	duration_seconds	int	YES	10				
10	is_saved	tinyint(1)	YES	0				
11	replay_count	int	YES	0				
12	screenshot_count	int	YES	0				
13	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
14	expires_at	timestamp	NO	NULL		MUL		

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_expires	NON_UNIQUE	BTREE	expires_at	0
idx_sender	NON_UNIQUE	BTREE	sender_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
snaps_ibfk_1	sender_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `snaps` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `sender_id` int NOT NULL,
  `snap_type` enum('photo','video','chat') COLLATE utf8mb4_unicode_ci NOT NULL,
  `media_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `message_text` text COLLATE utf8mb4_unicode_ci,
  `drawing_data` json DEFAULT NULL,
  `filters_applied` json DEFAULT NULL,
  `stickers_used` json DEFAULT NULL,
  `duration_seconds` int DEFAULT '10',
  `is_saved` tinyint(1) DEFAULT '0',
  `replay_count` int DEFAULT '0',
  `screenshot_count` int DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `expires_at` timestamp NOT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_sender` (`sender_id`),
  KEY `idx_expires` (`expires_at`),
  CONSTRAINT `snaps_ibfk_1` FOREIGN KEY (`sender_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: sounds_library
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:50:46 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	creator_id	int	YES	NULL		MUL		
3	title	varchar(200)	NO	NULL			utf8mb4_unicode_ci	
4	artist	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
5	sound_url	varchar(500)	NO	NULL			utf8mb4_unicode_ci	
6	cover_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
7	duration_seconds	int	NO	NULL				
8	category	enum('music','original','voice','effect','trending')	YES	original		MUL	utf8mb4_unicode_ci	
9	genre	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
10	bpm	int	YES	NULL				
11	usage_count	int	YES	0		MUL		
12	is_copyrighted	tinyint(1)	YES	0				
13	is_trending	tinyint(1)	YES	0		MUL		
14	is_featured	tinyint(1)	YES	0				
15	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_category	NON_UNIQUE	BTREE	category	0
idx_creator	NON_UNIQUE	BTREE	creator_id	0
idx_trending	NON_UNIQUE	BTREE	is_trending	0
idx_usage	NON_UNIQUE	BTREE	usage_count	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
sounds_library_ibfk_1	creator_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `sounds_library` (
  `id` int NOT NULL AUTO_INCREMENT,
  `creator_id` int DEFAULT NULL,
  `title` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `artist` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `sound_url` varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL,
  `cover_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `duration_seconds` int NOT NULL,
  `category` enum('music','original','voice','effect','trending') COLLATE utf8mb4_unicode_ci DEFAULT 'original',
  `genre` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `bpm` int DEFAULT NULL,
  `usage_count` int DEFAULT '0',
  `is_copyrighted` tinyint(1) DEFAULT '0',
  `is_trending` tinyint(1) DEFAULT '0',
  `is_featured` tinyint(1) DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_creator` (`creator_id`),
  KEY `idx_category` (`category`),
  KEY `idx_trending` (`is_trending`),
  KEY `idx_usage` (`usage_count`),
  CONSTRAINT `sounds_library_ibfk_1` FOREIGN KEY (`creator_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: spaces_rooms
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:27:53 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	host_id	int	NO	NULL		MUL		
3	co_hosts	json	YES	NULL				
4	room_title	varchar(200)	NO	NULL			utf8mb4_unicode_ci	
5	room_description	text	YES	NULL			utf8mb4_unicode_ci	
6	topic_tags	json	YES	NULL				
7	scheduled_start	timestamp	YES	NULL		MUL		
8	actual_start	timestamp	YES	NULL				
9	ended_at	timestamp	YES	NULL				
10	max_speakers	int	YES	10				
11	current_speakers	json	YES	NULL				
12	current_listeners	int	YES	0				
13	peak_listeners	int	YES	0				
14	total_speakers	int	YES	0				
15	raised_hands	json	YES	NULL				
16	blocked_users	json	YES	NULL				
17	is_recording	tinyint(1)	YES	0				
18	recording_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
19	is_ticketed	tinyint(1)	YES	0				
20	ticket_price	decimal(10,2)	YES	NULL				
21	status	enum('scheduled','live','ended')	YES	scheduled		MUL	utf8mb4_unicode_ci	
22	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_host	NON_UNIQUE	BTREE	host_id	0
idx_scheduled	NON_UNIQUE	BTREE	scheduled_start	0
idx_status	NON_UNIQUE	BTREE	status	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
spaces_rooms_ibfk_1	host_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `spaces_rooms` (
  `id` int NOT NULL AUTO_INCREMENT,
  `host_id` int NOT NULL,
  `co_hosts` json DEFAULT NULL,
  `room_title` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `room_description` text COLLATE utf8mb4_unicode_ci,
  `topic_tags` json DEFAULT NULL,
  `scheduled_start` timestamp NULL DEFAULT NULL,
  `actual_start` timestamp NULL DEFAULT NULL,
  `ended_at` timestamp NULL DEFAULT NULL,
  `max_speakers` int DEFAULT '10',
  `current_speakers` json DEFAULT NULL,
  `current_listeners` int DEFAULT '0',
  `peak_listeners` int DEFAULT '0',
  `total_speakers` int DEFAULT '0',
  `raised_hands` json DEFAULT NULL,
  `blocked_users` json DEFAULT NULL,
  `is_recording` tinyint(1) DEFAULT '0',
  `recording_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_ticketed` tinyint(1) DEFAULT '0',
  `ticket_price` decimal(10,2) DEFAULT NULL,
  `status` enum('scheduled','live','ended') COLLATE utf8mb4_unicode_ci DEFAULT 'scheduled',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_host` (`host_id`),
  KEY `idx_status` (`status`),
  KEY `idx_scheduled` (`scheduled_start`),
  CONSTRAINT `spaces_rooms_ibfk_1` FOREIGN KEY (`host_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: sports_bets
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 03:00:39 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	bet_slip_id	varchar(100)	NO	NULL		UNI	utf8mb4_unicode_ci	
3	user_id	int	NO	NULL		MUL		
4	bet_type	enum('single','multiple','system','live')	NO	NULL			utf8mb4_unicode_ci	
5	events	json	YES	NULL				
6	stake_amount	decimal(20,2)	NO	NULL				
7	total_odds	decimal(10,2)	NO	NULL				
8	potential_win	decimal(20,2)	NO	NULL				
9	actual_win	decimal(20,2)	YES	0.00				
10	status	enum('pending','won','lost','partial','cancelled','cashout')	YES	pending		MUL	utf8mb4_unicode_ci	
11	cashout_available	tinyint(1)	YES	0				
12	cashout_amount	decimal(20,2)	YES	NULL				
13	placed_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED	MUL		
14	settled_at	timestamp	YES	NULL				

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
bet_slip_id	UNIQUE	BTREE	bet_slip_id	0
idx_placed	NON_UNIQUE	BTREE	placed_at	0
idx_status	NON_UNIQUE	BTREE	status	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
sports_bets_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `sports_bets` (
  `id` int NOT NULL AUTO_INCREMENT,
  `bet_slip_id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` int NOT NULL,
  `bet_type` enum('single','multiple','system','live') COLLATE utf8mb4_unicode_ci NOT NULL,
  `events` json DEFAULT NULL,
  `stake_amount` decimal(20,2) NOT NULL,
  `total_odds` decimal(10,2) NOT NULL,
  `potential_win` decimal(20,2) NOT NULL,
  `actual_win` decimal(20,2) DEFAULT '0.00',
  `status` enum('pending','won','lost','partial','cancelled','cashout') COLLATE utf8mb4_unicode_ci DEFAULT 'pending',
  `cashout_available` tinyint(1) DEFAULT '0',
  `cashout_amount` decimal(20,2) DEFAULT NULL,
  `placed_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `settled_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `bet_slip_id` (`bet_slip_id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_status` (`status`),
  KEY `idx_placed` (`placed_at`),
  CONSTRAINT `sports_bets_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: sports_events
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 03:17:49 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	sport	varchar(50)	NO	NULL		MUL	utf8mb4_unicode_ci	
3	league	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
4	home_team	varchar(100)	NO	NULL			utf8mb4_unicode_ci	
5	away_team	varchar(100)	NO	NULL			utf8mb4_unicode_ci	
6	event_date	timestamp	NO	NULL		MUL		
7	venue	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
8	status	enum('upcoming','live','finished','cancelled','postponed')	YES	upcoming		MUL	utf8mb4_unicode_ci	
9	home_score	int	YES	NULL				
10	away_score	int	YES	NULL				
11	current_period	varchar(20)	YES	NULL			utf8mb4_unicode_ci	
12	current_time	varchar(20)	YES	NULL			utf8mb4_unicode_ci	
13	odds_home	decimal(5,2)	YES	NULL				
14	odds_draw	decimal(5,2)	YES	NULL				
15	odds_away	decimal(5,2)	YES	NULL				
16	total_bets_count	int	YES	0				
17	total_bets_amount	decimal(20,2)	YES	0.00				
18	live_stream_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
19	statistics	json	YES	NULL				
20	is_featured	tinyint(1)	YES	0				
21	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
22	updated_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_date	NON_UNIQUE	BTREE	event_date	0
idx_sport	NON_UNIQUE	BTREE	sport	0
idx_status	NON_UNIQUE	BTREE	status	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `sports_events` (
  `id` int NOT NULL AUTO_INCREMENT,
  `sport` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `league` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `home_team` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `away_team` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `event_date` timestamp NOT NULL,
  `venue` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` enum('upcoming','live','finished','cancelled','postponed') COLLATE utf8mb4_unicode_ci DEFAULT 'upcoming',
  `home_score` int DEFAULT NULL,
  `away_score` int DEFAULT NULL,
  `current_period` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `current_time` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `odds_home` decimal(5,2) DEFAULT NULL,
  `odds_draw` decimal(5,2) DEFAULT NULL,
  `odds_away` decimal(5,2) DEFAULT NULL,
  `total_bets_count` int DEFAULT '0',
  `total_bets_amount` decimal(20,2) DEFAULT '0.00',
  `live_stream_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `statistics` json DEFAULT NULL,
  `is_featured` tinyint(1) DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_sport` (`sport`),
  KEY `idx_date` (`event_date`),
  KEY `idx_status` (`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: stats_cache
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 2 | DATA_MB: 0.02 | INDEX_MB: 0.02 | TOTAL_MB: 0.03 | AUTO_INCREMENT: NULL | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-04 00:00:20 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	stat_key	varchar(50)	NO	NULL		PRI	utf8mb4_unicode_ci	
2	stat_value	json	YES	NULL				
3	updated_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP	MUL		

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	stat_key	2
idx_updated	NON_UNIQUE	BTREE	updated_at	2

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `stats_cache` (
  `stat_key` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `stat_value` json DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`stat_key`),
  KEY `idx_updated` (`updated_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: storage_plans
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 4 | DATA_MB: 0.02 | INDEX_MB: 0.00 | TOTAL_MB: 0.02 | AUTO_INCREMENT: 5 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:36:57 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	plan_name	varchar(100)	NO	NULL			utf8mb4_unicode_ci	
3	storage_gb	int	NO	NULL				
4	bandwidth_gb	int	YES	NULL				
5	max_file_size_mb	int	YES	NULL				
6	file_versioning	tinyint(1)	YES	1				
7	password_protection	tinyint(1)	YES	1				
8	advanced_sharing	tinyint(1)	YES	1				
9	priority_support	tinyint(1)	YES	0				
10	price_monthly	decimal(10,2)	NO	NULL				
11	price_yearly	decimal(10,2)	YES	NULL				
12	is_active	tinyint(1)	YES	1				
13	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	4

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `storage_plans` (
  `id` int NOT NULL AUTO_INCREMENT,
  `plan_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `storage_gb` int NOT NULL,
  `bandwidth_gb` int DEFAULT NULL,
  `max_file_size_mb` int DEFAULT NULL,
  `file_versioning` tinyint(1) DEFAULT '1',
  `password_protection` tinyint(1) DEFAULT '1',
  `advanced_sharing` tinyint(1) DEFAULT '1',
  `priority_support` tinyint(1) DEFAULT '0',
  `price_monthly` decimal(10,2) NOT NULL,
  `price_yearly` decimal(10,2) DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT '1',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: store_analytics
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:52:35 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	store_id	int	NO	NULL		MUL		
3	date	date	NO	NULL		MUL		
4	visitors	int	YES	0				
5	unique_visitors	int	YES	0				
6	page_views	int	YES	0				
7	bounce_rate	decimal(5,2)	YES	0.00				
8	avg_session_duration	int	YES	0				
9	orders	int	YES	0				
10	revenue	decimal(12,2)	YES	0.00				
11	conversion_rate	decimal(5,2)	YES	0.00				
12	avg_order_value	decimal(10,2)	YES	0.00				
13	cart_abandonment_rate	decimal(5,2)	YES	0.00				
14	top_products	json	YES	NULL				
15	top_referrers	json	YES	NULL				
16	device_breakdown	json	YES	NULL				
17	geographic_breakdown	json	YES	NULL				
18	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_date	NON_UNIQUE	BTREE	date	0
idx_store	NON_UNIQUE	BTREE	store_id	0
unique_analytics	UNIQUE	BTREE	store_id, date	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
store_analytics_ibfk_1	store_id	online_stores	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `store_analytics` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `store_id` int NOT NULL,
  `date` date NOT NULL,
  `visitors` int DEFAULT '0',
  `unique_visitors` int DEFAULT '0',
  `page_views` int DEFAULT '0',
  `bounce_rate` decimal(5,2) DEFAULT '0.00',
  `avg_session_duration` int DEFAULT '0',
  `orders` int DEFAULT '0',
  `revenue` decimal(12,2) DEFAULT '0.00',
  `conversion_rate` decimal(5,2) DEFAULT '0.00',
  `avg_order_value` decimal(10,2) DEFAULT '0.00',
  `cart_abandonment_rate` decimal(5,2) DEFAULT '0.00',
  `top_products` json DEFAULT NULL,
  `top_referrers` json DEFAULT NULL,
  `device_breakdown` json DEFAULT NULL,
  `geographic_breakdown` json DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_analytics` (`store_id`,`date`),
  KEY `idx_store` (`store_id`),
  KEY `idx_date` (`date`),
  CONSTRAINT `store_analytics_ibfk_1` FOREIGN KEY (`store_id`) REFERENCES `online_stores` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: store_collections
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:52:35 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	store_id	int	NO	NULL		MUL		
3	collection_name	varchar(200)	NO	NULL			utf8mb4_unicode_ci	
4	collection_slug	varchar(200)	NO	NULL			utf8mb4_unicode_ci	
5	description	text	YES	NULL			utf8mb4_unicode_ci	
6	image_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
7	collection_type	enum('manual','automated')	YES	manual			utf8mb4_unicode_ci	
8	conditions	json	YES	NULL				
9	product_ids	json	YES	NULL				
10	sort_order	varchar(50)	YES	manual			utf8mb4_unicode_ci	
11	is_featured	tinyint(1)	YES	0				
12	is_published	tinyint(1)	YES	1		MUL		
13	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_published	NON_UNIQUE	BTREE	is_published	0
idx_store	NON_UNIQUE	BTREE	store_id	0
unique_collection	UNIQUE	BTREE	store_id, collection_slug	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
store_collections_ibfk_1	store_id	online_stores	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `store_collections` (
  `id` int NOT NULL AUTO_INCREMENT,
  `store_id` int NOT NULL,
  `collection_name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `collection_slug` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `image_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `collection_type` enum('manual','automated') COLLATE utf8mb4_unicode_ci DEFAULT 'manual',
  `conditions` json DEFAULT NULL,
  `product_ids` json DEFAULT NULL,
  `sort_order` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT 'manual',
  `is_featured` tinyint(1) DEFAULT '0',
  `is_published` tinyint(1) DEFAULT '1',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_collection` (`store_id`,`collection_slug`),
  KEY `idx_store` (`store_id`),
  KEY `idx_published` (`is_published`),
  CONSTRAINT `store_collections_ibfk_1` FOREIGN KEY (`store_id`) REFERENCES `online_stores` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: store_pages
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:52:35 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	store_id	int	NO	NULL		MUL		
3	page_title	varchar(200)	NO	NULL			utf8mb4_unicode_ci	
4	page_slug	varchar(200)	NO	NULL			utf8mb4_unicode_ci	
5	page_content	text	YES	NULL			utf8mb4_unicode_ci	
6	page_type	enum('landing','about','contact','faq','terms','privacy','custom')	YES	custom			utf8mb4_unicode_ci	
7	meta_title	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
8	meta_description	text	YES	NULL			utf8mb4_unicode_ci	
9	meta_keywords	json	YES	NULL				
10	template	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
11	is_homepage	tinyint(1)	YES	0				
12	is_published	tinyint(1)	YES	1		MUL		
13	in_navigation	tinyint(1)	YES	1				
14	navigation_order	int	YES	0				
15	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
16	updated_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_published	NON_UNIQUE	BTREE	is_published	0
idx_store	NON_UNIQUE	BTREE	store_id	0
unique_page	UNIQUE	BTREE	store_id, page_slug	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
store_pages_ibfk_1	store_id	online_stores	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `store_pages` (
  `id` int NOT NULL AUTO_INCREMENT,
  `store_id` int NOT NULL,
  `page_title` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `page_slug` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `page_content` text COLLATE utf8mb4_unicode_ci,
  `page_type` enum('landing','about','contact','faq','terms','privacy','custom') COLLATE utf8mb4_unicode_ci DEFAULT 'custom',
  `meta_title` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `meta_description` text COLLATE utf8mb4_unicode_ci,
  `meta_keywords` json DEFAULT NULL,
  `template` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_homepage` tinyint(1) DEFAULT '0',
  `is_published` tinyint(1) DEFAULT '1',
  `in_navigation` tinyint(1) DEFAULT '1',
  `navigation_order` int DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_page` (`store_id`,`page_slug`),
  KEY `idx_store` (`store_id`),
  KEY `idx_published` (`is_published`),
  CONSTRAINT `store_pages_ibfk_1` FOREIGN KEY (`store_id`) REFERENCES `online_stores` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: store_themes
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:52:35 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	theme_name	varchar(200)	NO	NULL			utf8mb4_unicode_ci	
3	theme_category	varchar(100)	YES	NULL		MUL	utf8mb4_unicode_ci	
4	description	text	YES	NULL			utf8mb4_unicode_ci	
5	preview_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
6	thumbnail_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
7	price	decimal(10,2)	YES	0.00		MUL		
8	features	json	YES	NULL				
9	color_schemes	json	YES	NULL				
10	font_options	json	YES	NULL				
11	layout_options	json	YES	NULL				
12	mobile_responsive	tinyint(1)	YES	1				
13	page_builder	tinyint(1)	YES	0				
14	seo_optimized	tinyint(1)	YES	1				
15	load_speed_score	int	YES	NULL				
16	installations	int	YES	0				
17	average_rating	decimal(3,2)	YES	0.00		MUL		
18	developer_id	int	YES	NULL				
19	version	varchar(20)	YES	NULL			utf8mb4_unicode_ci	
20	last_updated	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			
21	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_category	NON_UNIQUE	BTREE	theme_category	0
idx_price	NON_UNIQUE	BTREE	price	0
idx_rating	NON_UNIQUE	BTREE	average_rating	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `store_themes` (
  `id` int NOT NULL AUTO_INCREMENT,
  `theme_name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `theme_category` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `preview_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `thumbnail_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `price` decimal(10,2) DEFAULT '0.00',
  `features` json DEFAULT NULL,
  `color_schemes` json DEFAULT NULL,
  `font_options` json DEFAULT NULL,
  `layout_options` json DEFAULT NULL,
  `mobile_responsive` tinyint(1) DEFAULT '1',
  `page_builder` tinyint(1) DEFAULT '0',
  `seo_optimized` tinyint(1) DEFAULT '1',
  `load_speed_score` int DEFAULT NULL,
  `installations` int DEFAULT '0',
  `average_rating` decimal(3,2) DEFAULT '0.00',
  `developer_id` int DEFAULT NULL,
  `version` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `last_updated` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_category` (`theme_category`),
  KEY `idx_price` (`price`),
  KEY `idx_rating` (`average_rating`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: story_views
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:42:20 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	story_id	int	NO	NULL		MUL		
3	viewer_id	int	NO	NULL		MUL		
4	viewed_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
5	reaction	varchar(20)	YES	NULL			utf8mb4_unicode_ci	

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_story	NON_UNIQUE	BTREE	story_id	0
idx_viewer	NON_UNIQUE	BTREE	viewer_id	0
unique_story_viewer	UNIQUE	BTREE	story_id, viewer_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
story_views_ibfk_1	story_id	user_stories	id	NO ACTION	CASCADE
story_views_ibfk_2	viewer_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `story_views` (
  `id` int NOT NULL AUTO_INCREMENT,
  `story_id` int NOT NULL,
  `viewer_id` int NOT NULL,
  `viewed_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `reaction` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_story_viewer` (`story_id`,`viewer_id`),
  KEY `idx_story` (`story_id`),
  KEY `idx_viewer` (`viewer_id`),
  CONSTRAINT `story_views_ibfk_1` FOREIGN KEY (`story_id`) REFERENCES `user_stories` (`id`) ON DELETE CASCADE,
  CONSTRAINT `story_views_ibfk_2` FOREIGN KEY (`viewer_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: stream_viewers
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:43:59 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	stream_id	int	NO	NULL		MUL		
3	viewer_id	int	NO	NULL		MUL		
4	joined_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
5	left_at	timestamp	YES	NULL				
6	watch_time_seconds	int	YES	0				
7	messages_sent	int	YES	0				
8	gifts_sent	int	YES	0				
9	coins_spent	int	YES	0				
10	is_following	tinyint(1)	YES	0				
11	is_moderator	tinyint(1)	YES	0				

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_stream	NON_UNIQUE	BTREE	stream_id	0
idx_viewer	NON_UNIQUE	BTREE	viewer_id	0
unique_stream_viewer	UNIQUE	BTREE	stream_id, viewer_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
stream_viewers_ibfk_1	stream_id	live_streams	id	NO ACTION	NO ACTION
stream_viewers_ibfk_2	viewer_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `stream_viewers` (
  `id` int NOT NULL AUTO_INCREMENT,
  `stream_id` int NOT NULL,
  `viewer_id` int NOT NULL,
  `joined_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `left_at` timestamp NULL DEFAULT NULL,
  `watch_time_seconds` int DEFAULT '0',
  `messages_sent` int DEFAULT '0',
  `gifts_sent` int DEFAULT '0',
  `coins_spent` int DEFAULT '0',
  `is_following` tinyint(1) DEFAULT '0',
  `is_moderator` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_stream_viewer` (`stream_id`,`viewer_id`),
  KEY `idx_stream` (`stream_id`),
  KEY `idx_viewer` (`viewer_id`),
  CONSTRAINT `stream_viewers_ibfk_1` FOREIGN KEY (`stream_id`) REFERENCES `live_streams` (`id`),
  CONSTRAINT `stream_viewers_ibfk_2` FOREIGN KEY (`viewer_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: subscription_boxes
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:51:43 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	store_id	int	NO	NULL		MUL		
3	box_name	varchar(200)	NO	NULL			utf8mb4_unicode_ci	
4	description	text	YES	NULL			utf8mb4_unicode_ci	
5	frequency	enum('weekly','biweekly','monthly','quarterly','annually')	YES	monthly			utf8mb4_unicode_ci	
6	price_per_period	decimal(10,2)	NO	NULL				
7	shipping_included	tinyint(1)	YES	1				
8	products_per_box	int	YES	5				
9	customizable	tinyint(1)	YES	0				
10	categories	json	YES	NULL				
11	subscriber_count	int	YES	0				
12	is_active	tinyint(1)	YES	1		MUL		
13	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_active	NON_UNIQUE	BTREE	is_active	0
idx_store	NON_UNIQUE	BTREE	store_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
subscription_boxes_ibfk_1	store_id	vendor_stores	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `subscription_boxes` (
  `id` int NOT NULL AUTO_INCREMENT,
  `store_id` int NOT NULL,
  `box_name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `frequency` enum('weekly','biweekly','monthly','quarterly','annually') COLLATE utf8mb4_unicode_ci DEFAULT 'monthly',
  `price_per_period` decimal(10,2) NOT NULL,
  `shipping_included` tinyint(1) DEFAULT '1',
  `products_per_box` int DEFAULT '5',
  `customizable` tinyint(1) DEFAULT '0',
  `categories` json DEFAULT NULL,
  `subscriber_count` int DEFAULT '0',
  `is_active` tinyint(1) DEFAULT '1',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_store` (`store_id`),
  KEY `idx_active` (`is_active`),
  CONSTRAINT `subscription_boxes_ibfk_1` FOREIGN KEY (`store_id`) REFERENCES `vendor_stores` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: subscription_history
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.02 | TOTAL_MB: 0.03 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-07 01:09:42 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	plan_type	enum('free','premium','vip')	NO	NULL			utf8mb4_unicode_ci	
4	price_paid	decimal(10,2)	YES	NULL				
5	payment_method	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
6	transaction_id	varchar(255)	YES	NULL			utf8mb4_unicode_ci	
7	started_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
8	expires_at	timestamp	YES	NULL				
9	cancelled_at	timestamp	YES	NULL				

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
subscription_history_ibfk_1	user_id	users	id	NO ACTION	CASCADE

--- SHOW CREATE TABLE ---
CREATE TABLE `subscription_history` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `plan_type` enum('free','premium','vip') COLLATE utf8mb4_unicode_ci NOT NULL,
  `price_paid` decimal(10,2) DEFAULT NULL,
  `payment_method` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `transaction_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `started_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `expires_at` timestamp NULL DEFAULT NULL,
  `cancelled_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  CONSTRAINT `subscription_history_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: super_admin_control
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 16:03:29 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	admin_id	int	NO	NULL		UNI		
3	access_level	enum('god_mode','super_admin','system_admin')	YES	super_admin			utf8mb4_unicode_ci	
4	permissions	json	YES	NULL				
5	ip_whitelist	json	YES	NULL				
6	two_factor_required	tinyint(1)	YES	1				
7	biometric_auth	tinyint(1)	YES	0				
8	session_token	varchar(500)	YES	NULL		UNI	utf8mb4_unicode_ci	
9	last_login	timestamp	YES	NULL				
10	total_logins	int	YES	0				
11	active_sessions	json	YES	NULL				
12	emergency_shutdown_code	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
13	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_token	NON_UNIQUE	BTREE	session_token	0
session_token	UNIQUE	BTREE	session_token	0
unique_admin	UNIQUE	BTREE	admin_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
super_admin_control_ibfk_1	admin_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `super_admin_control` (
  `id` int NOT NULL AUTO_INCREMENT,
  `admin_id` int NOT NULL,
  `access_level` enum('god_mode','super_admin','system_admin') COLLATE utf8mb4_unicode_ci DEFAULT 'super_admin',
  `permissions` json DEFAULT NULL,
  `ip_whitelist` json DEFAULT NULL,
  `two_factor_required` tinyint(1) DEFAULT '1',
  `biometric_auth` tinyint(1) DEFAULT '0',
  `session_token` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `last_login` timestamp NULL DEFAULT NULL,
  `total_logins` int DEFAULT '0',
  `active_sessions` json DEFAULT NULL,
  `emergency_shutdown_code` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_admin` (`admin_id`),
  UNIQUE KEY `session_token` (`session_token`),
  KEY `idx_token` (`session_token`),
  CONSTRAINT `super_admin_control_ibfk_1` FOREIGN KEY (`admin_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: super_search
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:31:20 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	search_query	text	NO	NULL		MUL	utf8mb4_unicode_ci	
3	user_id	int	YES	NULL		MUL		
4	search_filters	json	YES	NULL				
5	platforms_searched	json	YES	NULL				
6	content_types	json	YES	NULL				
7	total_results	int	YES	0				
8	results_shown	int	YES	0				
9	clicked_results	json	YES	NULL				
10	search_duration_ms	int	YES	NULL				
11	relevance_feedback	json	YES	NULL				
12	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_query	NON_UNIQUE	FULLTEXT	search_query	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
super_search_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `super_search` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `search_query` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` int DEFAULT NULL,
  `search_filters` json DEFAULT NULL,
  `platforms_searched` json DEFAULT NULL,
  `content_types` json DEFAULT NULL,
  `total_results` int DEFAULT '0',
  `results_shown` int DEFAULT '0',
  `clicked_results` json DEFAULT NULL,
  `search_duration_ms` int DEFAULT NULL,
  `relevance_feedback` json DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  FULLTEXT KEY `idx_query` (`search_query`),
  CONSTRAINT `super_search_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: supplier_management
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:53:00 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	supplier_name	varchar(200)	NO	NULL		MUL	utf8mb4_unicode_ci	
3	company_registration	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
4	contact_person	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
5	email	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
6	phone	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
7	address	text	YES	NULL			utf8mb4_unicode_ci	
8	country	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
9	payment_terms	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
10	lead_time_days	int	YES	NULL				
11	minimum_order_value	decimal(12,2)	YES	NULL				
12	currency	varchar(3)	YES	USD			utf8mb4_unicode_ci	
13	categories_supplied	json	YES	NULL				
14	brands_carried	json	YES	NULL				
15	certifications	json	YES	NULL				
16	quality_rating	decimal(3,2)	YES	0.00				
17	delivery_rating	decimal(3,2)	YES	0.00				
18	price_rating	decimal(3,2)	YES	0.00				
19	total_orders	int	YES	0				
20	total_spent	decimal(20,2)	YES	0.00				
21	is_preferred	tinyint(1)	YES	0		MUL		
22	is_active	tinyint(1)	YES	1		MUL		
23	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_active	NON_UNIQUE	BTREE	is_active	0
idx_name	NON_UNIQUE	BTREE	supplier_name	0
idx_preferred	NON_UNIQUE	BTREE	is_preferred	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `supplier_management` (
  `id` int NOT NULL AUTO_INCREMENT,
  `supplier_name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `company_registration` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `contact_person` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address` text COLLATE utf8mb4_unicode_ci,
  `country` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `payment_terms` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `lead_time_days` int DEFAULT NULL,
  `minimum_order_value` decimal(12,2) DEFAULT NULL,
  `currency` varchar(3) COLLATE utf8mb4_unicode_ci DEFAULT 'USD',
  `categories_supplied` json DEFAULT NULL,
  `brands_carried` json DEFAULT NULL,
  `certifications` json DEFAULT NULL,
  `quality_rating` decimal(3,2) DEFAULT '0.00',
  `delivery_rating` decimal(3,2) DEFAULT '0.00',
  `price_rating` decimal(3,2) DEFAULT '0.00',
  `total_orders` int DEFAULT '0',
  `total_spent` decimal(20,2) DEFAULT '0.00',
  `is_preferred` tinyint(1) DEFAULT '0',
  `is_active` tinyint(1) DEFAULT '1',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_name` (`supplier_name`),
  KEY `idx_preferred` (`is_preferred`),
  KEY `idx_active` (`is_active`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: support_tickets
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.08 | TOTAL_MB: 0.09 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:44:26 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	ticket_number	varchar(20)	NO	NULL		UNI	utf8mb4_unicode_ci	
3	user_id	int	NO	NULL		MUL		
4	assigned_to	int	YES	NULL		MUL		
5	category	enum('account','payment','technical','report','suggestion','other')	NO	NULL			utf8mb4_unicode_ci	
6	priority	enum('low','medium','high','urgent')	YES	medium		MUL	utf8mb4_unicode_ci	
7	subject	varchar(255)	NO	NULL			utf8mb4_unicode_ci	
8	description	text	NO	NULL			utf8mb4_unicode_ci	
9	attachments	json	YES	NULL				
10	status	enum('open','pending','answered','resolved','closed')	YES	open		MUL	utf8mb4_unicode_ci	
11	satisfaction_rating	int	YES	NULL				
12	resolution_notes	text	YES	NULL			utf8mb4_unicode_ci	
13	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
14	updated_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			
15	resolved_at	timestamp	YES	NULL				
16	first_response_at	timestamp	YES	NULL				

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_assigned	NON_UNIQUE	BTREE	assigned_to	0
idx_priority	NON_UNIQUE	BTREE	priority	0
idx_status	NON_UNIQUE	BTREE	status	0
idx_user	NON_UNIQUE	BTREE	user_id	0
ticket_number	UNIQUE	BTREE	ticket_number	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
support_tickets_ibfk_1	user_id	users	id	NO ACTION	NO ACTION
support_tickets_ibfk_2	assigned_to	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `support_tickets` (
  `id` int NOT NULL AUTO_INCREMENT,
  `ticket_number` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` int NOT NULL,
  `assigned_to` int DEFAULT NULL,
  `category` enum('account','payment','technical','report','suggestion','other') COLLATE utf8mb4_unicode_ci NOT NULL,
  `priority` enum('low','medium','high','urgent') COLLATE utf8mb4_unicode_ci DEFAULT 'medium',
  `subject` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `attachments` json DEFAULT NULL,
  `status` enum('open','pending','answered','resolved','closed') COLLATE utf8mb4_unicode_ci DEFAULT 'open',
  `satisfaction_rating` int DEFAULT NULL,
  `resolution_notes` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `resolved_at` timestamp NULL DEFAULT NULL,
  `first_response_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ticket_number` (`ticket_number`),
  KEY `idx_user` (`user_id`),
  KEY `idx_status` (`status`),
  KEY `idx_priority` (`priority`),
  KEY `idx_assigned` (`assigned_to`),
  CONSTRAINT `support_tickets_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
  CONSTRAINT `support_tickets_ibfk_2` FOREIGN KEY (`assigned_to`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: sync_conflicts
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:53:41 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	entity_type	varchar(100)	NO	NULL		MUL	utf8mb4_unicode_ci	
3	entity_id	varchar(200)	NO	NULL			utf8mb4_unicode_ci	
4	platform_1	varchar(100)	NO	NULL			utf8mb4_unicode_ci	
5	platform_2	varchar(100)	NO	NULL			utf8mb4_unicode_ci	
6	conflict_type	enum('data_mismatch','duplicate','missing','version_conflict')	NO	NULL			utf8mb4_unicode_ci	
7	field_name	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
8	value_1	text	YES	NULL			utf8mb4_unicode_ci	
9	value_2	text	YES	NULL			utf8mb4_unicode_ci	
10	resolution_strategy	enum('manual','newest_wins','platform1_wins','platform2_wins','merge')	YES	manual			utf8mb4_unicode_ci	
11	resolved	tinyint(1)	YES	0		MUL		
12	resolved_by	int	YES	NULL		MUL		
13	resolution_notes	text	YES	NULL			utf8mb4_unicode_ci	
14	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
15	resolved_at	timestamp	YES	NULL				

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_entity	NON_UNIQUE	BTREE	entity_type, entity_id	0
idx_resolved	NON_UNIQUE	BTREE	resolved	0
resolved_by	NON_UNIQUE	BTREE	resolved_by	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
sync_conflicts_ibfk_1	resolved_by	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `sync_conflicts` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `entity_type` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `entity_id` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `platform_1` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `platform_2` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `conflict_type` enum('data_mismatch','duplicate','missing','version_conflict') COLLATE utf8mb4_unicode_ci NOT NULL,
  `field_name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `value_1` text COLLATE utf8mb4_unicode_ci,
  `value_2` text COLLATE utf8mb4_unicode_ci,
  `resolution_strategy` enum('manual','newest_wins','platform1_wins','platform2_wins','merge') COLLATE utf8mb4_unicode_ci DEFAULT 'manual',
  `resolved` tinyint(1) DEFAULT '0',
  `resolved_by` int DEFAULT NULL,
  `resolution_notes` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `resolved_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_entity` (`entity_type`,`entity_id`),
  KEY `idx_resolved` (`resolved`),
  KEY `resolved_by` (`resolved_by`),
  CONSTRAINT `sync_conflicts_ibfk_1` FOREIGN KEY (`resolved_by`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: sync_logs
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:53:41 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	integration_id	int	NO	NULL		MUL		
3	sync_type	enum('full','incremental','selective')	NO	NULL			utf8mb4_unicode_ci	
4	direction	enum('import','export','bidirectional')	NO	NULL			utf8mb4_unicode_ci	
5	items_processed	int	YES	0				
6	items_created	int	YES	0				
7	items_updated	int	YES	0				
8	items_deleted	int	YES	0				
9	items_failed	int	YES	0				
10	error_details	json	YES	NULL				
11	duration_seconds	int	YES	NULL				
12	started_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED	MUL		
13	completed_at	timestamp	YES	NULL				

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_integration	NON_UNIQUE	BTREE	integration_id	0
idx_started	NON_UNIQUE	BTREE	started_at	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
sync_logs_ibfk_1	integration_id	platform_integrations	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `sync_logs` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `integration_id` int NOT NULL,
  `sync_type` enum('full','incremental','selective') COLLATE utf8mb4_unicode_ci NOT NULL,
  `direction` enum('import','export','bidirectional') COLLATE utf8mb4_unicode_ci NOT NULL,
  `items_processed` int DEFAULT '0',
  `items_created` int DEFAULT '0',
  `items_updated` int DEFAULT '0',
  `items_deleted` int DEFAULT '0',
  `items_failed` int DEFAULT '0',
  `error_details` json DEFAULT NULL,
  `duration_seconds` int DEFAULT NULL,
  `started_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `completed_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_integration` (`integration_id`),
  KEY `idx_started` (`started_at`),
  CONSTRAINT `sync_logs_ibfk_1` FOREIGN KEY (`integration_id`) REFERENCES `platform_integrations` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: system_audit_logs
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.08 | TOTAL_MB: 0.09 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 16:03:29 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	user_id	int	YES	NULL		MUL		
3	action_type	varchar(100)	NO	NULL		MUL	utf8mb4_unicode_ci	
4	entity_type	varchar(100)	YES	NULL		MUL	utf8mb4_unicode_ci	
5	entity_id	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
6	old_value	json	YES	NULL				
7	new_value	json	YES	NULL				
8	ip_address	varchar(45)	YES	NULL			utf8mb4_unicode_ci	
9	user_agent	text	YES	NULL			utf8mb4_unicode_ci	
10	session_id	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
11	module	varchar(100)	YES	NULL		MUL	utf8mb4_unicode_ci	
12	sub_module	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
13	sql_executed	text	YES	NULL			utf8mb4_unicode_ci	
14	api_endpoint	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
15	http_method	varchar(10)	YES	NULL			utf8mb4_unicode_ci	
16	response_code	int	YES	NULL				
17	execution_time_ms	int	YES	NULL				
18	error_message	text	YES	NULL			utf8mb4_unicode_ci	
19	stack_trace	text	YES	NULL			utf8mb4_unicode_ci	
20	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED	MUL		

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_action	NON_UNIQUE	BTREE	action_type	0
idx_created	NON_UNIQUE	BTREE	created_at	0
idx_entity	NON_UNIQUE	BTREE	entity_type, entity_id	0
idx_module	NON_UNIQUE	BTREE	module	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
system_audit_logs_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `system_audit_logs` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `user_id` int DEFAULT NULL,
  `action_type` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `entity_type` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `entity_id` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `old_value` json DEFAULT NULL,
  `new_value` json DEFAULT NULL,
  `ip_address` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_agent` text COLLATE utf8mb4_unicode_ci,
  `session_id` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `module` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `sub_module` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `sql_executed` text COLLATE utf8mb4_unicode_ci,
  `api_endpoint` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `http_method` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `response_code` int DEFAULT NULL,
  `execution_time_ms` int DEFAULT NULL,
  `error_message` text COLLATE utf8mb4_unicode_ci,
  `stack_trace` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_action` (`action_type`),
  KEY `idx_entity` (`entity_type`,`entity_id`),
  KEY `idx_module` (`module`),
  KEY `idx_created` (`created_at`),
  CONSTRAINT `system_audit_logs_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: system_health_metrics
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.02 | TOTAL_MB: 0.03 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 16:03:29 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	check_timestamp	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED	MUL		
3	servers_total	int	YES	0				
4	servers_online	int	YES	0				
5	servers_warning	int	YES	0				
6	servers_critical	int	YES	0				
7	db_connections_active	int	YES	0				
8	db_connections_idle	int	YES	0				
9	db_queries_per_second	decimal(10,2)	YES	0.00				
10	db_slow_queries	int	YES	0				
11	db_deadlocks	int	YES	0				
12	db_replication_lag_seconds	int	YES	0				
13	cache_hit_ratio	decimal(5,2)	YES	0.00				
14	cache_memory_used_gb	decimal(10,2)	YES	0.00				
15	cache_evictions_per_minute	int	YES	0				
16	queue_jobs_pending	int	YES	0				
17	queue_jobs_processing	int	YES	0				
18	queue_jobs_failed	int	YES	0				
19	queue_average_wait_seconds	int	YES	0				
20	api_availability_percentage	decimal(5,2)	YES	100.00				
21	api_average_response_ms	int	YES	0				
22	api_error_rate	decimal(5,2)	YES	0.00				
23	api_rate_limit_hits	int	YES	0				
24	storage_used_tb	decimal(10,2)	YES	0.00				
25	storage_available_tb	decimal(10,2)	YES	0.00				
26	storage_growth_rate_gb_per_day	decimal(10,2)	YES	0.00				
27	bandwidth_in_gbps	decimal(10,2)	YES	0.00				
28	bandwidth_out_gbps	decimal(10,2)	YES	0.00				
29	packet_loss_percentage	decimal(5,2)	YES	0.00				
30	firewall_blocks_per_minute	int	YES	0				
31	ddos_mitigation_active	tinyint(1)	YES	0				
32	ssl_certificates_expiring_soon	int	YES	0				
33	overall_health_score	decimal(5,2)	YES	100.00				

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_timestamp	NON_UNIQUE	BTREE	check_timestamp	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `system_health_metrics` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `check_timestamp` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `servers_total` int DEFAULT '0',
  `servers_online` int DEFAULT '0',
  `servers_warning` int DEFAULT '0',
  `servers_critical` int DEFAULT '0',
  `db_connections_active` int DEFAULT '0',
  `db_connections_idle` int DEFAULT '0',
  `db_queries_per_second` decimal(10,2) DEFAULT '0.00',
  `db_slow_queries` int DEFAULT '0',
  `db_deadlocks` int DEFAULT '0',
  `db_replication_lag_seconds` int DEFAULT '0',
  `cache_hit_ratio` decimal(5,2) DEFAULT '0.00',
  `cache_memory_used_gb` decimal(10,2) DEFAULT '0.00',
  `cache_evictions_per_minute` int DEFAULT '0',
  `queue_jobs_pending` int DEFAULT '0',
  `queue_jobs_processing` int DEFAULT '0',
  `queue_jobs_failed` int DEFAULT '0',
  `queue_average_wait_seconds` int DEFAULT '0',
  `api_availability_percentage` decimal(5,2) DEFAULT '100.00',
  `api_average_response_ms` int DEFAULT '0',
  `api_error_rate` decimal(5,2) DEFAULT '0.00',
  `api_rate_limit_hits` int DEFAULT '0',
  `storage_used_tb` decimal(10,2) DEFAULT '0.00',
  `storage_available_tb` decimal(10,2) DEFAULT '0.00',
  `storage_growth_rate_gb_per_day` decimal(10,2) DEFAULT '0.00',
  `bandwidth_in_gbps` decimal(10,2) DEFAULT '0.00',
  `bandwidth_out_gbps` decimal(10,2) DEFAULT '0.00',
  `packet_loss_percentage` decimal(5,2) DEFAULT '0.00',
  `firewall_blocks_per_minute` int DEFAULT '0',
  `ddos_mitigation_active` tinyint(1) DEFAULT '0',
  `ssl_certificates_expiring_soon` int DEFAULT '0',
  `overall_health_score` decimal(5,2) DEFAULT '100.00',
  PRIMARY KEY (`id`),
  KEY `idx_timestamp` (`check_timestamp`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: system_metrics
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:13:51 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	metric_name	varchar(100)	NO	NULL		MUL	utf8mb4_unicode_ci	
3	metric_value	decimal(30,10)	YES	NULL				
4	metric_data	json	YES	NULL				
5	period_start	timestamp	NO	NULL		MUL		
6	period_end	timestamp	NO	NULL				
7	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_metric	NON_UNIQUE	BTREE	metric_name	0
idx_period	NON_UNIQUE	BTREE	period_start, period_end	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `system_metrics` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `metric_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `metric_value` decimal(30,10) DEFAULT NULL,
  `metric_data` json DEFAULT NULL,
  `period_start` timestamp NOT NULL,
  `period_end` timestamp NOT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_metric` (`metric_name`),
  KEY `idx_period` (`period_start`,`period_end`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: system_overview_realtime
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.02 | TOTAL_MB: 0.03 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 16:03:29 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	metric_timestamp	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED	MUL		
3	total_users	bigint	YES	0				
4	active_users_now	int	YES	0				
5	active_users_24h	int	YES	0				
6	active_users_7d	int	YES	0				
7	active_users_30d	int	YES	0				
8	new_users_today	int	YES	0				
9	new_users_week	int	YES	0				
10	new_users_month	int	YES	0				
11	users_by_country	json	YES	NULL				
12	users_by_platform	json	YES	NULL				
13	users_by_device	json	YES	NULL				
14	revenue_today	decimal(20,2)	YES	0.00				
15	revenue_week	decimal(20,2)	YES	0.00				
16	revenue_month	decimal(20,2)	YES	0.00				
17	revenue_year	decimal(20,2)	YES	0.00				
18	revenue_total	decimal(30,2)	YES	0.00				
19	revenue_by_source	json	YES	NULL				
20	revenue_by_country	json	YES	NULL				
21	revenue_by_product	json	YES	NULL				
22	transactions_today	int	YES	0				
23	transactions_pending	int	YES	0				
24	orders_today	int	YES	0				
25	orders_pending	int	YES	0				
26	orders_processing	int	YES	0				
27	orders_shipped	int	YES	0				
28	products_active	bigint	YES	0				
29	products_out_of_stock	int	YES	0				
30	cart_abandonment_rate	decimal(5,2)	YES	0.00				
31	conversion_rate	decimal(5,2)	YES	0.00				
32	posts_today	int	YES	0				
33	posts_total	bigint	YES	0				
34	interactions_today	bigint	YES	0				
35	messages_sent_today	bigint	YES	0				
36	active_conversations	int	YES	0				
37	active_streams	int	YES	0				
38	total_viewers	int	YES	0				
39	videos_uploaded_today	int	YES	0				
40	watch_time_hours_today	decimal(20,2)	YES	0.00				
41	active_games	int	YES	0				
42	active_players	int	YES	0				
43	bets_placed_today	bigint	YES	0				
44	gaming_revenue_today	decimal(20,2)	YES	0.00				
45	server_load_percentage	decimal(5,2)	YES	0.00				
46	memory_usage_percentage	decimal(5,2)	YES	0.00				
47	storage_usage_percentage	decimal(5,2)	YES	0.00				
48	bandwidth_usage_gb	decimal(20,2)	YES	0.00				
49	api_calls_today	bigint	YES	0				
50	errors_today	int	YES	0				
51	security_threats_detected	int	YES	0				
52	blocked_attacks	int	YES	0				
53	suspicious_activities	int	YES	0				
54	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_timestamp	NON_UNIQUE	BTREE	metric_timestamp	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `system_overview_realtime` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `metric_timestamp` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `total_users` bigint DEFAULT '0',
  `active_users_now` int DEFAULT '0',
  `active_users_24h` int DEFAULT '0',
  `active_users_7d` int DEFAULT '0',
  `active_users_30d` int DEFAULT '0',
  `new_users_today` int DEFAULT '0',
  `new_users_week` int DEFAULT '0',
  `new_users_month` int DEFAULT '0',
  `users_by_country` json DEFAULT NULL,
  `users_by_platform` json DEFAULT NULL,
  `users_by_device` json DEFAULT NULL,
  `revenue_today` decimal(20,2) DEFAULT '0.00',
  `revenue_week` decimal(20,2) DEFAULT '0.00',
  `revenue_month` decimal(20,2) DEFAULT '0.00',
  `revenue_year` decimal(20,2) DEFAULT '0.00',
  `revenue_total` decimal(30,2) DEFAULT '0.00',
  `revenue_by_source` json DEFAULT NULL,
  `revenue_by_country` json DEFAULT NULL,
  `revenue_by_product` json DEFAULT NULL,
  `transactions_today` int DEFAULT '0',
  `transactions_pending` int DEFAULT '0',
  `orders_today` int DEFAULT '0',
  `orders_pending` int DEFAULT '0',
  `orders_processing` int DEFAULT '0',
  `orders_shipped` int DEFAULT '0',
  `products_active` bigint DEFAULT '0',
  `products_out_of_stock` int DEFAULT '0',
  `cart_abandonment_rate` decimal(5,2) DEFAULT '0.00',
  `conversion_rate` decimal(5,2) DEFAULT '0.00',
  `posts_today` int DEFAULT '0',
  `posts_total` bigint DEFAULT '0',
  `interactions_today` bigint DEFAULT '0',
  `messages_sent_today` bigint DEFAULT '0',
  `active_conversations` int DEFAULT '0',
  `active_streams` int DEFAULT '0',
  `total_viewers` int DEFAULT '0',
  `videos_uploaded_today` int DEFAULT '0',
  `watch_time_hours_today` decimal(20,2) DEFAULT '0.00',
  `active_games` int DEFAULT '0',
  `active_players` int DEFAULT '0',
  `bets_placed_today` bigint DEFAULT '0',
  `gaming_revenue_today` decimal(20,2) DEFAULT '0.00',
  `server_load_percentage` decimal(5,2) DEFAULT '0.00',
  `memory_usage_percentage` decimal(5,2) DEFAULT '0.00',
  `storage_usage_percentage` decimal(5,2) DEFAULT '0.00',
  `bandwidth_usage_gb` decimal(20,2) DEFAULT '0.00',
  `api_calls_today` bigint DEFAULT '0',
  `errors_today` int DEFAULT '0',
  `security_threats_detected` int DEFAULT '0',
  `blocked_attacks` int DEFAULT '0',
  `suspicious_activities` int DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_timestamp` (`metric_timestamp`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: system_settings
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 12 | DATA_MB: 0.02 | INDEX_MB: 0.02 | TOTAL_MB: 0.03 | AUTO_INCREMENT: 13 | COLLATION: utf8mb4_0900_ai_ci | CREATE: 2025-08-04 01:43:53 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	setting_key	varchar(100)	NO	NULL		UNI	utf8mb4_0900_ai_ci	
3	setting_value	text	YES	NULL			utf8mb4_0900_ai_ci	
4	setting_type	varchar(50)	YES	string			utf8mb4_0900_ai_ci	
5	description	text	YES	NULL			utf8mb4_0900_ai_ci	
6	updated_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			
7	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	12
setting_key	UNIQUE	BTREE	setting_key	12

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `system_settings` (
  `id` int NOT NULL AUTO_INCREMENT,
  `setting_key` varchar(100) NOT NULL,
  `setting_value` text,
  `setting_type` varchar(50) DEFAULT 'string',
  `description` text,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `setting_key` (`setting_key`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;


============================================================
TABLE: talent_agencies
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:49:07 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	name	varchar(100)	NO	NULL			utf8mb4_unicode_ci	
3	agency_code	varchar(20)	NO	NULL		UNI	utf8mb4_unicode_ci	
4	owner_id	int	NO	NULL		MUL		
5	managers	json	YES	NULL				
6	description	text	YES	NULL			utf8mb4_unicode_ci	
7	logo_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
8	cover_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
9	commission_rate	decimal(5,2)	YES	10.00				
10	total_members	int	YES	0				
11	total_earnings	decimal(15,2)	YES	0.00				
12	recruitment_open	tinyint(1)	YES	1				
13	requirements	text	YES	NULL			utf8mb4_unicode_ci	
14	benefits	text	YES	NULL			utf8mb4_unicode_ci	
15	ranking_points	int	YES	0		MUL		
16	level	int	YES	1				
17	is_verified	tinyint(1)	YES	0				
18	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
agency_code	UNIQUE	BTREE	agency_code	0
idx_owner	NON_UNIQUE	BTREE	owner_id	0
idx_ranking	NON_UNIQUE	BTREE	ranking_points	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
talent_agencies_ibfk_1	owner_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `talent_agencies` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `agency_code` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `owner_id` int NOT NULL,
  `managers` json DEFAULT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `logo_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cover_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `commission_rate` decimal(5,2) DEFAULT '10.00',
  `total_members` int DEFAULT '0',
  `total_earnings` decimal(15,2) DEFAULT '0.00',
  `recruitment_open` tinyint(1) DEFAULT '1',
  `requirements` text COLLATE utf8mb4_unicode_ci,
  `benefits` text COLLATE utf8mb4_unicode_ci,
  `ranking_points` int DEFAULT '0',
  `level` int DEFAULT '1',
  `is_verified` tinyint(1) DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `agency_code` (`agency_code`),
  KEY `idx_owner` (`owner_id`),
  KEY `idx_ranking` (`ranking_points`),
  CONSTRAINT `talent_agencies_ibfk_1` FOREIGN KEY (`owner_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: ticket_messages
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:44:39 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	ticket_id	int	NO	NULL		MUL		
3	sender_id	int	NO	NULL		MUL		
4	message	text	NO	NULL			utf8mb4_unicode_ci	
5	attachments	json	YES	NULL				
6	is_internal_note	tinyint(1)	YES	0				
7	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_sender	NON_UNIQUE	BTREE	sender_id	0
idx_ticket	NON_UNIQUE	BTREE	ticket_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
ticket_messages_ibfk_1	ticket_id	support_tickets	id	NO ACTION	CASCADE
ticket_messages_ibfk_2	sender_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `ticket_messages` (
  `id` int NOT NULL AUTO_INCREMENT,
  `ticket_id` int NOT NULL,
  `sender_id` int NOT NULL,
  `message` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `attachments` json DEFAULT NULL,
  `is_internal_note` tinyint(1) DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_ticket` (`ticket_id`),
  KEY `idx_sender` (`sender_id`),
  CONSTRAINT `ticket_messages_ibfk_1` FOREIGN KEY (`ticket_id`) REFERENCES `support_tickets` (`id`) ON DELETE CASCADE,
  CONSTRAINT `ticket_messages_ibfk_2` FOREIGN KEY (`sender_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: token_packages
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:56:22 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	package_name	varchar(100)	NO	NULL			utf8mb4_unicode_ci	
3	tokens_amount	decimal(20,2)	NO	NULL				
4	bonus_tokens	decimal(20,2)	YES	0.00				
5	price_usd	decimal(10,2)	NO	NULL				
6	discount_percentage	int	YES	0				
7	payment_methods	json	YES	NULL				
8	icon_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
9	ribbon_text	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
10	is_featured	tinyint(1)	YES	0		MUL		
11	is_limited	tinyint(1)	YES	0				
12	max_purchases_per_user	int	YES	NULL				
13	valid_from	timestamp	YES	NULL				
14	valid_until	timestamp	YES	NULL				
15	sort_order	int	YES	0				
16	is_active	tinyint(1)	YES	1		MUL		
17	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_active	NON_UNIQUE	BTREE	is_active	0
idx_featured	NON_UNIQUE	BTREE	is_featured	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `token_packages` (
  `id` int NOT NULL AUTO_INCREMENT,
  `package_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `tokens_amount` decimal(20,2) NOT NULL,
  `bonus_tokens` decimal(20,2) DEFAULT '0.00',
  `price_usd` decimal(10,2) NOT NULL,
  `discount_percentage` int DEFAULT '0',
  `payment_methods` json DEFAULT NULL,
  `icon_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ribbon_text` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_featured` tinyint(1) DEFAULT '0',
  `is_limited` tinyint(1) DEFAULT '0',
  `max_purchases_per_user` int DEFAULT NULL,
  `valid_from` timestamp NULL DEFAULT NULL,
  `valid_until` timestamp NULL DEFAULT NULL,
  `sort_order` int DEFAULT '0',
  `is_active` tinyint(1) DEFAULT '1',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_featured` (`is_featured`),
  KEY `idx_active` (`is_active`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: token_transactions
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:56:36 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	transaction_type	enum('deposit','withdrawal','bet','win','bonus','cashback','transfer','refund')	NO	NULL		MUL	utf8mb4_unicode_ci	
4	amount	decimal(20,2)	NO	NULL				
5	balance_before	decimal(20,2)	NO	NULL				
6	balance_after	decimal(20,2)	NO	NULL				
7	reference_type	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
8	reference_id	int	YES	NULL				
9	payment_method	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
10	payment_details	json	YES	NULL				
11	transaction_hash	varchar(255)	YES	NULL			utf8mb4_unicode_ci	
12	status	enum('pending','completed','failed','cancelled')	YES	pending		MUL	utf8mb4_unicode_ci	
13	ip_address	varchar(45)	YES	NULL			utf8mb4_unicode_ci	
14	device_info	json	YES	NULL				
15	notes	text	YES	NULL			utf8mb4_unicode_ci	
16	processed_at	timestamp	YES	NULL				
17	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED	MUL		

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_created	NON_UNIQUE	BTREE	created_at	0
idx_status	NON_UNIQUE	BTREE	status	0
idx_type	NON_UNIQUE	BTREE	transaction_type	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
token_transactions_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `token_transactions` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `transaction_type` enum('deposit','withdrawal','bet','win','bonus','cashback','transfer','refund') COLLATE utf8mb4_unicode_ci NOT NULL,
  `amount` decimal(20,2) NOT NULL,
  `balance_before` decimal(20,2) NOT NULL,
  `balance_after` decimal(20,2) NOT NULL,
  `reference_type` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `reference_id` int DEFAULT NULL,
  `payment_method` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `payment_details` json DEFAULT NULL,
  `transaction_hash` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` enum('pending','completed','failed','cancelled') COLLATE utf8mb4_unicode_ci DEFAULT 'pending',
  `ip_address` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `device_info` json DEFAULT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `processed_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_type` (`transaction_type`),
  KEY `idx_status` (`status`),
  KEY `idx_created` (`created_at`),
  CONSTRAINT `token_transactions_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: tournament_participants
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:42:52 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	tournament_id	int	NO	NULL		MUL		
3	user_id	int	NO	NULL		MUL		
4	team_id	int	YES	NULL				
5	seed_number	int	YES	NULL				
6	current_round	int	YES	1				
7	score	int	YES	0				
8	wins	int	YES	0				
9	losses	int	YES	0				
10	position	int	YES	NULL		MUL		
11	eliminated	tinyint(1)	YES	0				
12	joined_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_position	NON_UNIQUE	BTREE	position	0
idx_tournament	NON_UNIQUE	BTREE	tournament_id	0
idx_user	NON_UNIQUE	BTREE	user_id	0
unique_tournament_user	UNIQUE	BTREE	tournament_id, user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
tournament_participants_ibfk_1	tournament_id	tournaments	id	NO ACTION	NO ACTION
tournament_participants_ibfk_2	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `tournament_participants` (
  `id` int NOT NULL AUTO_INCREMENT,
  `tournament_id` int NOT NULL,
  `user_id` int NOT NULL,
  `team_id` int DEFAULT NULL,
  `seed_number` int DEFAULT NULL,
  `current_round` int DEFAULT '1',
  `score` int DEFAULT '0',
  `wins` int DEFAULT '0',
  `losses` int DEFAULT '0',
  `position` int DEFAULT NULL,
  `eliminated` tinyint(1) DEFAULT '0',
  `joined_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_tournament_user` (`tournament_id`,`user_id`),
  KEY `idx_tournament` (`tournament_id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_position` (`position`),
  CONSTRAINT `tournament_participants_ibfk_1` FOREIGN KEY (`tournament_id`) REFERENCES `tournaments` (`id`),
  CONSTRAINT `tournament_participants_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: tournament_registrations
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:58:41 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	tournament_id	int	NO	NULL		MUL		
3	user_id	int	NO	NULL		MUL		
4	buy_in_paid	decimal(20,2)	YES	0.00				
5	rebuys	int	YES	0				
6	addons	int	YES	0				
7	total_invested	decimal(20,2)	YES	0.00				
8	chips_count	int	YES	NULL				
9	table_number	int	YES	NULL				
10	seat_number	int	YES	NULL				
11	position	int	YES	NULL				
12	prize_won	decimal(20,2)	YES	0.00				
13	status	enum('registered','playing','eliminated','winner','no_show')	YES	registered		MUL	utf8mb4_unicode_ci	
14	eliminated_at	timestamp	YES	NULL				
15	registered_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_status	NON_UNIQUE	BTREE	status	0
idx_tournament	NON_UNIQUE	BTREE	tournament_id	0
idx_user	NON_UNIQUE	BTREE	user_id	0
unique_tournament_user	UNIQUE	BTREE	tournament_id, user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
tournament_registrations_ibfk_1	tournament_id	game_tournaments	id	NO ACTION	NO ACTION
tournament_registrations_ibfk_2	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `tournament_registrations` (
  `id` int NOT NULL AUTO_INCREMENT,
  `tournament_id` int NOT NULL,
  `user_id` int NOT NULL,
  `buy_in_paid` decimal(20,2) DEFAULT '0.00',
  `rebuys` int DEFAULT '0',
  `addons` int DEFAULT '0',
  `total_invested` decimal(20,2) DEFAULT '0.00',
  `chips_count` int DEFAULT NULL,
  `table_number` int DEFAULT NULL,
  `seat_number` int DEFAULT NULL,
  `position` int DEFAULT NULL,
  `prize_won` decimal(20,2) DEFAULT '0.00',
  `status` enum('registered','playing','eliminated','winner','no_show') COLLATE utf8mb4_unicode_ci DEFAULT 'registered',
  `eliminated_at` timestamp NULL DEFAULT NULL,
  `registered_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_tournament_user` (`tournament_id`,`user_id`),
  KEY `idx_tournament` (`tournament_id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_status` (`status`),
  CONSTRAINT `tournament_registrations_ibfk_1` FOREIGN KEY (`tournament_id`) REFERENCES `game_tournaments` (`id`),
  CONSTRAINT `tournament_registrations_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: tournaments
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:42:33 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	name	varchar(100)	NO	NULL			utf8mb4_unicode_ci	
3	description	text	YES	NULL			utf8mb4_unicode_ci	
4	tournament_type	enum('bracket','points','survival','team')	NO	NULL			utf8mb4_unicode_ci	
5	game_mode	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
6	banner_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
7	entry_fee_coins	int	YES	0				
8	prize_pool	json	YES	NULL				
9	max_participants	int	NO	NULL				
10	current_participants	int	YES	0				
11	min_level	int	YES	1				
12	start_date	timestamp	NO	NULL		MUL		
13	end_date	timestamp	NO	NULL				
14	registration_deadline	timestamp	NO	NULL				
15	status	enum('upcoming','registration','ongoing','finished','cancelled')	YES	upcoming		MUL	utf8mb4_unicode_ci	
16	rules	json	YES	NULL				
17	created_by	int	YES	NULL		MUL		
18	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
19	updated_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
created_by	NON_UNIQUE	BTREE	created_by	0
idx_dates	NON_UNIQUE	BTREE	start_date, end_date	0
idx_status	NON_UNIQUE	BTREE	status	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
tournaments_ibfk_1	created_by	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `tournaments` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `tournament_type` enum('bracket','points','survival','team') COLLATE utf8mb4_unicode_ci NOT NULL,
  `game_mode` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `banner_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `entry_fee_coins` int DEFAULT '0',
  `prize_pool` json DEFAULT NULL,
  `max_participants` int NOT NULL,
  `current_participants` int DEFAULT '0',
  `min_level` int DEFAULT '1',
  `start_date` timestamp NOT NULL,
  `end_date` timestamp NOT NULL,
  `registration_deadline` timestamp NOT NULL,
  `status` enum('upcoming','registration','ongoing','finished','cancelled') COLLATE utf8mb4_unicode_ci DEFAULT 'upcoming',
  `rules` json DEFAULT NULL,
  `created_by` int DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_status` (`status`),
  KEY `idx_dates` (`start_date`,`end_date`),
  KEY `created_by` (`created_by`),
  CONSTRAINT `tournaments_ibfk_1` FOREIGN KEY (`created_by`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: translation_cache
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-07 01:09:42 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	source_text	text	NO	NULL			utf8mb4_unicode_ci	
3	source_lang	varchar(10)	NO	NULL		MUL	utf8mb4_unicode_ci	
4	target_lang	varchar(10)	NO	NULL			utf8mb4_unicode_ci	
5	translated_text	text	NO	NULL			utf8mb4_unicode_ci	
6	usage_count	int	YES	1		MUL		
7	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
8	last_used	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_langs	NON_UNIQUE	BTREE	source_lang, target_lang	0
idx_usage	NON_UNIQUE	BTREE	usage_count	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `translation_cache` (
  `id` int NOT NULL AUTO_INCREMENT,
  `source_text` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `source_lang` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
  `target_lang` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
  `translated_text` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `usage_count` int DEFAULT '1',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `last_used` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_langs` (`source_lang`,`target_lang`),
  KEY `idx_usage` (`usage_count`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: trending_topics
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:27:53 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	topic_name	varchar(100)	NO	NULL		MUL	utf8mb4_unicode_ci	
3	topic_type	enum('hashtag','keyword','entity','event')	YES	hashtag			utf8mb4_unicode_ci	
4	country_code	varchar(2)	YES	NULL		MUL	utf8mb4_unicode_ci	
5	region	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
6	chirp_count	int	YES	0		MUL		
7	user_count	int	YES	0				
8	impressions	bigint	YES	0				
9	growth_rate	decimal(10,4)	YES	NULL				
10	peak_position	int	YES	NULL				
11	category	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
12	related_topics	json	YES	NULL				
13	is_promoted	tinyint(1)	YES	0				
14	started_trending	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
15	last_updated	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_chirp_count	NON_UNIQUE	BTREE	chirp_count	0
idx_country	NON_UNIQUE	BTREE	country_code	0
idx_topic	NON_UNIQUE	BTREE	topic_name	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `trending_topics` (
  `id` int NOT NULL AUTO_INCREMENT,
  `topic_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `topic_type` enum('hashtag','keyword','entity','event') COLLATE utf8mb4_unicode_ci DEFAULT 'hashtag',
  `country_code` varchar(2) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `region` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `chirp_count` int DEFAULT '0',
  `user_count` int DEFAULT '0',
  `impressions` bigint DEFAULT '0',
  `growth_rate` decimal(10,4) DEFAULT NULL,
  `peak_position` int DEFAULT NULL,
  `category` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `related_topics` json DEFAULT NULL,
  `is_promoted` tinyint(1) DEFAULT '0',
  `started_trending` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `last_updated` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_topic` (`topic_name`),
  KEY `idx_country` (`country_code`),
  KEY `idx_chirp_count` (`chirp_count` DESC)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: unified_customers
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:53:41 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	master_customer_id	varchar(100)	NO	NULL		UNI	utf8mb4_unicode_ci	
3	email	varchar(200)	NO	NULL		MUL	utf8mb4_unicode_ci	
4	phone	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
5	platform_ids	json	YES	NULL				
6	merged_from	json	YES	NULL				
7	total_orders	int	YES	0				
8	total_spent	decimal(20,2)	YES	0.00				
9	average_order_value	decimal(12,2)	YES	0.00				
10	lifetime_value	decimal(20,2)	YES	0.00		MUL		
11	first_purchase_date	date	YES	NULL				
12	last_purchase_date	date	YES	NULL				
13	preferred_platform	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
14	tags	json	YES	NULL				
15	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
16	updated_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_email	NON_UNIQUE	BTREE	email	0
idx_ltv	NON_UNIQUE	BTREE	lifetime_value	0
master_customer_id	UNIQUE	BTREE	master_customer_id	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `unified_customers` (
  `id` int NOT NULL AUTO_INCREMENT,
  `master_customer_id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `phone` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `platform_ids` json DEFAULT NULL,
  `merged_from` json DEFAULT NULL,
  `total_orders` int DEFAULT '0',
  `total_spent` decimal(20,2) DEFAULT '0.00',
  `average_order_value` decimal(12,2) DEFAULT '0.00',
  `lifetime_value` decimal(20,2) DEFAULT '0.00',
  `first_purchase_date` date DEFAULT NULL,
  `last_purchase_date` date DEFAULT NULL,
  `preferred_platform` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tags` json DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `master_customer_id` (`master_customer_id`),
  KEY `idx_email` (`email`),
  KEY `idx_ltv` (`lifetime_value`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: unified_feed
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:31:20 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	content_type	varchar(50)	NO	NULL		MUL	utf8mb4_unicode_ci	
4	content_id	bigint	NO	NULL				
5	source_platform	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
6	score	decimal(10,4)	YES	0.0000		MUL		
7	impression_time	timestamp	YES	NULL				
8	interaction_type	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
9	interaction_time	timestamp	YES	NULL				
10	time_spent_seconds	int	YES	0				
11	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_content	NON_UNIQUE	BTREE	content_type, content_id	0
idx_score	NON_UNIQUE	BTREE	score	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
unified_feed_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `unified_feed` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `content_type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `content_id` bigint NOT NULL,
  `source_platform` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `score` decimal(10,4) DEFAULT '0.0000',
  `impression_time` timestamp NULL DEFAULT NULL,
  `interaction_type` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `interaction_time` timestamp NULL DEFAULT NULL,
  `time_spent_seconds` int DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_content` (`content_type`,`content_id`),
  KEY `idx_score` (`score`),
  CONSTRAINT `unified_feed_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: unified_inventory
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:53:41 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	master_sku	varchar(100)	NO	NULL		UNI	utf8mb4_unicode_ci	
3	product_name	varchar(500)	NO	NULL			utf8mb4_unicode_ci	
4	platform_skus	json	YES	NULL				
5	total_quantity	int	YES	0				
6	reserved_quantity	int	YES	0				
7	available_quantity	int	YES	NULL	STORED GENERATED	MUL		
8	platform_quantities	json	YES	NULL				
9	sync_status	json	YES	NULL				
10	last_updated	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_available	NON_UNIQUE	BTREE	available_quantity	0
idx_sku	NON_UNIQUE	BTREE	master_sku	0
master_sku	UNIQUE	BTREE	master_sku	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `unified_inventory` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `master_sku` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `product_name` varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL,
  `platform_skus` json DEFAULT NULL,
  `total_quantity` int DEFAULT '0',
  `reserved_quantity` int DEFAULT '0',
  `available_quantity` int GENERATED ALWAYS AS ((`total_quantity` - `reserved_quantity`)) STORED,
  `platform_quantities` json DEFAULT NULL,
  `sync_status` json DEFAULT NULL,
  `last_updated` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `master_sku` (`master_sku`),
  KEY `idx_sku` (`master_sku`),
  KEY `idx_available` (`available_quantity`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: unified_points_system
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 03:05:09 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	points_type	enum('xp','coins','tokens','diamonds','vip_points','cash')	NO	NULL			utf8mb4_unicode_ci	
4	current_balance	decimal(20,2)	YES	0.00				
5	lifetime_earned	decimal(20,2)	YES	0.00				
6	lifetime_spent	decimal(20,2)	YES	0.00				
7	conversion_rates	json	YES	NULL				
8	last_updated	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_user	NON_UNIQUE	BTREE	user_id	0
unique_user_type	UNIQUE	BTREE	user_id, points_type	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
unified_points_system_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `unified_points_system` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `points_type` enum('xp','coins','tokens','diamonds','vip_points','cash') COLLATE utf8mb4_unicode_ci NOT NULL,
  `current_balance` decimal(20,2) DEFAULT '0.00',
  `lifetime_earned` decimal(20,2) DEFAULT '0.00',
  `lifetime_spent` decimal(20,2) DEFAULT '0.00',
  `conversion_rates` json DEFAULT NULL,
  `last_updated` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_user_type` (`user_id`,`points_type`),
  KEY `idx_user` (`user_id`),
  CONSTRAINT `unified_points_system_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: universal_matchmaking
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 03:05:34 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	match_type	enum('video_chat','game_pvp','tournament','live_battle','voice_room','dating')	NO	NULL		MUL	utf8mb4_unicode_ci	
4	preferences	json	YES	NULL				
5	skill_rating	int	YES	1000		MUL		
6	waiting_since	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
7	matched_with	int	YES	NULL		MUL		
8	match_quality_score	decimal(5,2)	YES	NULL				
9	is_matched	tinyint(1)	YES	0				

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_skill	NON_UNIQUE	BTREE	skill_rating	0
idx_type_waiting	NON_UNIQUE	BTREE	match_type, waiting_since	0
idx_user	NON_UNIQUE	BTREE	user_id	0
matched_with	NON_UNIQUE	BTREE	matched_with	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
universal_matchmaking_ibfk_1	user_id	users	id	NO ACTION	NO ACTION
universal_matchmaking_ibfk_2	matched_with	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `universal_matchmaking` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `match_type` enum('video_chat','game_pvp','tournament','live_battle','voice_room','dating') COLLATE utf8mb4_unicode_ci NOT NULL,
  `preferences` json DEFAULT NULL,
  `skill_rating` int DEFAULT '1000',
  `waiting_since` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `matched_with` int DEFAULT NULL,
  `match_quality_score` decimal(5,2) DEFAULT NULL,
  `is_matched` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `idx_type_waiting` (`match_type`,`waiting_since`),
  KEY `idx_user` (`user_id`),
  KEY `idx_skill` (`skill_rating`),
  KEY `matched_with` (`matched_with`),
  CONSTRAINT `universal_matchmaking_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
  CONSTRAINT `universal_matchmaking_ibfk_2` FOREIGN KEY (`matched_with`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: universal_reactions
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:31:20 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	content_type	varchar(50)	NO	NULL		MUL	utf8mb4_unicode_ci	
4	content_id	bigint	NO	NULL				
5	reaction_type	varchar(50)	NO	NULL			utf8mb4_unicode_ci	
6	reaction_value	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
7	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_content	NON_UNIQUE	BTREE	content_type, content_id	0
idx_user	NON_UNIQUE	BTREE	user_id	0
unique_reaction	UNIQUE	BTREE	user_id, content_type, content_id, reaction_type	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
universal_reactions_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `universal_reactions` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `content_type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `content_id` bigint NOT NULL,
  `reaction_type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `reaction_value` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_reaction` (`user_id`,`content_type`,`content_id`,`reaction_type`),
  KEY `idx_user` (`user_id`),
  KEY `idx_content` (`content_type`,`content_id`),
  CONSTRAINT `universal_reactions_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: universal_search
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:13:51 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	entity_type	varchar(50)	NO	NULL		MUL	utf8mb4_unicode_ci	
3	entity_id	int	NO	NULL				
4	title	varchar(500)	YES	NULL		MUL	utf8mb4_unicode_ci	
5	description	text	YES	NULL			utf8mb4_unicode_ci	
6	tags	json	YES	NULL				
7	category	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
8	thumbnail_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
9	url_path	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
10	search_text	text	YES	NULL			utf8mb4_unicode_ci	
11	popularity_score	int	YES	0		MUL		
12	relevance_score	decimal(10,4)	YES	0.0000				
13	is_active	tinyint(1)	YES	1				
14	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
15	updated_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_entity	NON_UNIQUE	BTREE	entity_type, entity_id	0
idx_popularity	NON_UNIQUE	BTREE	popularity_score	0
idx_search	NON_UNIQUE	FULLTEXT	title, description, search_text	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `universal_search` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `entity_type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `entity_id` int NOT NULL,
  `title` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `tags` json DEFAULT NULL,
  `category` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `thumbnail_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `url_path` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `search_text` text COLLATE utf8mb4_unicode_ci,
  `popularity_score` int DEFAULT '0',
  `relevance_score` decimal(10,4) DEFAULT '0.0000',
  `is_active` tinyint(1) DEFAULT '1',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_entity` (`entity_type`,`entity_id`),
  KEY `idx_popularity` (`popularity_score`),
  FULLTEXT KEY `idx_search` (`title`,`description`,`search_text`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: user_ab_tests
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:13:51 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	test_id	int	NO	NULL		MUL		
4	variant	varchar(50)	NO	NULL		MUL	utf8mb4_unicode_ci	
5	exposed_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
6	converted	tinyint(1)	YES	0				
7	conversion_value	decimal(20,2)	YES	NULL				
8	interactions	json	YES	NULL				

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_test	NON_UNIQUE	BTREE	test_id	0
idx_user	NON_UNIQUE	BTREE	user_id	0
idx_variant	NON_UNIQUE	BTREE	variant	0
unique_user_test	UNIQUE	BTREE	user_id, test_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
user_ab_tests_ibfk_1	user_id	users	id	NO ACTION	NO ACTION
user_ab_tests_ibfk_2	test_id	ab_testing	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `user_ab_tests` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `test_id` int NOT NULL,
  `variant` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `exposed_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `converted` tinyint(1) DEFAULT '0',
  `conversion_value` decimal(20,2) DEFAULT NULL,
  `interactions` json DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_user_test` (`user_id`,`test_id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_test` (`test_id`),
  KEY `idx_variant` (`variant`),
  CONSTRAINT `user_ab_tests_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
  CONSTRAINT `user_ab_tests_ibfk_2` FOREIGN KEY (`test_id`) REFERENCES `ab_testing` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: user_achievements
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-07 01:09:42 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	achievement_id	int	NO	NULL		MUL		
4	progress	int	YES	0				
5	completed	tinyint(1)	YES	0		MUL		
6	unlocked_at	timestamp	YES	NULL				
7	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
achievement_id	NON_UNIQUE	BTREE	achievement_id	0
idx_completed	NON_UNIQUE	BTREE	completed	0
idx_user_id	NON_UNIQUE	BTREE	user_id	0
unique_user_achievement	UNIQUE	BTREE	user_id, achievement_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
user_achievements_ibfk_1	user_id	users	id	NO ACTION	CASCADE
user_achievements_ibfk_2	achievement_id	achievements	id	NO ACTION	CASCADE

--- SHOW CREATE TABLE ---
CREATE TABLE `user_achievements` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `achievement_id` int NOT NULL,
  `progress` int DEFAULT '0',
  `completed` tinyint(1) DEFAULT '0',
  `unlocked_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_user_achievement` (`user_id`,`achievement_id`),
  KEY `achievement_id` (`achievement_id`),
  KEY `idx_user_id` (`user_id`),
  KEY `idx_completed` (`completed`),
  CONSTRAINT `user_achievements_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  CONSTRAINT `user_achievements_ibfk_2` FOREIGN KEY (`achievement_id`) REFERENCES `achievements` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: user_activity_logs
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 2 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-04 00:00:20 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	YES	NULL		MUL		
3	action	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
4	details	json	YES	NULL				
5	ip_address	varchar(45)	YES	NULL			utf8mb4_unicode_ci	
6	user_agent	varchar(255)	YES	NULL			utf8mb4_unicode_ci	
7	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED	MUL		

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_created	NON_UNIQUE	BTREE	created_at	0
idx_user_action	NON_UNIQUE	BTREE	user_id, action	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `user_activity_logs` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int DEFAULT NULL,
  `action` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `details` json DEFAULT NULL,
  `ip_address` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_agent` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_user_action` (`user_id`,`action`),
  KEY `idx_created` (`created_at`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: user_backgrounds
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.02 | TOTAL_MB: 0.03 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_0900_ai_ci | CREATE: 2025-08-05 23:28:33 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	YES	NULL		MUL		
3	background_url	varchar(255)	YES	NULL			utf8mb4_0900_ai_ci	
4	is_active	tinyint(1)	YES	0				
5	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
user_id	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
user_backgrounds_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `user_backgrounds` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int DEFAULT NULL,
  `background_url` varchar(255) DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  CONSTRAINT `user_backgrounds_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;


============================================================
TABLE: user_badges
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.02 | TOTAL_MB: 0.03 | AUTO_INCREMENT: 2 | COLLATION: utf8mb4_0900_ai_ci | CREATE: 2025-08-04 01:43:53 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	badge_type	varchar(50)	NO	NULL			utf8mb4_0900_ai_ci	
4	earned_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
unique_user_badge	UNIQUE	BTREE	user_id, badge_type	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
user_badges_ibfk_1	user_id	users	id	NO ACTION	CASCADE

--- SHOW CREATE TABLE ---
CREATE TABLE `user_badges` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `badge_type` varchar(50) NOT NULL,
  `earned_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_user_badge` (`user_id`,`badge_type`),
  CONSTRAINT `user_badges_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;


============================================================
TABLE: user_behavior_tracking
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 16:03:29 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	session_id	varchar(100)	NO	NULL		MUL	utf8mb4_unicode_ci	
4	event_type	varchar(100)	NO	NULL		MUL	utf8mb4_unicode_ci	
5	event_category	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
6	event_action	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
7	event_label	varchar(200)	YES	NULL			utf8mb4_unicode_ci	
8	event_value	decimal(20,4)	YES	NULL				
9	page_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
10	referrer_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
11	utm_source	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
12	utm_medium	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
13	utm_campaign	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
14	device_type	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
15	device_brand	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
16	device_model	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
17	os	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
18	os_version	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
19	browser	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
20	browser_version	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
21	screen_resolution	varchar(20)	YES	NULL			utf8mb4_unicode_ci	
22	viewport_size	varchar(20)	YES	NULL			utf8mb4_unicode_ci	
23	ip_address	varchar(45)	YES	NULL			utf8mb4_unicode_ci	
24	country	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
25	region	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
26	city	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
27	latitude	decimal(10,8)	YES	NULL				
28	longitude	decimal(11,8)	YES	NULL				
29	connection_type	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
30	page_load_time_ms	int	YES	NULL				
31	dom_ready_time_ms	int	YES	NULL				
32	time_on_page_seconds	int	YES	NULL				
33	scroll_depth_percentage	int	YES	NULL				
34	clicks_count	int	YES	NULL				
35	form_interactions	int	YES	NULL				
36	video_watch_percentage	decimal(5,2)	YES	NULL				
37	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED	MUL		

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_created	NON_UNIQUE	BTREE	created_at	0
idx_event	NON_UNIQUE	BTREE	event_type	0
idx_session	NON_UNIQUE	BTREE	session_id	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
user_behavior_tracking_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `user_behavior_tracking` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `session_id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `event_type` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `event_category` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `event_action` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `event_label` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `event_value` decimal(20,4) DEFAULT NULL,
  `page_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `referrer_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `utm_source` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `utm_medium` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `utm_campaign` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `device_type` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `device_brand` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `device_model` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `os` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `os_version` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `browser` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `browser_version` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `screen_resolution` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `viewport_size` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ip_address` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `country` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `region` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `city` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `latitude` decimal(10,8) DEFAULT NULL,
  `longitude` decimal(11,8) DEFAULT NULL,
  `connection_type` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `page_load_time_ms` int DEFAULT NULL,
  `dom_ready_time_ms` int DEFAULT NULL,
  `time_on_page_seconds` int DEFAULT NULL,
  `scroll_depth_percentage` int DEFAULT NULL,
  `clicks_count` int DEFAULT NULL,
  `form_interactions` int DEFAULT NULL,
  `video_watch_percentage` decimal(5,2) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_session` (`session_id`),
  KEY `idx_event` (`event_type`),
  KEY `idx_created` (`created_at`),
  CONSTRAINT `user_behavior_tracking_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: user_blocks
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 2 | COLLATION: utf8mb4_0900_ai_ci | CREATE: 2025-08-04 01:43:53 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	blocker_id	int	NO	NULL		MUL		
3	blocked_id	int	NO	NULL		MUL		
4	reason	varchar(255)	YES	NULL			utf8mb4_0900_ai_ci	
5	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
blocked_id	NON_UNIQUE	BTREE	blocked_id	0
unique_block	UNIQUE	BTREE	blocker_id, blocked_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
user_blocks_ibfk_1	blocker_id	users	id	NO ACTION	CASCADE
user_blocks_ibfk_2	blocked_id	users	id	NO ACTION	CASCADE

--- SHOW CREATE TABLE ---
CREATE TABLE `user_blocks` (
  `id` int NOT NULL AUTO_INCREMENT,
  `blocker_id` int NOT NULL,
  `blocked_id` int NOT NULL,
  `reason` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_block` (`blocker_id`,`blocked_id`),
  KEY `blocked_id` (`blocked_id`),
  CONSTRAINT `user_blocks_ibfk_1` FOREIGN KEY (`blocker_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  CONSTRAINT `user_blocks_ibfk_2` FOREIGN KEY (`blocked_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;


============================================================
TABLE: user_bonuses
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 03:00:05 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	campaign_id	int	NO	NULL		MUL		
4	bonus_amount	decimal(20,2)	NO	NULL				
5	wagering_requirement	decimal(20,2)	NO	NULL				
6	wagered_amount	decimal(20,2)	YES	0.00				
7	winnings_amount	decimal(20,2)	YES	0.00				
8	status	enum('pending','active','completed','expired','cancelled','forfeited')	YES	pending		MUL	utf8mb4_unicode_ci	
9	activated_at	timestamp	YES	NULL				
10	expires_at	timestamp	YES	NULL				
11	completed_at	timestamp	YES	NULL				
12	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_campaign	NON_UNIQUE	BTREE	campaign_id	0
idx_status	NON_UNIQUE	BTREE	status	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
user_bonuses_ibfk_1	user_id	users	id	NO ACTION	NO ACTION
user_bonuses_ibfk_2	campaign_id	bonus_campaigns	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `user_bonuses` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `campaign_id` int NOT NULL,
  `bonus_amount` decimal(20,2) NOT NULL,
  `wagering_requirement` decimal(20,2) NOT NULL,
  `wagered_amount` decimal(20,2) DEFAULT '0.00',
  `winnings_amount` decimal(20,2) DEFAULT '0.00',
  `status` enum('pending','active','completed','expired','cancelled','forfeited') COLLATE utf8mb4_unicode_ci DEFAULT 'pending',
  `activated_at` timestamp NULL DEFAULT NULL,
  `expires_at` timestamp NULL DEFAULT NULL,
  `completed_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_campaign` (`campaign_id`),
  KEY `idx_status` (`status`),
  CONSTRAINT `user_bonuses_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
  CONSTRAINT `user_bonuses_ibfk_2` FOREIGN KEY (`campaign_id`) REFERENCES `bonus_campaigns` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: user_compatibility_answers
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:12:06 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	question_id	int	NO	NULL		MUL		
4	answer_value	text	YES	NULL			utf8mb4_unicode_ci	
5	acceptable_answers	json	YES	NULL				
6	importance_to_user	enum('irrelevant','nice_to_have','important','mandatory')	YES	nice_to_have			utf8mb4_unicode_ci	
7	is_public	tinyint(1)	YES	1				
8	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
9	updated_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_question	NON_UNIQUE	BTREE	question_id	0
idx_user	NON_UNIQUE	BTREE	user_id	0
unique_answer	UNIQUE	BTREE	user_id, question_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
user_compatibility_answers_ibfk_1	user_id	users	id	NO ACTION	NO ACTION
user_compatibility_answers_ibfk_2	question_id	compatibility_questions	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `user_compatibility_answers` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `question_id` int NOT NULL,
  `answer_value` text COLLATE utf8mb4_unicode_ci,
  `acceptable_answers` json DEFAULT NULL,
  `importance_to_user` enum('irrelevant','nice_to_have','important','mandatory') COLLATE utf8mb4_unicode_ci DEFAULT 'nice_to_have',
  `is_public` tinyint(1) DEFAULT '1',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_answer` (`user_id`,`question_id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_question` (`question_id`),
  CONSTRAINT `user_compatibility_answers_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
  CONSTRAINT `user_compatibility_answers_ibfk_2` FOREIGN KEY (`question_id`) REFERENCES `compatibility_questions` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: user_complete_analytics
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 16:03:29 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		UNI		
3	registration_date	timestamp	YES	NULL				
4	last_login	timestamp	YES	NULL				
5	total_logins	int	YES	0				
6	total_time_spent_minutes	bigint	YES	0				
7	average_session_duration	int	YES	0				
8	devices_used	json	YES	NULL				
9	browsers_used	json	YES	NULL				
10	ip_addresses	json	YES	NULL				
11	locations	json	YES	NULL				
12	pages_visited	int	YES	0				
13	actions_performed	int	YES	0				
14	features_used	json	YES	NULL				
15	click_heatmap	json	YES	NULL				
16	scroll_depth_average	decimal(5,2)	YES	NULL				
17	bounce_rate	decimal(5,2)	YES	NULL				
18	total_spent	decimal(20,2)	YES	0.00				
19	total_earned	decimal(20,2)	YES	0.00				
20	total_orders	int	YES	0				
21	average_order_value	decimal(12,2)	YES	0.00				
22	lifetime_value	decimal(20,2)	YES	0.00		MUL		
23	payment_methods_used	json	YES	NULL				
24	refunds_requested	int	YES	0				
25	chargebacks	int	YES	0				
26	products_viewed	int	YES	0				
27	products_purchased	int	YES	0				
28	products_reviewed	int	YES	0				
29	cart_abandonment_count	int	YES	0				
30	wishlist_items	int	YES	0				
31	posts_created	int	YES	0				
32	comments_made	int	YES	0				
33	likes_given	int	YES	0				
34	likes_received	int	YES	0				
35	followers_count	int	YES	0				
36	following_count	int	YES	0				
37	messages_sent	int	YES	0				
38	messages_received	int	YES	0				
39	games_played	int	YES	0				
40	total_wagered	decimal(20,2)	YES	0.00				
41	total_won	decimal(20,2)	YES	0.00				
42	win_rate	decimal(5,2)	YES	0.00				
43	videos_uploaded	int	YES	0				
44	videos_watched	int	YES	0				
45	streams_created	int	YES	0				
46	streams_watched	int	YES	0				
47	files_uploaded	int	YES	0				
48	storage_used_mb	bigint	YES	0				
49	risk_score	decimal(5,2)	YES	0.00		MUL		
50	fraud_probability	decimal(5,4)	YES	0.0000				
51	kyc_status	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
52	aml_flags	json	YES	NULL				
53	violations	int	YES	0				
54	warnings	int	YES	0				
55	bans	int	YES	0				
56	predicted_churn_probability	decimal(5,4)	YES	0.0000				
57	predicted_next_purchase_date	date	YES	NULL				
58	predicted_lifetime_value	decimal(20,2)	YES	0.00				
59	ai_segment	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
60	ai_recommendations	json	YES	NULL				
61	last_updated	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_ltv	NON_UNIQUE	BTREE	lifetime_value	0
idx_risk	NON_UNIQUE	BTREE	risk_score	0
idx_user	NON_UNIQUE	BTREE	user_id	0
unique_user	UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
user_complete_analytics_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `user_complete_analytics` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `registration_date` timestamp NULL DEFAULT NULL,
  `last_login` timestamp NULL DEFAULT NULL,
  `total_logins` int DEFAULT '0',
  `total_time_spent_minutes` bigint DEFAULT '0',
  `average_session_duration` int DEFAULT '0',
  `devices_used` json DEFAULT NULL,
  `browsers_used` json DEFAULT NULL,
  `ip_addresses` json DEFAULT NULL,
  `locations` json DEFAULT NULL,
  `pages_visited` int DEFAULT '0',
  `actions_performed` int DEFAULT '0',
  `features_used` json DEFAULT NULL,
  `click_heatmap` json DEFAULT NULL,
  `scroll_depth_average` decimal(5,2) DEFAULT NULL,
  `bounce_rate` decimal(5,2) DEFAULT NULL,
  `total_spent` decimal(20,2) DEFAULT '0.00',
  `total_earned` decimal(20,2) DEFAULT '0.00',
  `total_orders` int DEFAULT '0',
  `average_order_value` decimal(12,2) DEFAULT '0.00',
  `lifetime_value` decimal(20,2) DEFAULT '0.00',
  `payment_methods_used` json DEFAULT NULL,
  `refunds_requested` int DEFAULT '0',
  `chargebacks` int DEFAULT '0',
  `products_viewed` int DEFAULT '0',
  `products_purchased` int DEFAULT '0',
  `products_reviewed` int DEFAULT '0',
  `cart_abandonment_count` int DEFAULT '0',
  `wishlist_items` int DEFAULT '0',
  `posts_created` int DEFAULT '0',
  `comments_made` int DEFAULT '0',
  `likes_given` int DEFAULT '0',
  `likes_received` int DEFAULT '0',
  `followers_count` int DEFAULT '0',
  `following_count` int DEFAULT '0',
  `messages_sent` int DEFAULT '0',
  `messages_received` int DEFAULT '0',
  `games_played` int DEFAULT '0',
  `total_wagered` decimal(20,2) DEFAULT '0.00',
  `total_won` decimal(20,2) DEFAULT '0.00',
  `win_rate` decimal(5,2) DEFAULT '0.00',
  `videos_uploaded` int DEFAULT '0',
  `videos_watched` int DEFAULT '0',
  `streams_created` int DEFAULT '0',
  `streams_watched` int DEFAULT '0',
  `files_uploaded` int DEFAULT '0',
  `storage_used_mb` bigint DEFAULT '0',
  `risk_score` decimal(5,2) DEFAULT '0.00',
  `fraud_probability` decimal(5,4) DEFAULT '0.0000',
  `kyc_status` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `aml_flags` json DEFAULT NULL,
  `violations` int DEFAULT '0',
  `warnings` int DEFAULT '0',
  `bans` int DEFAULT '0',
  `predicted_churn_probability` decimal(5,4) DEFAULT '0.0000',
  `predicted_next_purchase_date` date DEFAULT NULL,
  `predicted_lifetime_value` decimal(20,2) DEFAULT '0.00',
  `ai_segment` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `ai_recommendations` json DEFAULT NULL,
  `last_updated` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_user` (`user_id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_ltv` (`lifetime_value`),
  KEY `idx_risk` (`risk_score`),
  CONSTRAINT `user_complete_analytics_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: user_consents
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:13:51 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	consent_type	varchar(100)	NO	NULL		MUL	utf8mb4_unicode_ci	
4	consent_version	varchar(20)	NO	NULL			utf8mb4_unicode_ci	
5	is_granted	tinyint(1)	YES	0				
6	ip_address	varchar(45)	YES	NULL			utf8mb4_unicode_ci	
7	user_agent	text	YES	NULL			utf8mb4_unicode_ci	
8	granted_at	timestamp	YES	NULL				
9	revoked_at	timestamp	YES	NULL				
10	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_type	NON_UNIQUE	BTREE	consent_type	0
idx_user	NON_UNIQUE	BTREE	user_id	0
unique_consent	UNIQUE	BTREE	user_id, consent_type, consent_version	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
user_consents_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `user_consents` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `consent_type` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `consent_version` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `is_granted` tinyint(1) DEFAULT '0',
  `ip_address` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_agent` text COLLATE utf8mb4_unicode_ci,
  `granted_at` timestamp NULL DEFAULT NULL,
  `revoked_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_consent` (`user_id`,`consent_type`,`consent_version`),
  KEY `idx_user` (`user_id`),
  KEY `idx_type` (`consent_type`),
  CONSTRAINT `user_consents_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: user_daily_rewards
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 03:03:59 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		UNI		
3	current_streak	int	YES	0		MUL		
4	best_streak	int	YES	0				
5	last_claim_date	date	YES	NULL		MUL		
6	total_claims	int	YES	0				
7	next_reward_day	int	YES	1				
8	missed_days	int	YES	0				
9	total_rewards_value	decimal(20,2)	YES	0.00				
10	bonus_multiplier	decimal(3,2)	YES	1.00				
11	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
12	updated_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_last_claim	NON_UNIQUE	BTREE	last_claim_date	0
idx_streak	NON_UNIQUE	BTREE	current_streak	0
unique_user	UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
user_daily_rewards_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `user_daily_rewards` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `current_streak` int DEFAULT '0',
  `best_streak` int DEFAULT '0',
  `last_claim_date` date DEFAULT NULL,
  `total_claims` int DEFAULT '0',
  `next_reward_day` int DEFAULT '1',
  `missed_days` int DEFAULT '0',
  `total_rewards_value` decimal(20,2) DEFAULT '0.00',
  `bonus_multiplier` decimal(3,2) DEFAULT '1.00',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_user` (`user_id`),
  KEY `idx_streak` (`current_streak`),
  KEY `idx_last_claim` (`last_claim_date`),
  CONSTRAINT `user_daily_rewards_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: user_dashboard_basic
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 16:04:26 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		UNI		
3	profile_completion_percentage	int	YES	0				
4	account_age_days	int	YES	0				
5	verification_status	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
6	last_login	timestamp	YES	NULL				
7	total_logins	int	YES	0				
8	time_spent_today_minutes	int	YES	0				
9	friends_count	int	YES	0				
10	followers_count	int	YES	0				
11	posts_count	int	YES	0				
12	unread_messages	int	YES	0				
13	wallet_balance	decimal(12,2)	YES	0.00				
14	pending_transactions	int	YES	0				
15	achievements_unlocked	int	YES	0				
16	current_level	int	YES	1				
17	xp_points	int	YES	0				
18	last_updated	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_user	NON_UNIQUE	BTREE	user_id	0
unique_user	UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
user_dashboard_basic_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `user_dashboard_basic` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `profile_completion_percentage` int DEFAULT '0',
  `account_age_days` int DEFAULT '0',
  `verification_status` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `last_login` timestamp NULL DEFAULT NULL,
  `total_logins` int DEFAULT '0',
  `time_spent_today_minutes` int DEFAULT '0',
  `friends_count` int DEFAULT '0',
  `followers_count` int DEFAULT '0',
  `posts_count` int DEFAULT '0',
  `unread_messages` int DEFAULT '0',
  `wallet_balance` decimal(12,2) DEFAULT '0.00',
  `pending_transactions` int DEFAULT '0',
  `achievements_unlocked` int DEFAULT '0',
  `current_level` int DEFAULT '1',
  `xp_points` int DEFAULT '0',
  `last_updated` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_user` (`user_id`),
  KEY `idx_user` (`user_id`),
  CONSTRAINT `user_dashboard_basic_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: user_inventory
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.08 | TOTAL_MB: 0.09 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:43:21 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	item_id	int	NO	NULL		MUL		
4	quantity	int	YES	1				
5	acquired_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
6	expires_at	timestamp	YES	NULL		MUL		
7	is_equipped	tinyint(1)	YES	0		MUL		
8	equipped_slot	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
9	custom_data	json	YES	NULL				
10	source	enum('purchase','gift','achievement','event','trade','tournament')	YES	purchase			utf8mb4_unicode_ci	

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_equipped	NON_UNIQUE	BTREE	is_equipped	0
idx_expires	NON_UNIQUE	BTREE	expires_at	0
idx_item	NON_UNIQUE	BTREE	item_id	0
idx_user	NON_UNIQUE	BTREE	user_id	0
unique_user_item_slot	UNIQUE	BTREE	user_id, item_id, equipped_slot	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
user_inventory_ibfk_1	user_id	users	id	NO ACTION	NO ACTION
user_inventory_ibfk_2	item_id	virtual_items	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `user_inventory` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `item_id` int NOT NULL,
  `quantity` int DEFAULT '1',
  `acquired_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `expires_at` timestamp NULL DEFAULT NULL,
  `is_equipped` tinyint(1) DEFAULT '0',
  `equipped_slot` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `custom_data` json DEFAULT NULL,
  `source` enum('purchase','gift','achievement','event','trade','tournament') COLLATE utf8mb4_unicode_ci DEFAULT 'purchase',
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_user_item_slot` (`user_id`,`item_id`,`equipped_slot`),
  KEY `idx_user` (`user_id`),
  KEY `idx_item` (`item_id`),
  KEY `idx_equipped` (`is_equipped`),
  KEY `idx_expires` (`expires_at`),
  CONSTRAINT `user_inventory_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
  CONSTRAINT `user_inventory_ibfk_2` FOREIGN KEY (`item_id`) REFERENCES `virtual_items` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: user_karma
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:28:29 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		UNI		
3	post_karma	int	YES	0				
4	comment_karma	int	YES	0				
5	awardee_karma	int	YES	0				
6	awarder_karma	int	YES	0				
7	total_karma	int	YES	NULL	STORED GENERATED	MUL		
8	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
9	updated_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_total	NON_UNIQUE	BTREE	total_karma	0
unique_user	UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
user_karma_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `user_karma` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `post_karma` int DEFAULT '0',
  `comment_karma` int DEFAULT '0',
  `awardee_karma` int DEFAULT '0',
  `awarder_karma` int DEFAULT '0',
  `total_karma` int GENERATED ALWAYS AS ((((`post_karma` + `comment_karma`) + `awardee_karma`) + `awarder_karma`)) STORED,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_user` (`user_id`),
  KEY `idx_total` (`total_karma` DESC),
  CONSTRAINT `user_karma_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: user_missions
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 03:17:22 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	mission_id	int	NO	NULL		MUL		
4	progress	int	YES	0				
5	completed	tinyint(1)	YES	0		MUL		
6	claimed	tinyint(1)	YES	0				
7	started_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
8	completed_at	timestamp	YES	NULL				
9	expires_at	timestamp	YES	NULL				
10	mission_date	date	YES	NULL	STORED GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_completed	NON_UNIQUE	BTREE	completed	0
idx_mission	NON_UNIQUE	BTREE	mission_id	0
idx_user	NON_UNIQUE	BTREE	user_id	0
unique_user_mission	UNIQUE	BTREE	user_id, mission_id, mission_date	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
user_missions_ibfk_1	user_id	users	id	NO ACTION	NO ACTION
user_missions_ibfk_2	mission_id	daily_missions	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `user_missions` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `mission_id` int NOT NULL,
  `progress` int DEFAULT '0',
  `completed` tinyint(1) DEFAULT '0',
  `claimed` tinyint(1) DEFAULT '0',
  `started_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `completed_at` timestamp NULL DEFAULT NULL,
  `expires_at` timestamp NULL DEFAULT NULL,
  `mission_date` date GENERATED ALWAYS AS (cast(`started_at` as date)) STORED,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_user_mission` (`user_id`,`mission_id`,`mission_date`),
  KEY `idx_user` (`user_id`),
  KEY `idx_mission` (`mission_id`),
  KEY `idx_completed` (`completed`),
  CONSTRAINT `user_missions_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
  CONSTRAINT `user_missions_ibfk_2` FOREIGN KEY (`mission_id`) REFERENCES `daily_missions` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: user_moods
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.02 | TOTAL_MB: 0.03 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-07 01:09:42 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	mood	varchar(20)	NO	NULL			utf8mb4_unicode_ci	
4	emoji	varchar(10)	NO	NULL			utf8mb4_unicode_ci	
5	set_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
user_moods_ibfk_1	user_id	users	id	NO ACTION	CASCADE

--- SHOW CREATE TABLE ---
CREATE TABLE `user_moods` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `mood` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `emoji` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
  `set_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  CONSTRAINT `user_moods_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: user_playlists
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:45:57 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	name	varchar(100)	NO	NULL			utf8mb4_unicode_ci	
4	description	text	YES	NULL			utf8mb4_unicode_ci	
5	cover_image	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
6	playlist_type	enum('music','video','mixed')	YES	music		MUL	utf8mb4_unicode_ci	
7	items	json	YES	NULL				
8	duration_seconds	int	YES	0				
9	play_count	int	YES	0				
10	likes_count	int	YES	0				
11	is_public	tinyint(1)	YES	1		MUL		
12	is_collaborative	tinyint(1)	YES	0				
13	collaborators	json	YES	NULL				
14	tags	json	YES	NULL				
15	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
16	updated_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_public	NON_UNIQUE	BTREE	is_public	0
idx_type	NON_UNIQUE	BTREE	playlist_type	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
user_playlists_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `user_playlists` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `cover_image` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `playlist_type` enum('music','video','mixed') COLLATE utf8mb4_unicode_ci DEFAULT 'music',
  `items` json DEFAULT NULL,
  `duration_seconds` int DEFAULT '0',
  `play_count` int DEFAULT '0',
  `likes_count` int DEFAULT '0',
  `is_public` tinyint(1) DEFAULT '1',
  `is_collaborative` tinyint(1) DEFAULT '0',
  `collaborators` json DEFAULT NULL,
  `tags` json DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_type` (`playlist_type`),
  KEY `idx_public` (`is_public`),
  CONSTRAINT `user_playlists_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: user_preferences
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 2 | DATA_MB: 0.02 | INDEX_MB: 0.00 | TOTAL_MB: 0.02 | AUTO_INCREMENT: NULL | COLLATION: utf8mb4_0900_ai_ci | CREATE: 2025-08-02 18:04:05 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	user_id	int	NO	NULL		PRI		
2	auto_next	tinyint(1)	YES	0				
3	sound_notifications	tinyint(1)	YES	1				
4	blur_video	tinyint(1)	YES	0				
5	preferred_gender	enum('any','male','female')	YES	any			utf8mb4_0900_ai_ci	
6	video_quality	varchar(10)	YES	auto			utf8mb4_0900_ai_ci	

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	user_id	2

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
user_preferences_ibfk_1	user_id	users	id	NO ACTION	CASCADE

--- SHOW CREATE TABLE ---
CREATE TABLE `user_preferences` (
  `user_id` int NOT NULL,
  `auto_next` tinyint(1) DEFAULT '0',
  `sound_notifications` tinyint(1) DEFAULT '1',
  `blur_video` tinyint(1) DEFAULT '0',
  `preferred_gender` enum('any','male','female') DEFAULT 'any',
  `video_quality` varchar(10) DEFAULT 'auto',
  PRIMARY KEY (`user_id`),
  CONSTRAINT `user_preferences_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;


============================================================
TABLE: user_preferences_ml
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:13:51 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		UNI		
3	behavior_patterns	json	YES	NULL				
4	content_preferences	json	YES	NULL				
5	interaction_history	json	YES	NULL				
6	purchase_patterns	json	YES	NULL				
7	time_patterns	json	YES	NULL				
8	location_patterns	json	YES	NULL				
9	social_graph	json	YES	NULL				
10	predicted_interests	json	YES	NULL				
11	recommendation_scores	json	YES	NULL				
12	cluster_id	int	YES	NULL		MUL		
13	personality_vector	json	YES	NULL				
14	last_model_update	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_cluster	NON_UNIQUE	BTREE	cluster_id	0
idx_user	NON_UNIQUE	BTREE	user_id	0
user_id	UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
user_preferences_ml_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `user_preferences_ml` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `behavior_patterns` json DEFAULT NULL,
  `content_preferences` json DEFAULT NULL,
  `interaction_history` json DEFAULT NULL,
  `purchase_patterns` json DEFAULT NULL,
  `time_patterns` json DEFAULT NULL,
  `location_patterns` json DEFAULT NULL,
  `social_graph` json DEFAULT NULL,
  `predicted_interests` json DEFAULT NULL,
  `recommendation_scores` json DEFAULT NULL,
  `cluster_id` int DEFAULT NULL,
  `personality_vector` json DEFAULT NULL,
  `last_model_update` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_id` (`user_id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_cluster` (`cluster_id`),
  CONSTRAINT `user_preferences_ml_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: user_preferences_streaming
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:30:09 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		UNI		
3	preferred_quality	varchar(20)	YES	auto			utf8mb4_unicode_ci	
4	auto_play_next	tinyint(1)	YES	1				
5	auto_play_previews	tinyint(1)	YES	1				
6	skip_intro	tinyint(1)	YES	1				
7	subtitle_language	varchar(10)	YES	NULL			utf8mb4_unicode_ci	
8	audio_language	varchar(10)	YES	NULL			utf8mb4_unicode_ci	
9	parental_pin	varchar(10)	YES	NULL			utf8mb4_unicode_ci	
10	kids_mode	tinyint(1)	YES	0				
11	download_quality	varchar(20)	YES	medium			utf8mb4_unicode_ci	
12	download_wifi_only	tinyint(1)	YES	1				
13	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
14	updated_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_user	NON_UNIQUE	BTREE	user_id	0
user_id	UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
user_preferences_streaming_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `user_preferences_streaming` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `preferred_quality` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT 'auto',
  `auto_play_next` tinyint(1) DEFAULT '1',
  `auto_play_previews` tinyint(1) DEFAULT '1',
  `skip_intro` tinyint(1) DEFAULT '1',
  `subtitle_language` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `audio_language` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `parental_pin` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `kids_mode` tinyint(1) DEFAULT '0',
  `download_quality` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT 'medium',
  `download_wifi_only` tinyint(1) DEFAULT '1',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_id` (`user_id`),
  KEY `idx_user` (`user_id`),
  CONSTRAINT `user_preferences_streaming_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: user_profiles
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.02 | TOTAL_MB: 0.03 | AUTO_INCREMENT: NULL | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-07 00:56:54 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	user_id	int	NO	NULL		PRI		
2	display_name	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
3	birthdate	date	YES	NULL				
4	location	varchar(255)	YES	NULL			utf8mb4_unicode_ci	
5	website	varchar(255)	YES	NULL			utf8mb4_unicode_ci	
6	social_links	json	YES	NULL				
7	profile_visibility	enum('public','friends','private')	YES	public			utf8mb4_unicode_ci	
8	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
9	updated_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	user_id	0
idx_user_id	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
user_profiles_ibfk_1	user_id	users	id	NO ACTION	CASCADE

--- SHOW CREATE TABLE ---
CREATE TABLE `user_profiles` (
  `user_id` int NOT NULL,
  `display_name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `birthdate` date DEFAULT NULL,
  `location` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `website` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `social_links` json DEFAULT NULL,
  `profile_visibility` enum('public','friends','private') COLLATE utf8mb4_unicode_ci DEFAULT 'public',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`user_id`),
  KEY `idx_user_id` (`user_id`),
  CONSTRAINT `user_profiles_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: user_rankings
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:54:23 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	ranking_type	enum('global','country','weekly','monthly','streamer','spender','creator')	NO	NULL		MUL	utf8mb4_unicode_ci	
4	rank_position	int	NO	NULL				
5	score	bigint	YES	0				
6	previous_rank	int	YES	NULL				
7	best_rank	int	YES	NULL				
8	weeks_on_ranking	int	YES	1				
9	country_code	varchar(2)	YES	NULL			utf8mb4_unicode_ci	
10	period_start	date	YES	NULL		MUL		
11	period_end	date	YES	NULL				
12	rewards_claimed	tinyint(1)	YES	0				
13	updated_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_period	NON_UNIQUE	BTREE	period_start, period_end	0
idx_type_rank	NON_UNIQUE	BTREE	ranking_type, rank_position	0
idx_user	NON_UNIQUE	BTREE	user_id	0
unique_ranking	UNIQUE	BTREE	user_id, ranking_type, period_start	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
user_rankings_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `user_rankings` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `ranking_type` enum('global','country','weekly','monthly','streamer','spender','creator') COLLATE utf8mb4_unicode_ci NOT NULL,
  `rank_position` int NOT NULL,
  `score` bigint DEFAULT '0',
  `previous_rank` int DEFAULT NULL,
  `best_rank` int DEFAULT NULL,
  `weeks_on_ranking` int DEFAULT '1',
  `country_code` varchar(2) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `period_start` date DEFAULT NULL,
  `period_end` date DEFAULT NULL,
  `rewards_claimed` tinyint(1) DEFAULT '0',
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_ranking` (`user_id`,`ranking_type`,`period_start`),
  KEY `idx_user` (`user_id`),
  KEY `idx_type_rank` (`ranking_type`,`rank_position`),
  KEY `idx_period` (`period_start`,`period_end`),
  CONSTRAINT `user_rankings_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: user_relationships
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.08 | TOTAL_MB: 0.09 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:44:53 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	target_user_id	int	NO	NULL		MUL		
4	relationship_type	enum('friend','best_friend','blocked','muted','following','dating','married')	NO	NULL		MUL	utf8mb4_unicode_ci	
5	interaction_score	int	YES	0				
6	last_interaction	timestamp	YES	NULL				
7	notes	text	YES	NULL			utf8mb4_unicode_ci	
8	is_favorite	tinyint(1)	YES	0		MUL		
9	is_hidden	tinyint(1)	YES	0				
10	anniversary_date	date	YES	NULL				
11	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
12	updated_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_favorite	NON_UNIQUE	BTREE	is_favorite	0
idx_target	NON_UNIQUE	BTREE	target_user_id	0
idx_type	NON_UNIQUE	BTREE	relationship_type	0
idx_user	NON_UNIQUE	BTREE	user_id	0
unique_relationship	UNIQUE	BTREE	user_id, target_user_id, relationship_type	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
user_relationships_ibfk_1	user_id	users	id	NO ACTION	NO ACTION
user_relationships_ibfk_2	target_user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `user_relationships` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `target_user_id` int NOT NULL,
  `relationship_type` enum('friend','best_friend','blocked','muted','following','dating','married') COLLATE utf8mb4_unicode_ci NOT NULL,
  `interaction_score` int DEFAULT '0',
  `last_interaction` timestamp NULL DEFAULT NULL,
  `notes` text COLLATE utf8mb4_unicode_ci,
  `is_favorite` tinyint(1) DEFAULT '0',
  `is_hidden` tinyint(1) DEFAULT '0',
  `anniversary_date` date DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_relationship` (`user_id`,`target_user_id`,`relationship_type`),
  KEY `idx_user` (`user_id`),
  KEY `idx_target` (`target_user_id`),
  KEY `idx_type` (`relationship_type`),
  KEY `idx_favorite` (`is_favorite`),
  CONSTRAINT `user_relationships_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
  CONSTRAINT `user_relationships_ibfk_2` FOREIGN KEY (`target_user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: user_scratch_cards
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 03:02:41 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	card_id	int	NO	NULL		MUL		
4	purchase_price	decimal(10,2)	NO	NULL				
5	result	json	YES	NULL				
6	prize_won	decimal(20,2)	YES	0.00				
7	is_scratched	tinyint(1)	YES	0				
8	is_winner	tinyint(1)	YES	0		MUL		
9	scratched_at	timestamp	YES	NULL				
10	purchased_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_card	NON_UNIQUE	BTREE	card_id	0
idx_user	NON_UNIQUE	BTREE	user_id	0
idx_winner	NON_UNIQUE	BTREE	is_winner	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
user_scratch_cards_ibfk_1	user_id	users	id	NO ACTION	NO ACTION
user_scratch_cards_ibfk_2	card_id	scratch_cards	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `user_scratch_cards` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `card_id` int NOT NULL,
  `purchase_price` decimal(10,2) NOT NULL,
  `result` json DEFAULT NULL,
  `prize_won` decimal(20,2) DEFAULT '0.00',
  `is_scratched` tinyint(1) DEFAULT '0',
  `is_winner` tinyint(1) DEFAULT '0',
  `scratched_at` timestamp NULL DEFAULT NULL,
  `purchased_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_card` (`card_id`),
  KEY `idx_winner` (`is_winner`),
  CONSTRAINT `user_scratch_cards_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
  CONSTRAINT `user_scratch_cards_ibfk_2` FOREIGN KEY (`card_id`) REFERENCES `scratch_cards` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: user_segments_analytics
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.02 | TOTAL_MB: 0.03 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 16:04:49 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	segment_name	varchar(200)	NO	NULL		MUL	utf8mb4_unicode_ci	
3	segment_rules	json	NO	NULL				
4	user_count	int	YES	0				
5	average_ltv	decimal(20,2)	YES	0.00				
6	average_order_value	decimal(12,2)	YES	0.00				
7	conversion_rate	decimal(5,2)	YES	0.00				
8	churn_rate	decimal(5,2)	YES	0.00				
9	engagement_score	decimal(10,2)	YES	0.00				
10	top_products	json	YES	NULL				
11	top_categories	json	YES	NULL				
12	demographics	json	YES	NULL				
13	behavior_patterns	json	YES	NULL				
14	last_calculated	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_segment	NON_UNIQUE	BTREE	segment_name	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `user_segments_analytics` (
  `id` int NOT NULL AUTO_INCREMENT,
  `segment_name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `segment_rules` json NOT NULL,
  `user_count` int DEFAULT '0',
  `average_ltv` decimal(20,2) DEFAULT '0.00',
  `average_order_value` decimal(12,2) DEFAULT '0.00',
  `conversion_rate` decimal(5,2) DEFAULT '0.00',
  `churn_rate` decimal(5,2) DEFAULT '0.00',
  `engagement_score` decimal(10,2) DEFAULT '0.00',
  `top_products` json DEFAULT NULL,
  `top_categories` json DEFAULT NULL,
  `demographics` json DEFAULT NULL,
  `behavior_patterns` json DEFAULT NULL,
  `last_calculated` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_segment` (`segment_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: user_settings
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.02 | TOTAL_MB: 0.03 | AUTO_INCREMENT: NULL | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-07 00:56:54 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	user_id	int	NO	NULL		PRI		
2	theme	varchar(50)	YES	dark			utf8mb4_unicode_ci	
3	font_size	int	YES	16				
4	font_family	varchar(50)	YES	Inter			utf8mb4_unicode_ci	
5	custom_colors	json	YES	NULL				
6	video_quality	varchar(20)	YES	auto			utf8mb4_unicode_ci	
7	auto_translate	tinyint(1)	YES	0				
8	virtual_bg	tinyint(1)	YES	0				
9	virtual_bg_type	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
10	virtual_bg_url	varchar(255)	YES	NULL			utf8mb4_unicode_ci	
11	sound_effects	tinyint(1)	YES	1				
12	ui_animations	tinyint(1)	YES	1				
13	email_notifications	tinyint(1)	YES	1				
14	push_notifications	tinyint(1)	YES	1				
15	message_sounds	tinyint(1)	YES	1				
16	friend_request_notif	tinyint(1)	YES	1				
17	achievement_alerts	tinyint(1)	YES	1				
18	daily_reminders	tinyint(1)	YES	0				
19	dnd_start	time	YES	22:00:00				
20	dnd_end	time	YES	08:00:00				
21	show_activity	tinyint(1)	YES	1				
22	auto_backup	tinyint(1)	YES	0				
23	backup_frequency	enum('daily','weekly','monthly')	YES	weekly			utf8mb4_unicode_ci	
24	last_backup	timestamp	YES	NULL				
25	google_drive_connected	tinyint(1)	YES	0				
26	dropbox_connected	tinyint(1)	YES	0				
27	two_factor_enabled	tinyint(1)	YES	0				
28	two_factor_secret	varchar(255)	YES	NULL			utf8mb4_unicode_ci	
29	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
30	updated_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	user_id	0
idx_user_id	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
user_settings_ibfk_1	user_id	users	id	NO ACTION	CASCADE

--- SHOW CREATE TABLE ---
CREATE TABLE `user_settings` (
  `user_id` int NOT NULL,
  `theme` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT 'dark',
  `font_size` int DEFAULT '16',
  `font_family` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT 'Inter',
  `custom_colors` json DEFAULT NULL,
  `video_quality` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT 'auto',
  `auto_translate` tinyint(1) DEFAULT '0',
  `virtual_bg` tinyint(1) DEFAULT '0',
  `virtual_bg_type` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `virtual_bg_url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `sound_effects` tinyint(1) DEFAULT '1',
  `ui_animations` tinyint(1) DEFAULT '1',
  `email_notifications` tinyint(1) DEFAULT '1',
  `push_notifications` tinyint(1) DEFAULT '1',
  `message_sounds` tinyint(1) DEFAULT '1',
  `friend_request_notif` tinyint(1) DEFAULT '1',
  `achievement_alerts` tinyint(1) DEFAULT '1',
  `daily_reminders` tinyint(1) DEFAULT '0',
  `dnd_start` time DEFAULT '22:00:00',
  `dnd_end` time DEFAULT '08:00:00',
  `show_activity` tinyint(1) DEFAULT '1',
  `auto_backup` tinyint(1) DEFAULT '0',
  `backup_frequency` enum('daily','weekly','monthly') COLLATE utf8mb4_unicode_ci DEFAULT 'weekly',
  `last_backup` timestamp NULL DEFAULT NULL,
  `google_drive_connected` tinyint(1) DEFAULT '0',
  `dropbox_connected` tinyint(1) DEFAULT '0',
  `two_factor_enabled` tinyint(1) DEFAULT '0',
  `two_factor_secret` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`user_id`),
  KEY `idx_user_id` (`user_id`),
  CONSTRAINT `user_settings_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: user_status
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:46:50 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	status_type	enum('text','image','video','voice')	NO	NULL			utf8mb4_unicode_ci	
4	content	text	YES	NULL			utf8mb4_unicode_ci	
5	media_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
6	background_color	varchar(7)	YES	NULL			utf8mb4_unicode_ci	
7	font_style	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
8	privacy	enum('everyone','contacts','except','only')	YES	contacts			utf8mb4_unicode_ci	
9	privacy_list	json	YES	NULL				
10	views_count	int	YES	0				
11	duration_seconds	int	YES	30				
12	expires_at	timestamp	NO	NULL		MUL		
13	is_muted	tinyint(1)	YES	0				
14	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_expires	NON_UNIQUE	BTREE	expires_at	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
user_status_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `user_status` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `status_type` enum('text','image','video','voice') COLLATE utf8mb4_unicode_ci NOT NULL,
  `content` text COLLATE utf8mb4_unicode_ci,
  `media_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `background_color` varchar(7) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `font_style` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `privacy` enum('everyone','contacts','except','only') COLLATE utf8mb4_unicode_ci DEFAULT 'contacts',
  `privacy_list` json DEFAULT NULL,
  `views_count` int DEFAULT '0',
  `duration_seconds` int DEFAULT '30',
  `expires_at` timestamp NOT NULL,
  `is_muted` tinyint(1) DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_expires` (`expires_at`),
  CONSTRAINT `user_status_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: user_storage
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:37:11 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		UNI		
3	plan_id	int	NO	1		MUL		
4	storage_used	bigint	YES	0				
5	storage_limit	bigint	NO	5368709120				
6	bandwidth_used	bigint	YES	0				
7	bandwidth_limit	bigint	YES	NULL				
8	file_count	int	YES	0				
9	folder_count	int	YES	0				
10	shared_count	int	YES	0				
11	trash_size	bigint	YES	0				
12	largest_file_size	bigint	YES	0				
13	last_cleanup	timestamp	YES	NULL				
14	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
15	updated_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_plan	NON_UNIQUE	BTREE	plan_id	0
idx_user	NON_UNIQUE	BTREE	user_id	0
user_id	UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
user_storage_ibfk_1	user_id	users	id	NO ACTION	NO ACTION
user_storage_ibfk_2	plan_id	storage_plans	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `user_storage` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `plan_id` int NOT NULL DEFAULT '1',
  `storage_used` bigint DEFAULT '0',
  `storage_limit` bigint NOT NULL DEFAULT '5368709120',
  `bandwidth_used` bigint DEFAULT '0',
  `bandwidth_limit` bigint DEFAULT NULL,
  `file_count` int DEFAULT '0',
  `folder_count` int DEFAULT '0',
  `shared_count` int DEFAULT '0',
  `trash_size` bigint DEFAULT '0',
  `largest_file_size` bigint DEFAULT '0',
  `last_cleanup` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_id` (`user_id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_plan` (`plan_id`),
  CONSTRAINT `user_storage_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
  CONSTRAINT `user_storage_ibfk_2` FOREIGN KEY (`plan_id`) REFERENCES `storage_plans` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: user_stories
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:42:01 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	media_type	enum('image','video','text')	NO	NULL			utf8mb4_unicode_ci	
4	media_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
5	text_content	text	YES	NULL			utf8mb4_unicode_ci	
6	background_color	varchar(7)	YES	NULL			utf8mb4_unicode_ci	
7	font_style	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
8	music_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
9	views_count	int	YES	0				
10	likes_count	int	YES	0				
11	duration_seconds	int	YES	15				
12	is_highlight	tinyint(1)	YES	0		MUL		
13	expires_at	timestamp	NO	NULL		MUL		
14	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_expires	NON_UNIQUE	BTREE	expires_at	0
idx_highlight	NON_UNIQUE	BTREE	is_highlight	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
user_stories_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `user_stories` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `media_type` enum('image','video','text') COLLATE utf8mb4_unicode_ci NOT NULL,
  `media_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `text_content` text COLLATE utf8mb4_unicode_ci,
  `background_color` varchar(7) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `font_style` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `music_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `views_count` int DEFAULT '0',
  `likes_count` int DEFAULT '0',
  `duration_seconds` int DEFAULT '15',
  `is_highlight` tinyint(1) DEFAULT '0',
  `expires_at` timestamp NOT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_expires` (`expires_at`),
  KEY `idx_highlight` (`is_highlight`),
  CONSTRAINT `user_stories_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: user_subscriptions
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.08 | TOTAL_MB: 0.09 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:45:25 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	subscriber_id	int	NO	NULL		MUL		
3	creator_id	int	NO	NULL		MUL		
4	tier	enum('basic','premium','vip')	YES	basic		MUL	utf8mb4_unicode_ci	
5	price_per_month	decimal(10,2)	NO	NULL				
6	auto_renew	tinyint(1)	YES	1				
7	benefits	json	YES	NULL				
8	next_billing_date	date	YES	NULL				
9	total_paid	decimal(10,2)	YES	0.00				
10	loyalty_months	int	YES	0				
11	is_gifted	tinyint(1)	YES	0				
12	gifted_by	int	YES	NULL		MUL		
13	cancelled_at	timestamp	YES	NULL				
14	expires_at	timestamp	YES	NULL				
15	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
gifted_by	NON_UNIQUE	BTREE	gifted_by	0
idx_creator	NON_UNIQUE	BTREE	creator_id	0
idx_subscriber	NON_UNIQUE	BTREE	subscriber_id	0
idx_tier	NON_UNIQUE	BTREE	tier	0
unique_subscription	UNIQUE	BTREE	subscriber_id, creator_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
user_subscriptions_ibfk_1	subscriber_id	users	id	NO ACTION	NO ACTION
user_subscriptions_ibfk_2	creator_id	users	id	NO ACTION	NO ACTION
user_subscriptions_ibfk_3	gifted_by	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `user_subscriptions` (
  `id` int NOT NULL AUTO_INCREMENT,
  `subscriber_id` int NOT NULL,
  `creator_id` int NOT NULL,
  `tier` enum('basic','premium','vip') COLLATE utf8mb4_unicode_ci DEFAULT 'basic',
  `price_per_month` decimal(10,2) NOT NULL,
  `auto_renew` tinyint(1) DEFAULT '1',
  `benefits` json DEFAULT NULL,
  `next_billing_date` date DEFAULT NULL,
  `total_paid` decimal(10,2) DEFAULT '0.00',
  `loyalty_months` int DEFAULT '0',
  `is_gifted` tinyint(1) DEFAULT '0',
  `gifted_by` int DEFAULT NULL,
  `cancelled_at` timestamp NULL DEFAULT NULL,
  `expires_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_subscription` (`subscriber_id`,`creator_id`),
  KEY `idx_subscriber` (`subscriber_id`),
  KEY `idx_creator` (`creator_id`),
  KEY `idx_tier` (`tier`),
  KEY `gifted_by` (`gifted_by`),
  CONSTRAINT `user_subscriptions_ibfk_1` FOREIGN KEY (`subscriber_id`) REFERENCES `users` (`id`),
  CONSTRAINT `user_subscriptions_ibfk_2` FOREIGN KEY (`creator_id`) REFERENCES `users` (`id`),
  CONSTRAINT `user_subscriptions_ibfk_3` FOREIGN KEY (`gifted_by`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: user_themes
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.00 | TOTAL_MB: 0.02 | AUTO_INCREMENT: NULL | COLLATION: utf8mb4_0900_ai_ci | CREATE: 2025-08-05 23:28:33 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	user_id	int	NO	NULL		PRI		
2	theme	varchar(20)	YES	dark			utf8mb4_0900_ai_ci	
3	primary_color	varchar(7)	YES	NULL			utf8mb4_0900_ai_ci	
4	accent_color	varchar(7)	YES	NULL			utf8mb4_0900_ai_ci	
5	font_size	varchar(10)	YES	medium			utf8mb4_0900_ai_ci	

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
user_themes_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `user_themes` (
  `user_id` int NOT NULL,
  `theme` varchar(20) DEFAULT 'dark',
  `primary_color` varchar(7) DEFAULT NULL,
  `accent_color` varchar(7) DEFAULT NULL,
  `font_size` varchar(10) DEFAULT 'medium',
  PRIMARY KEY (`user_id`),
  CONSTRAINT `user_themes_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;


============================================================
TABLE: user_verification
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.08 | TOTAL_MB: 0.09 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:44:14 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		UNI		
3	verification_type	enum('email','phone','document','video','social')	NO	NULL			utf8mb4_unicode_ci	
4	verification_status	enum('pending','verified','rejected','expired')	YES	pending		MUL	utf8mb4_unicode_ci	
5	verification_level	int	YES	0		MUL		
6	document_type	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
7	document_number_hash	varchar(255)	YES	NULL			utf8mb4_unicode_ci	
8	selfie_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
9	document_front_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
10	document_back_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
11	video_verification_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
12	social_accounts	json	YES	NULL				
13	verified_by	int	YES	NULL		MUL		
14	rejection_reason	text	YES	NULL			utf8mb4_unicode_ci	
15	verification_score	decimal(3,2)	YES	NULL				
16	expires_at	timestamp	YES	NULL				
17	verified_at	timestamp	YES	NULL				
18	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
19	updated_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_level	NON_UNIQUE	BTREE	verification_level	0
idx_status	NON_UNIQUE	BTREE	verification_status	0
idx_user	NON_UNIQUE	BTREE	user_id	0
user_id	UNIQUE	BTREE	user_id	0
verified_by	NON_UNIQUE	BTREE	verified_by	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
user_verification_ibfk_1	user_id	users	id	NO ACTION	NO ACTION
user_verification_ibfk_2	verified_by	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `user_verification` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `verification_type` enum('email','phone','document','video','social') COLLATE utf8mb4_unicode_ci NOT NULL,
  `verification_status` enum('pending','verified','rejected','expired') COLLATE utf8mb4_unicode_ci DEFAULT 'pending',
  `verification_level` int DEFAULT '0',
  `document_type` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `document_number_hash` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `selfie_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `document_front_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `document_back_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `video_verification_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `social_accounts` json DEFAULT NULL,
  `verified_by` int DEFAULT NULL,
  `rejection_reason` text COLLATE utf8mb4_unicode_ci,
  `verification_score` decimal(3,2) DEFAULT NULL,
  `expires_at` timestamp NULL DEFAULT NULL,
  `verified_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_id` (`user_id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_status` (`verification_status`),
  KEY `idx_level` (`verification_level`),
  KEY `verified_by` (`verified_by`),
  CONSTRAINT `user_verification_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
  CONSTRAINT `user_verification_ibfk_2` FOREIGN KEY (`verified_by`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: user_widgets
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:55:34 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	widget_type	varchar(50)	NO	NULL		MUL	utf8mb4_unicode_ci	
4	widget_name	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
5	position	json	YES	NULL				
6	size	json	YES	NULL				
7	settings	json	YES	NULL				
8	style	json	YES	NULL				
9	data_source	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
10	refresh_interval	int	YES	60				
11	is_visible	tinyint(1)	YES	1				
12	is_locked	tinyint(1)	YES	0				
13	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
14	updated_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_type	NON_UNIQUE	BTREE	widget_type	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
user_widgets_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `user_widgets` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `widget_type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `widget_name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `position` json DEFAULT NULL,
  `size` json DEFAULT NULL,
  `settings` json DEFAULT NULL,
  `style` json DEFAULT NULL,
  `data_source` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `refresh_interval` int DEFAULT '60',
  `is_visible` tinyint(1) DEFAULT '1',
  `is_locked` tinyint(1) DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_type` (`widget_type`),
  CONSTRAINT `user_widgets_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: users
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 3 | DATA_MB: 0.02 | INDEX_MB: 0.11 | TOTAL_MB: 0.13 | AUTO_INCREMENT: 4 | COLLATION: utf8mb4_0900_ai_ci | CREATE: 2025-08-07 01:01:49 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	username	varchar(50)	YES	NULL		UNI	utf8mb4_0900_ai_ci	
3	email	varchar(100)	NO	NULL		UNI	utf8mb4_0900_ai_ci	
4	password_hash	varchar(255)	NO	NULL			utf8mb4_0900_ai_ci	
5	avatar	varchar(255)	YES	default.png			utf8mb4_0900_ai_ci	
6	language	varchar(10)	YES	en			utf8mb4_0900_ai_ci	
7	country	varchar(50)	YES	NULL			utf8mb4_0900_ai_ci	
8	age	int	YES	NULL				
9	gender	enum('male','female','other')	YES	other			utf8mb4_0900_ai_ci	
10	interests	text	YES	NULL			utf8mb4_0900_ai_ci	
11	bio	text	YES	NULL			utf8mb4_0900_ai_ci	
12	total_chat_time	int	YES	0				
13	total_chats	int	YES	0				
14	profile_views	int	YES	0				
15	is_online	tinyint(1)	YES	0		MUL		
16	last_activity	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			
17	last_seen	timestamp	YES	NULL				
18	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
19	is_banned	tinyint(1)	YES	0				
20	premium_until	date	YES	NULL				
21	email_verified	tinyint(1)	YES	0				
22	verification_token	varchar(64)	YES	NULL			utf8mb4_0900_ai_ci	
23	reset_token	varchar(64)	YES	NULL			utf8mb4_0900_ai_ci	
24	reset_token_expires	timestamp	YES	NULL				
25	preferred_language	varchar(10)	YES	en			utf8mb4_0900_ai_ci	
26	theme	varchar(20)	YES	dark			utf8mb4_0900_ai_ci	
27	notification_sound	tinyint(1)	YES	1				
28	notification_desktop	tinyint(1)	YES	0				
29	profile_visibility	enum('public','friends','private')	YES	public			utf8mb4_0900_ai_ci	
30	show_online_status	tinyint(1)	YES	1				
31	allow_friend_requests	tinyint(1)	YES	1				
32	last_login	timestamp	YES	NULL				
33	looking_for_match	tinyint(1)	YES	0				
34	total_xp	int	YES	0		MUL		
35	current_level	int	YES	1				
36	weekly_score	int	YES	0		MUL		
37	coins_balance	int	YES	0				
38	subscription_type	enum('free','premium','vip')	YES	free			utf8mb4_0900_ai_ci	
39	subscription_expires	date	YES	NULL				
40	referral_code	varchar(20)	YES	NULL		MUL	utf8mb4_0900_ai_ci	
41	referred_by	int	YES	NULL		MUL		

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	3
email	UNIQUE	BTREE	email	3
fk_users_referred_by	NON_UNIQUE	BTREE	referred_by	1
idx_referral_code	NON_UNIQUE	BTREE	referral_code	3
idx_total_xp	NON_UNIQUE	BTREE	total_xp	1
idx_users_online	NON_UNIQUE	BTREE	is_online	1
idx_weekly_score	NON_UNIQUE	BTREE	weekly_score	1
username	UNIQUE	BTREE	username	3

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
fk_users_referred_by	referred_by	users	id	CASCADE	SET NULL

--- SHOW CREATE TABLE ---
CREATE TABLE `users` (
  `id` int NOT NULL AUTO_INCREMENT,
  `username` varchar(50) DEFAULT NULL,
  `email` varchar(100) NOT NULL,
  `password_hash` varchar(255) NOT NULL,
  `avatar` varchar(255) DEFAULT 'default.png',
  `language` varchar(10) DEFAULT 'en',
  `country` varchar(50) DEFAULT NULL,
  `age` int DEFAULT NULL,
  `gender` enum('male','female','other') DEFAULT 'other',
  `interests` text,
  `bio` text,
  `total_chat_time` int DEFAULT '0',
  `total_chats` int DEFAULT '0',
  `profile_views` int DEFAULT '0',
  `is_online` tinyint(1) DEFAULT '0',
  `last_activity` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `last_seen` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `is_banned` tinyint(1) DEFAULT '0',
  `premium_until` date DEFAULT NULL,
  `email_verified` tinyint(1) DEFAULT '0',
  `verification_token` varchar(64) DEFAULT NULL,
  `reset_token` varchar(64) DEFAULT NULL,
  `reset_token_expires` timestamp NULL DEFAULT NULL,
  `preferred_language` varchar(10) DEFAULT 'en',
  `theme` varchar(20) DEFAULT 'dark',
  `notification_sound` tinyint(1) DEFAULT '1',
  `notification_desktop` tinyint(1) DEFAULT '0',
  `profile_visibility` enum('public','friends','private') DEFAULT 'public',
  `show_online_status` tinyint(1) DEFAULT '1',
  `allow_friend_requests` tinyint(1) DEFAULT '1',
  `last_login` timestamp NULL DEFAULT NULL,
  `looking_for_match` tinyint(1) DEFAULT '0',
  `total_xp` int DEFAULT '0',
  `current_level` int DEFAULT '1',
  `weekly_score` int DEFAULT '0',
  `coins_balance` int DEFAULT '0',
  `subscription_type` enum('free','premium','vip') DEFAULT 'free',
  `subscription_expires` date DEFAULT NULL,
  `referral_code` varchar(20) DEFAULT NULL,
  `referred_by` int DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `email` (`email`),
  UNIQUE KEY `username` (`username`),
  KEY `idx_users_online` (`is_online`),
  KEY `idx_total_xp` (`total_xp`),
  KEY `idx_weekly_score` (`weekly_score`),
  KEY `idx_referral_code` (`referral_code`),
  KEY `fk_users_referred_by` (`referred_by`),
  CONSTRAINT `fk_users_referred_by` FOREIGN KEY (`referred_by`) REFERENCES `users` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;


============================================================
TABLE: vendor_stores
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.08 | TOTAL_MB: 0.09 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:51:43 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	vendor_id	int	NO	NULL		MUL		
3	store_name	varchar(200)	NO	NULL			utf8mb4_unicode_ci	
4	store_slug	varchar(200)	NO	NULL		UNI	utf8mb4_unicode_ci	
5	store_type	enum('individual','business','enterprise','brand')	YES	individual			utf8mb4_unicode_ci	
6	business_registration	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
7	tax_id	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
8	store_description	text	YES	NULL			utf8mb4_unicode_ci	
9	logo_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
10	banner_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
11	warehouse_locations	json	YES	NULL				
12	shipping_zones	json	YES	NULL				
13	return_policy	text	YES	NULL			utf8mb4_unicode_ci	
14	warranty_terms	text	YES	NULL			utf8mb4_unicode_ci	
15	customer_service_hours	json	YES	NULL				
16	response_time_minutes	int	YES	60				
17	fulfillment_type	enum('merchant','platform','hybrid')	YES	merchant			utf8mb4_unicode_ci	
18	commission_tier	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
19	commission_rate	decimal(5,2)	YES	15.00				
20	total_products	int	YES	0				
21	total_sales	int	YES	0				
22	total_revenue	decimal(20,2)	YES	0.00				
23	average_rating	decimal(3,2)	YES	0.00		MUL		
24	rating_count	int	YES	0				
25	performance_score	decimal(5,2)	YES	0.00		MUL		
26	account_health	varchar(20)	YES	good			utf8mb4_unicode_ci	
27	is_verified	tinyint(1)	YES	0				
28	is_featured	tinyint(1)	YES	0				
29	is_suspended	tinyint(1)	YES	0				
30	suspension_reason	text	YES	NULL			utf8mb4_unicode_ci	
31	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
32	updated_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_performance	NON_UNIQUE	BTREE	performance_score	0
idx_rating	NON_UNIQUE	BTREE	average_rating	0
idx_slug	NON_UNIQUE	BTREE	store_slug	0
idx_vendor	NON_UNIQUE	BTREE	vendor_id	0
store_slug	UNIQUE	BTREE	store_slug	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
vendor_stores_ibfk_1	vendor_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `vendor_stores` (
  `id` int NOT NULL AUTO_INCREMENT,
  `vendor_id` int NOT NULL,
  `store_name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `store_slug` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `store_type` enum('individual','business','enterprise','brand') COLLATE utf8mb4_unicode_ci DEFAULT 'individual',
  `business_registration` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `tax_id` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `store_description` text COLLATE utf8mb4_unicode_ci,
  `logo_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `banner_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `warehouse_locations` json DEFAULT NULL,
  `shipping_zones` json DEFAULT NULL,
  `return_policy` text COLLATE utf8mb4_unicode_ci,
  `warranty_terms` text COLLATE utf8mb4_unicode_ci,
  `customer_service_hours` json DEFAULT NULL,
  `response_time_minutes` int DEFAULT '60',
  `fulfillment_type` enum('merchant','platform','hybrid') COLLATE utf8mb4_unicode_ci DEFAULT 'merchant',
  `commission_tier` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `commission_rate` decimal(5,2) DEFAULT '15.00',
  `total_products` int DEFAULT '0',
  `total_sales` int DEFAULT '0',
  `total_revenue` decimal(20,2) DEFAULT '0.00',
  `average_rating` decimal(3,2) DEFAULT '0.00',
  `rating_count` int DEFAULT '0',
  `performance_score` decimal(5,2) DEFAULT '0.00',
  `account_health` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT 'good',
  `is_verified` tinyint(1) DEFAULT '0',
  `is_featured` tinyint(1) DEFAULT '0',
  `is_suspended` tinyint(1) DEFAULT '0',
  `suspension_reason` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `store_slug` (`store_slug`),
  KEY `idx_vendor` (`vendor_id`),
  KEY `idx_slug` (`store_slug`),
  KEY `idx_rating` (`average_rating`),
  KEY `idx_performance` (`performance_score`),
  CONSTRAINT `vendor_stores_ibfk_1` FOREIGN KEY (`vendor_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: video_analytics
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:50:24 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	video_id	int	NO	NULL		MUL		
3	date	date	NO	NULL		MUL		
4	views	int	YES	0				
5	unique_viewers	int	YES	0				
6	likes	int	YES	0				
7	comments	int	YES	0				
8	shares	int	YES	0				
9	avg_watch_time	decimal(5,2)	YES	0.00				
10	completion_rate	decimal(5,2)	YES	0.00				
11	traffic_source	json	YES	NULL				
12	audience_demographics	json	YES	NULL				
13	peak_concurrent_viewers	int	YES	0				
14	revenue_generated	decimal(10,2)	YES	0.00				
15	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_date	NON_UNIQUE	BTREE	date	0
idx_video	NON_UNIQUE	BTREE	video_id	0
unique_video_date	UNIQUE	BTREE	video_id, date	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
video_analytics_ibfk_1	video_id	short_videos	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `video_analytics` (
  `id` int NOT NULL AUTO_INCREMENT,
  `video_id` int NOT NULL,
  `date` date NOT NULL,
  `views` int DEFAULT '0',
  `unique_viewers` int DEFAULT '0',
  `likes` int DEFAULT '0',
  `comments` int DEFAULT '0',
  `shares` int DEFAULT '0',
  `avg_watch_time` decimal(5,2) DEFAULT '0.00',
  `completion_rate` decimal(5,2) DEFAULT '0.00',
  `traffic_source` json DEFAULT NULL,
  `audience_demographics` json DEFAULT NULL,
  `peak_concurrent_viewers` int DEFAULT '0',
  `revenue_generated` decimal(10,2) DEFAULT '0.00',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_video_date` (`video_id`,`date`),
  KEY `idx_video` (`video_id`),
  KEY `idx_date` (`date`),
  CONSTRAINT `video_analytics_ibfk_1` FOREIGN KEY (`video_id`) REFERENCES `short_videos` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: video_challenges
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.08 | TOTAL_MB: 0.09 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:50:58 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	hashtag	varchar(100)	NO	NULL		UNI	utf8mb4_unicode_ci	
3	title	varchar(200)	NO	NULL			utf8mb4_unicode_ci	
4	description	text	YES	NULL			utf8mb4_unicode_ci	
5	creator_id	int	YES	NULL		MUL		
6	sponsor_id	int	YES	NULL				
7	cover_image	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
8	example_video_id	int	YES	NULL				
9	rules	text	YES	NULL			utf8mb4_unicode_ci	
10	prizes	json	YES	NULL				
11	participation_count	int	YES	0				
12	views_count	int	YES	0				
13	start_date	timestamp	YES	NULL		MUL		
14	end_date	timestamp	YES	NULL				
15	is_official	tinyint(1)	YES	0				
16	is_trending	tinyint(1)	YES	0		MUL		
17	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
creator_id	NON_UNIQUE	BTREE	creator_id	0
hashtag	UNIQUE	BTREE	hashtag	0
idx_dates	NON_UNIQUE	BTREE	start_date, end_date	0
idx_hashtag	NON_UNIQUE	BTREE	hashtag	0
idx_trending	NON_UNIQUE	BTREE	is_trending	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
video_challenges_ibfk_1	creator_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `video_challenges` (
  `id` int NOT NULL AUTO_INCREMENT,
  `hashtag` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `title` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `creator_id` int DEFAULT NULL,
  `sponsor_id` int DEFAULT NULL,
  `cover_image` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `example_video_id` int DEFAULT NULL,
  `rules` text COLLATE utf8mb4_unicode_ci,
  `prizes` json DEFAULT NULL,
  `participation_count` int DEFAULT '0',
  `views_count` int DEFAULT '0',
  `start_date` timestamp NULL DEFAULT NULL,
  `end_date` timestamp NULL DEFAULT NULL,
  `is_official` tinyint(1) DEFAULT '0',
  `is_trending` tinyint(1) DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `hashtag` (`hashtag`),
  KEY `idx_hashtag` (`hashtag`),
  KEY `idx_trending` (`is_trending`),
  KEY `idx_dates` (`start_date`,`end_date`),
  KEY `creator_id` (`creator_id`),
  CONSTRAINT `video_challenges_ibfk_1` FOREIGN KEY (`creator_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: viewing_parties
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.08 | TOTAL_MB: 0.09 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:30:09 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	host_id	int	NO	NULL		MUL		
3	content_id	int	NO	NULL		MUL		
4	episode_id	int	YES	NULL		MUL		
5	room_code	varchar(20)	NO	NULL		UNI	utf8mb4_unicode_ci	
6	max_viewers	int	YES	10				
7	current_viewers	int	YES	0				
8	playback_position	int	YES	0				
9	is_playing	tinyint(1)	YES	0				
10	chat_enabled	tinyint(1)	YES	1				
11	is_public	tinyint(1)	YES	0				
12	password_hash	varchar(255)	YES	NULL			utf8mb4_unicode_ci	
13	started_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
14	ended_at	timestamp	YES	NULL				

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
content_id	NON_UNIQUE	BTREE	content_id	0
episode_id	NON_UNIQUE	BTREE	episode_id	0
idx_host	NON_UNIQUE	BTREE	host_id	0
idx_room	NON_UNIQUE	BTREE	room_code	0
room_code	UNIQUE	BTREE	room_code	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
viewing_parties_ibfk_1	host_id	users	id	NO ACTION	NO ACTION
viewing_parties_ibfk_2	content_id	media_content	id	NO ACTION	NO ACTION
viewing_parties_ibfk_3	episode_id	media_episodes	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `viewing_parties` (
  `id` int NOT NULL AUTO_INCREMENT,
  `host_id` int NOT NULL,
  `content_id` int NOT NULL,
  `episode_id` int DEFAULT NULL,
  `room_code` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `max_viewers` int DEFAULT '10',
  `current_viewers` int DEFAULT '0',
  `playback_position` int DEFAULT '0',
  `is_playing` tinyint(1) DEFAULT '0',
  `chat_enabled` tinyint(1) DEFAULT '1',
  `is_public` tinyint(1) DEFAULT '0',
  `password_hash` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `started_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `ended_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `room_code` (`room_code`),
  KEY `idx_host` (`host_id`),
  KEY `idx_room` (`room_code`),
  KEY `content_id` (`content_id`),
  KEY `episode_id` (`episode_id`),
  CONSTRAINT `viewing_parties_ibfk_1` FOREIGN KEY (`host_id`) REFERENCES `users` (`id`),
  CONSTRAINT `viewing_parties_ibfk_2` FOREIGN KEY (`content_id`) REFERENCES `media_content` (`id`),
  CONSTRAINT `viewing_parties_ibfk_3` FOREIGN KEY (`episode_id`) REFERENCES `media_episodes` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: vip_levels
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:49:44 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		UNI		
3	vip_level	int	YES	0		MUL		
4	vip_points	int	YES	0				
5	monthly_points	int	YES	0				
6	total_spent	decimal(15,2)	YES	0.00				
7	badge_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
8	frame_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
9	entry_effect	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
10	privileges	json	YES	NULL				
11	multiplier	decimal(3,2)	YES	1.00				
12	expires_at	timestamp	YES	NULL				
13	renewed_at	timestamp	YES	NULL				
14	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_level	NON_UNIQUE	BTREE	vip_level	0
idx_user	NON_UNIQUE	BTREE	user_id	0
user_id	UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
vip_levels_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `vip_levels` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `vip_level` int DEFAULT '0',
  `vip_points` int DEFAULT '0',
  `monthly_points` int DEFAULT '0',
  `total_spent` decimal(15,2) DEFAULT '0.00',
  `badge_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `frame_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `entry_effect` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `privileges` json DEFAULT NULL,
  `multiplier` decimal(3,2) DEFAULT '1.00',
  `expires_at` timestamp NULL DEFAULT NULL,
  `renewed_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_id` (`user_id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_level` (`vip_level`),
  CONSTRAINT `vip_levels_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: viral_game_scores
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:59:09 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	game_id	int	NO	NULL		MUL		
3	user_id	int	NO	NULL		MUL		
4	score	bigint	NO	NULL				
5	level_reached	int	YES	1				
6	time_played_seconds	int	YES	NULL				
7	moves_count	int	YES	NULL				
8	combo_max	int	YES	NULL				
9	accuracy_percentage	decimal(5,2)	YES	NULL				
10	tokens_earned	decimal(20,2)	YES	0.00				
11	xp_earned	int	YES	0				
12	achievements_unlocked	json	YES	NULL				
13	is_perfect	tinyint(1)	YES	0				
14	device_type	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
15	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED	MUL		

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_created	NON_UNIQUE	BTREE	created_at	0
idx_game_score	NON_UNIQUE	BTREE	game_id, score	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
viral_game_scores_ibfk_1	game_id	viral_games	id	NO ACTION	NO ACTION
viral_game_scores_ibfk_2	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `viral_game_scores` (
  `id` int NOT NULL AUTO_INCREMENT,
  `game_id` int NOT NULL,
  `user_id` int NOT NULL,
  `score` bigint NOT NULL,
  `level_reached` int DEFAULT '1',
  `time_played_seconds` int DEFAULT NULL,
  `moves_count` int DEFAULT NULL,
  `combo_max` int DEFAULT NULL,
  `accuracy_percentage` decimal(5,2) DEFAULT NULL,
  `tokens_earned` decimal(20,2) DEFAULT '0.00',
  `xp_earned` int DEFAULT '0',
  `achievements_unlocked` json DEFAULT NULL,
  `is_perfect` tinyint(1) DEFAULT '0',
  `device_type` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_game_score` (`game_id`,`score` DESC),
  KEY `idx_user` (`user_id`),
  KEY `idx_created` (`created_at`),
  CONSTRAINT `viral_game_scores_ibfk_1` FOREIGN KEY (`game_id`) REFERENCES `viral_games` (`id`),
  CONSTRAINT `viral_game_scores_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: viral_games
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:58:57 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	game_code	varchar(50)	NO	NULL		UNI	utf8mb4_unicode_ci	
3	name	varchar(100)	NO	NULL			utf8mb4_unicode_ci	
4	description	text	YES	NULL			utf8mb4_unicode_ci	
5	category	enum('puzzle','arcade','trivia','word','card','board','strategy','action','social')	NO	NULL		MUL	utf8mb4_unicode_ci	
6	thumbnail_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
7	game_assets	json	YES	NULL				
8	difficulty	enum('easy','medium','hard','expert')	YES	medium			utf8mb4_unicode_ci	
9	estimated_time_minutes	int	YES	NULL				
10	energy_cost	int	YES	0				
11	rewards	json	YES	NULL				
12	leaderboard_enabled	tinyint(1)	YES	1				
13	multiplayer_enabled	tinyint(1)	YES	0				
14	max_daily_plays	int	YES	NULL				
15	unlock_level	int	YES	1				
16	unlock_cost_tokens	decimal(20,2)	YES	0.00				
17	play_count	int	YES	0				
18	rating	decimal(3,2)	YES	0.00				
19	is_trending	tinyint(1)	YES	0		MUL		
20	is_featured	tinyint(1)	YES	0		MUL		
21	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
game_code	UNIQUE	BTREE	game_code	0
idx_category	NON_UNIQUE	BTREE	category	0
idx_featured	NON_UNIQUE	BTREE	is_featured	0
idx_trending	NON_UNIQUE	BTREE	is_trending	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `viral_games` (
  `id` int NOT NULL AUTO_INCREMENT,
  `game_code` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `category` enum('puzzle','arcade','trivia','word','card','board','strategy','action','social') COLLATE utf8mb4_unicode_ci NOT NULL,
  `thumbnail_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `game_assets` json DEFAULT NULL,
  `difficulty` enum('easy','medium','hard','expert') COLLATE utf8mb4_unicode_ci DEFAULT 'medium',
  `estimated_time_minutes` int DEFAULT NULL,
  `energy_cost` int DEFAULT '0',
  `rewards` json DEFAULT NULL,
  `leaderboard_enabled` tinyint(1) DEFAULT '1',
  `multiplayer_enabled` tinyint(1) DEFAULT '0',
  `max_daily_plays` int DEFAULT NULL,
  `unlock_level` int DEFAULT '1',
  `unlock_cost_tokens` decimal(20,2) DEFAULT '0.00',
  `play_count` int DEFAULT '0',
  `rating` decimal(3,2) DEFAULT '0.00',
  `is_trending` tinyint(1) DEFAULT '0',
  `is_featured` tinyint(1) DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `game_code` (`game_code`),
  KEY `idx_category` (`category`),
  KEY `idx_trending` (`is_trending`),
  KEY `idx_featured` (`is_featured`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: virtual_gifts
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 10 | DATA_MB: 0.02 | INDEX_MB: 0.00 | TOTAL_MB: 0.02 | AUTO_INCREMENT: 11 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-07 01:09:42 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	name	varchar(50)	NO	NULL			utf8mb4_unicode_ci	
3	emoji	varchar(10)	NO	NULL			utf8mb4_unicode_ci	
4	price_coins	int	NO	NULL				
5	animation	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
6	is_active	tinyint(1)	YES	1				
7	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	10

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `virtual_gifts` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `emoji` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
  `price_coins` int NOT NULL,
  `animation` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT '1',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: virtual_items
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:43:06 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	item_code	varchar(50)	NO	NULL		UNI	utf8mb4_unicode_ci	
3	name	varchar(100)	NO	NULL			utf8mb4_unicode_ci	
4	description	text	YES	NULL			utf8mb4_unicode_ci	
5	category	enum('avatar','frame','effect','emoji','theme','boost','consumable')	NO	NULL		MUL	utf8mb4_unicode_ci	
6	rarity	enum('common','uncommon','rare','epic','legendary','mythic')	YES	common		MUL	utf8mb4_unicode_ci	
7	price_coins	int	YES	NULL				
8	price_cash	decimal(10,2)	YES	NULL				
9	discount_percentage	int	YES	0				
10	preview_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
11	asset_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
12	properties	json	YES	NULL				
13	duration_days	int	YES	NULL				
14	is_tradeable	tinyint(1)	YES	1				
15	is_giftable	tinyint(1)	YES	1				
16	stock_quantity	int	YES	NULL				
17	sold_count	int	YES	0				
18	is_featured	tinyint(1)	YES	0		MUL		
19	is_active	tinyint(1)	YES	1				
20	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_category	NON_UNIQUE	BTREE	category	0
idx_featured	NON_UNIQUE	BTREE	is_featured	0
idx_rarity	NON_UNIQUE	BTREE	rarity	0
item_code	UNIQUE	BTREE	item_code	0

--- FOREIGN KEYS ---
(no foreign keys)

--- SHOW CREATE TABLE ---
CREATE TABLE `virtual_items` (
  `id` int NOT NULL AUTO_INCREMENT,
  `item_code` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `category` enum('avatar','frame','effect','emoji','theme','boost','consumable') COLLATE utf8mb4_unicode_ci NOT NULL,
  `rarity` enum('common','uncommon','rare','epic','legendary','mythic') COLLATE utf8mb4_unicode_ci DEFAULT 'common',
  `price_coins` int DEFAULT NULL,
  `price_cash` decimal(10,2) DEFAULT NULL,
  `discount_percentage` int DEFAULT '0',
  `preview_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `asset_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `properties` json DEFAULT NULL,
  `duration_days` int DEFAULT NULL,
  `is_tradeable` tinyint(1) DEFAULT '1',
  `is_giftable` tinyint(1) DEFAULT '1',
  `stock_quantity` int DEFAULT NULL,
  `sold_count` int DEFAULT '0',
  `is_featured` tinyint(1) DEFAULT '0',
  `is_active` tinyint(1) DEFAULT '1',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `item_code` (`item_code`),
  KEY `idx_category` (`category`),
  KEY `idx_rarity` (`rarity`),
  KEY `idx_featured` (`is_featured`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: visual_search
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.02 | TOTAL_MB: 0.03 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:30:33 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	search_image_url	varchar(500)	NO	NULL			utf8mb4_unicode_ci	
4	detected_objects	json	YES	NULL				
5	color_palette	json	YES	NULL				
6	similar_pins	json	YES	NULL				
7	search_results	json	YES	NULL				
8	click_through_pin_id	bigint	YES	NULL				
9	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
visual_search_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `visual_search` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `search_image_url` varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL,
  `detected_objects` json DEFAULT NULL,
  `color_palette` json DEFAULT NULL,
  `similar_pins` json DEFAULT NULL,
  `search_results` json DEFAULT NULL,
  `click_through_pin_id` bigint DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  CONSTRAINT `visual_search_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: voice_notes
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:47:08 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	sender_id	int	NO	NULL		MUL		
3	chat_type	enum('private','group','channel')	NO	NULL		MUL	utf8mb4_unicode_ci	
4	chat_id	int	NO	NULL				
5	file_url	varchar(500)	NO	NULL			utf8mb4_unicode_ci	
6	duration_seconds	int	NO	NULL				
7	file_size	int	YES	NULL				
8	waveform	json	YES	NULL				
9	is_listened	tinyint(1)	YES	0				
10	transcription	text	YES	NULL			utf8mb4_unicode_ci	
11	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_chat	NON_UNIQUE	BTREE	chat_type, chat_id	0
idx_sender	NON_UNIQUE	BTREE	sender_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
voice_notes_ibfk_1	sender_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `voice_notes` (
  `id` int NOT NULL AUTO_INCREMENT,
  `sender_id` int NOT NULL,
  `chat_type` enum('private','group','channel') COLLATE utf8mb4_unicode_ci NOT NULL,
  `chat_id` int NOT NULL,
  `file_url` varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL,
  `duration_seconds` int NOT NULL,
  `file_size` int DEFAULT NULL,
  `waveform` json DEFAULT NULL,
  `is_listened` tinyint(1) DEFAULT '0',
  `transcription` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_sender` (`sender_id`),
  KEY `idx_chat` (`chat_type`,`chat_id`),
  CONSTRAINT `voice_notes_ibfk_1` FOREIGN KEY (`sender_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: voice_rooms
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:45:12 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	room_code	varchar(20)	NO	NULL		UNI	utf8mb4_unicode_ci	
3	name	varchar(100)	NO	NULL			utf8mb4_unicode_ci	
4	description	text	YES	NULL			utf8mb4_unicode_ci	
5	host_id	int	NO	NULL		MUL		
6	co_hosts	json	YES	NULL				
7	category	varchar(50)	YES	NULL		MUL	utf8mb4_unicode_ci	
8	max_speakers	int	YES	10				
9	max_listeners	int	YES	100				
10	current_speakers	int	YES	0				
11	current_listeners	int	YES	0				
12	is_recording	tinyint(1)	YES	0				
13	recording_url	varchar(500)	YES	NULL			utf8mb4_unicode_ci	
14	stage_requests	json	YES	NULL				
15	banned_users	json	YES	NULL				
16	is_private	tinyint(1)	YES	0				
17	scheduled_start	timestamp	YES	NULL		MUL		
18	actual_start	timestamp	YES	NULL				
19	ended_at	timestamp	YES	NULL				
20	total_duration_minutes	int	YES	0				
21	peak_listeners	int	YES	0				
22	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_category	NON_UNIQUE	BTREE	category	0
idx_host	NON_UNIQUE	BTREE	host_id	0
idx_scheduled	NON_UNIQUE	BTREE	scheduled_start	0
room_code	UNIQUE	BTREE	room_code	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
voice_rooms_ibfk_1	host_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `voice_rooms` (
  `id` int NOT NULL AUTO_INCREMENT,
  `room_code` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `host_id` int NOT NULL,
  `co_hosts` json DEFAULT NULL,
  `category` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `max_speakers` int DEFAULT '10',
  `max_listeners` int DEFAULT '100',
  `current_speakers` int DEFAULT '0',
  `current_listeners` int DEFAULT '0',
  `is_recording` tinyint(1) DEFAULT '0',
  `recording_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `stage_requests` json DEFAULT NULL,
  `banned_users` json DEFAULT NULL,
  `is_private` tinyint(1) DEFAULT '0',
  `scheduled_start` timestamp NULL DEFAULT NULL,
  `actual_start` timestamp NULL DEFAULT NULL,
  `ended_at` timestamp NULL DEFAULT NULL,
  `total_duration_minutes` int DEFAULT '0',
  `peak_listeners` int DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `room_code` (`room_code`),
  KEY `idx_host` (`host_id`),
  KEY `idx_category` (`category`),
  KEY `idx_scheduled` (`scheduled_start`),
  CONSTRAINT `voice_rooms_ibfk_1` FOREIGN KEY (`host_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: votes
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:28:29 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	content_type	enum('post','comment')	NO	NULL		MUL	utf8mb4_unicode_ci	
4	content_id	bigint	NO	NULL				
5	vote_value	tinyint	NO	NULL				
6	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_content	NON_UNIQUE	BTREE	content_type, content_id	0
idx_user	NON_UNIQUE	BTREE	user_id	0
unique_vote	UNIQUE	BTREE	user_id, content_type, content_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
votes_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `votes` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `content_type` enum('post','comment') COLLATE utf8mb4_unicode_ci NOT NULL,
  `content_id` bigint NOT NULL,
  `vote_value` tinyint NOT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_vote` (`user_id`,`content_type`,`content_id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_content` (`content_type`,`content_id`),
  CONSTRAINT `votes_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
  CONSTRAINT `votes_chk_1` CHECK ((`vote_value` in (-(1),1)))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: wallets
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.03 | TOTAL_MB: 0.05 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:54:47 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		UNI		
3	balance	decimal(15,2)	YES	0.00				
4	coins_balance	int	YES	0				
5	diamonds_balance	int	YES	0				
6	pending_balance	decimal(15,2)	YES	0.00				
7	total_earned	decimal(15,2)	YES	0.00				
8	total_spent	decimal(15,2)	YES	0.00				
9	total_withdrawn	decimal(15,2)	YES	0.00				
10	currency	varchar(3)	YES	USD			utf8mb4_unicode_ci	
11	payment_methods	json	YES	NULL				
12	withdrawal_methods	json	YES	NULL				
13	is_locked	tinyint(1)	YES	0				
14	locked_reason	text	YES	NULL			utf8mb4_unicode_ci	
15	last_transaction	timestamp	YES	NULL				
16	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
17	updated_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_user	NON_UNIQUE	BTREE	user_id	0
user_id	UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
wallets_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `wallets` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `balance` decimal(15,2) DEFAULT '0.00',
  `coins_balance` int DEFAULT '0',
  `diamonds_balance` int DEFAULT '0',
  `pending_balance` decimal(15,2) DEFAULT '0.00',
  `total_earned` decimal(15,2) DEFAULT '0.00',
  `total_spent` decimal(15,2) DEFAULT '0.00',
  `total_withdrawn` decimal(15,2) DEFAULT '0.00',
  `currency` varchar(3) COLLATE utf8mb4_unicode_ci DEFAULT 'USD',
  `payment_methods` json DEFAULT NULL,
  `withdrawal_methods` json DEFAULT NULL,
  `is_locked` tinyint(1) DEFAULT '0',
  `locked_reason` text COLLATE utf8mb4_unicode_ci,
  `last_transaction` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_id` (`user_id`),
  KEY `idx_user` (`user_id`),
  CONSTRAINT `wallets_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: warehouses
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:53:00 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	owner_id	int	NO	NULL		MUL		
3	warehouse_name	varchar(200)	NO	NULL			utf8mb4_unicode_ci	
4	warehouse_code	varchar(50)	NO	NULL		UNI	utf8mb4_unicode_ci	
5	address	text	NO	NULL			utf8mb4_unicode_ci	
6	coordinates	json	YES	NULL				
7	total_area_sqft	int	YES	NULL				
8	storage_capacity	int	YES	NULL				
9	current_occupancy_percentage	decimal(5,2)	YES	0.00				
10	zones	json	YES	NULL				
11	operating_hours	json	YES	NULL				
12	staff_count	int	YES	0				
13	equipment	json	YES	NULL				
14	certifications	json	YES	NULL				
15	temperature_controlled	tinyint(1)	YES	0				
16	security_features	json	YES	NULL				
17	is_active	tinyint(1)	YES	1				
18	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_code	NON_UNIQUE	BTREE	warehouse_code	0
idx_owner	NON_UNIQUE	BTREE	owner_id	0
warehouse_code	UNIQUE	BTREE	warehouse_code	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
warehouses_ibfk_1	owner_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `warehouses` (
  `id` int NOT NULL AUTO_INCREMENT,
  `owner_id` int NOT NULL,
  `warehouse_name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `warehouse_code` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `address` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `coordinates` json DEFAULT NULL,
  `total_area_sqft` int DEFAULT NULL,
  `storage_capacity` int DEFAULT NULL,
  `current_occupancy_percentage` decimal(5,2) DEFAULT '0.00',
  `zones` json DEFAULT NULL,
  `operating_hours` json DEFAULT NULL,
  `staff_count` int DEFAULT '0',
  `equipment` json DEFAULT NULL,
  `certifications` json DEFAULT NULL,
  `temperature_controlled` tinyint(1) DEFAULT '0',
  `security_features` json DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT '1',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `warehouse_code` (`warehouse_code`),
  KEY `idx_owner` (`owner_id`),
  KEY `idx_code` (`warehouse_code`),
  CONSTRAINT `warehouses_ibfk_1` FOREIGN KEY (`owner_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: watch_history
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:30:09 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	bigint	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	content_id	int	NO	NULL		MUL		
4	episode_id	int	YES	NULL		MUL		
5	watched_seconds	int	YES	0				
6	total_seconds	int	YES	NULL				
7	progress_percentage	decimal(5,2)	YES	0.00				
8	is_completed	tinyint(1)	YES	0				
9	device_type	varchar(50)	YES	NULL			utf8mb4_unicode_ci	
10	quality_watched	varchar(20)	YES	NULL			utf8mb4_unicode_ci	
11	last_position	int	YES	0				
12	started_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
13	updated_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP	MUL		
14	completed_at	timestamp	YES	NULL				

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
episode_id	NON_UNIQUE	BTREE	episode_id	0
idx_content	NON_UNIQUE	BTREE	content_id	0
idx_updated	NON_UNIQUE	BTREE	updated_at	0
idx_user	NON_UNIQUE	BTREE	user_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
watch_history_ibfk_1	user_id	users	id	NO ACTION	NO ACTION
watch_history_ibfk_2	content_id	media_content	id	NO ACTION	NO ACTION
watch_history_ibfk_3	episode_id	media_episodes	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `watch_history` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `content_id` int NOT NULL,
  `episode_id` int DEFAULT NULL,
  `watched_seconds` int DEFAULT '0',
  `total_seconds` int DEFAULT NULL,
  `progress_percentage` decimal(5,2) DEFAULT '0.00',
  `is_completed` tinyint(1) DEFAULT '0',
  `device_type` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `quality_watched` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `last_position` int DEFAULT '0',
  `started_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `completed_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_content` (`content_id`),
  KEY `idx_updated` (`updated_at`),
  KEY `episode_id` (`episode_id`),
  CONSTRAINT `watch_history_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
  CONSTRAINT `watch_history_ibfk_2` FOREIGN KEY (`content_id`) REFERENCES `media_content` (`id`),
  CONSTRAINT `watch_history_ibfk_3` FOREIGN KEY (`episode_id`) REFERENCES `media_episodes` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: watchlists
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:30:09 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	content_id	int	NO	NULL		MUL		
4	added_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
5	priority	int	YES	0		MUL		
6	notes	text	YES	NULL			utf8mb4_unicode_ci	

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_content	NON_UNIQUE	BTREE	content_id	0
idx_priority	NON_UNIQUE	BTREE	priority	0
idx_user	NON_UNIQUE	BTREE	user_id	0
unique_watchlist	UNIQUE	BTREE	user_id, content_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
watchlists_ibfk_1	user_id	users	id	NO ACTION	NO ACTION
watchlists_ibfk_2	content_id	media_content	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `watchlists` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `content_id` int NOT NULL,
  `added_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `priority` int DEFAULT '0',
  `notes` text COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_watchlist` (`user_id`,`content_id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_content` (`content_id`),
  KEY `idx_priority` (`priority`),
  CONSTRAINT `watchlists_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
  CONSTRAINT `watchlists_ibfk_2` FOREIGN KEY (`content_id`) REFERENCES `media_content` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: wishlists
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:51:43 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	list_name	varchar(200)	YES	My Wishlist			utf8mb4_unicode_ci	
4	list_type	enum('private','public','shared')	YES	private			utf8mb4_unicode_ci	
5	share_code	varchar(50)	YES	NULL		UNI	utf8mb4_unicode_ci	
6	items	json	YES	NULL				
7	total_items	int	YES	0				
8	total_value	decimal(12,2)	YES	0.00				
9	notes	text	YES	NULL			utf8mb4_unicode_ci	
10	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			
11	updated_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED on update CURRENT_TIMESTAMP			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_share_code	NON_UNIQUE	BTREE	share_code	0
idx_user	NON_UNIQUE	BTREE	user_id	0
share_code	UNIQUE	BTREE	share_code	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
wishlists_ibfk_1	user_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `wishlists` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `list_name` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT 'My Wishlist',
  `list_type` enum('private','public','shared') COLLATE utf8mb4_unicode_ci DEFAULT 'private',
  `share_code` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `items` json DEFAULT NULL,
  `total_items` int DEFAULT '0',
  `total_value` decimal(12,2) DEFAULT '0.00',
  `notes` text COLLATE utf8mb4_unicode_ci,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `share_code` (`share_code`),
  KEY `idx_user` (`user_id`),
  KEY `idx_share_code` (`share_code`),
  CONSTRAINT `wishlists_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: withdrawal_requests
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.06 | TOTAL_MB: 0.08 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-08 02:54:58 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	user_id	int	NO	NULL		MUL		
3	amount	decimal(15,2)	NO	NULL				
4	currency	varchar(3)	YES	USD			utf8mb4_unicode_ci	
5	method	enum('bank','paypal','crypto','pix','stripe')	NO	NULL		MUL	utf8mb4_unicode_ci	
6	account_details	json	YES	NULL				
7	status	enum('pending','processing','approved','completed','rejected','cancelled')	YES	pending		MUL	utf8mb4_unicode_ci	
8	admin_notes	text	YES	NULL			utf8mb4_unicode_ci	
9	transaction_id	varchar(100)	YES	NULL			utf8mb4_unicode_ci	
10	fee_amount	decimal(10,2)	YES	0.00				
11	net_amount	decimal(15,2)	YES	NULL				
12	processed_by	int	YES	NULL		MUL		
13	processed_at	timestamp	YES	NULL				
14	completed_at	timestamp	YES	NULL				
15	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_method	NON_UNIQUE	BTREE	method	0
idx_status	NON_UNIQUE	BTREE	status	0
idx_user	NON_UNIQUE	BTREE	user_id	0
processed_by	NON_UNIQUE	BTREE	processed_by	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
withdrawal_requests_ibfk_1	user_id	users	id	NO ACTION	NO ACTION
withdrawal_requests_ibfk_2	processed_by	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `withdrawal_requests` (
  `id` int NOT NULL AUTO_INCREMENT,
  `user_id` int NOT NULL,
  `amount` decimal(15,2) NOT NULL,
  `currency` varchar(3) COLLATE utf8mb4_unicode_ci DEFAULT 'USD',
  `method` enum('bank','paypal','crypto','pix','stripe') COLLATE utf8mb4_unicode_ci NOT NULL,
  `account_details` json DEFAULT NULL,
  `status` enum('pending','processing','approved','completed','rejected','cancelled') COLLATE utf8mb4_unicode_ci DEFAULT 'pending',
  `admin_notes` text COLLATE utf8mb4_unicode_ci,
  `transaction_id` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `fee_amount` decimal(10,2) DEFAULT '0.00',
  `net_amount` decimal(15,2) DEFAULT NULL,
  `processed_by` int DEFAULT NULL,
  `processed_at` timestamp NULL DEFAULT NULL,
  `completed_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_user` (`user_id`),
  KEY `idx_status` (`status`),
  KEY `idx_method` (`method`),
  KEY `processed_by` (`processed_by`),
  CONSTRAINT `withdrawal_requests_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
  CONSTRAINT `withdrawal_requests_ibfk_2` FOREIGN KEY (`processed_by`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


============================================================
TABLE: workout_programs
============================================================
--- SUMMARY ---
ENGINE: InnoDB | ROWS(est): 0 | DATA_MB: 0.02 | INDEX_MB: 0.05 | TOTAL_MB: 0.06 | AUTO_INCREMENT: 1 | COLLATION: utf8mb4_unicode_ci | CREATE: 2025-08-09 15:13:15 | UPDATE: NULL

--- COLUMNS ---
pos	name	type	is_nullable	default	extra	key	collation	comment
1	id	int	NO	NULL	auto_increment	PRI		
2	trainer_id	int	YES	NULL		MUL		
3	title	varchar(200)	NO	NULL			utf8mb4_unicode_ci	
4	description	text	YES	NULL			utf8mb4_unicode_ci	
5	category	varchar(100)	YES	NULL		MUL	utf8mb4_unicode_ci	
6	difficulty_level	enum('beginner','intermediate','advanced','expert')	YES	intermediate		MUL	utf8mb4_unicode_ci	
7	duration_weeks	int	YES	4				
8	sessions_per_week	int	YES	3				
9	minutes_per_session	int	YES	45				
10	equipment_needed	json	YES	NULL				
11	target_muscles	json	YES	NULL				
12	goals	json	YES	NULL				
13	program_structure	json	YES	NULL				
14	video_demonstrations	json	YES	NULL				
15	price	decimal(10,2)	YES	0.00				
16	subscriber_count	int	YES	0				
17	completion_rate	decimal(5,2)	YES	0.00				
18	average_rating	decimal(3,2)	YES	0.00				
19	before_after_photos	json	YES	NULL				
20	is_featured	tinyint(1)	YES	0				
21	created_at	timestamp	YES	CURRENT_TIMESTAMP	DEFAULT_GENERATED			

--- INDEXES ---
index_name	uniqueness	index_type	columns	cardinality_est
PRIMARY	UNIQUE	BTREE	id	0
idx_category	NON_UNIQUE	BTREE	category	0
idx_difficulty	NON_UNIQUE	BTREE	difficulty_level	0
idx_trainer	NON_UNIQUE	BTREE	trainer_id	0

--- FOREIGN KEYS ---
constraint	fk_columns	ref_table	ref_columns	update_rule	delete_rule
workout_programs_ibfk_1	trainer_id	users	id	NO ACTION	NO ACTION

--- SHOW CREATE TABLE ---
CREATE TABLE `workout_programs` (
  `id` int NOT NULL AUTO_INCREMENT,
  `trainer_id` int DEFAULT NULL,
  `title` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci,
  `category` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `difficulty_level` enum('beginner','intermediate','advanced','expert') COLLATE utf8mb4_unicode_ci DEFAULT 'intermediate',
  `duration_weeks` int DEFAULT '4',
  `sessions_per_week` int DEFAULT '3',
  `minutes_per_session` int DEFAULT '45',
  `equipment_needed` json DEFAULT NULL,
  `target_muscles` json DEFAULT NULL,
  `goals` json DEFAULT NULL,
  `program_structure` json DEFAULT NULL,
  `video_demonstrations` json DEFAULT NULL,
  `price` decimal(10,2) DEFAULT '0.00',
  `subscriber_count` int DEFAULT '0',
  `completion_rate` decimal(5,2) DEFAULT '0.00',
  `average_rating` decimal(3,2) DEFAULT '0.00',
  `before_after_photos` json DEFAULT NULL,
  `is_featured` tinyint(1) DEFAULT '0',
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `idx_trainer` (`trainer_id`),
  KEY `idx_category` (`category`),
  KEY `idx_difficulty` (`difficulty_level`),
  CONSTRAINT `workout_programs_ibfk_1` FOREIGN KEY (`trainer_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


