SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;


CREATE TABLE `events` (
  `event_id` int(12) NOT NULL,
  `event_type` tinyint(4) NOT NULL DEFAULT 2 COMMENT '1 - news, 2 - events, 3 - courses, 4 - other | vechi - pastrat din motive de compatibilitate',
  `event_title` varchar(255) DEFAULT NULL,
  `event_text` text DEFAULT NULL,
  `event_start_date` int(11) NOT NULL DEFAULT 0,
  `event_end_date` int(10) UNSIGNED NOT NULL DEFAULT 0,
  `event_fields_ids` varchar(255) DEFAULT NULL,
  `event_max_participants` int(11) UNSIGNED NOT NULL DEFAULT 0,
  `event_price` float NOT NULL DEFAULT 0,
  `event_status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '0 - inactiv; 1 - activ',
  `event_date_added` int(11) NOT NULL DEFAULT 0,
  `seo_link` varchar(255) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

CREATE TABLE `events_photos` (
  `photo_id` int(10) UNSIGNED NOT NULL,
  `event_id` int(11) NOT NULL DEFAULT 0,
  `photo_order` int(11) NOT NULL DEFAULT 0,
  `photo_main` int(11) NOT NULL DEFAULT 0
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

CREATE TABLE `fields` (
  `field_id` int(11) NOT NULL,
  `location_id` int(11) NOT NULL DEFAULT 0,
  `field_name` varchar(255) DEFAULT NULL,
  `field_type` varchar(255) NOT NULL DEFAULT 'squash',
  `field_start_hour` time DEFAULT NULL,
  `field_end_hour` time DEFAULT NULL,
  `field_status` tinyint(4) NOT NULL DEFAULT 1 COMMENT '0 - inactiv; 1 - activ'
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

CREATE TABLE `fields_prices` (
  `price_id` int(10) UNSIGNED NOT NULL,
  `field_id` int(10) UNSIGNED NOT NULL DEFAULT 0,
  `price_day` tinyint(3) UNSIGNED NOT NULL DEFAULT 0 COMMENT '1 - luni; 7-duminica',
  `price_interval` tinyint(3) UNSIGNED NOT NULL DEFAULT 0 COMMENT '1 - 8-x; 2 - x-23',
  `price` int(10) UNSIGNED NOT NULL DEFAULT 0,
  `price_coach` tinyint(3) UNSIGNED NOT NULL DEFAULT 0 COMMENT '1 - cu antrenor, 0 - fara antrenor'
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

CREATE TABLE `gdpr_accepts` (
  `acceptance_id` int(11) UNSIGNED NOT NULL,
  `user_id` int(11) NOT NULL,
  `email` varchar(255) NOT NULL,
  `policy_name` varchar(255) DEFAULT NULL,
  `policy_content` text DEFAULT NULL,
  `action_page` varchar(255) NOT NULL,
  `timestamp` int(11) UNSIGNED NOT NULL,
  `date_accepted` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

CREATE TABLE `gdpr_requests` (
  `request_id` int(11) NOT NULL,
  `email` varchar(255) DEFAULT NULL,
  `request_status` varchar(255) DEFAULT NULL,
  `request_type` varchar(255) DEFAULT NULL,
  `http_user_agent` text DEFAULT NULL,
  `http_accept_language` text DEFAULT NULL,
  `server_addr` varchar(255) DEFAULT NULL,
  `remote_addr` varchar(255) DEFAULT NULL,
  `request_code` varchar(255) DEFAULT NULL,
  `timestamp` int(11) DEFAULT NULL,
  `request_time` datetime DEFAULT NULL,
  `request_processed_time` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

CREATE TABLE `invitations` (
  `invitation_id` int(10) UNSIGNED NOT NULL,
  `invitation_from_user_id` int(10) UNSIGNED NOT NULL,
  `invitation_to_user_id` int(10) UNSIGNED NOT NULL,
  `invitation_location_id` int(10) UNSIGNED NOT NULL,
  `invitation_sport` varchar(255) NOT NULL,
  `invitation_date` date NOT NULL,
  `invitation_message` text NOT NULL,
  `invitation_status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '0 - invitatie neacceptata; 1 - invitatie acceptata',
  `invitation_date_added` int(10) UNSIGNED NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

CREATE TABLE `league_awards` (
  `award_id` int(10) UNSIGNED NOT NULL,
  `player_id` int(11) NOT NULL,
  `award_type` varchar(64) NOT NULL COMMENT '"points", "prize"',
  `award_value` smallint(5) NOT NULL,
  `award_details` text NOT NULL,
  `award_date` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

CREATE TABLE `league_categories` (
  `category_id` int(10) UNSIGNED NOT NULL,
  `league_id` int(10) UNSIGNED NOT NULL,
  `category_name` varchar(64) NOT NULL,
  `category_description` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

CREATE TABLE `league_groups` (
  `group_id` int(10) UNSIGNED NOT NULL,
  `category_id` int(11) NOT NULL,
  `group_name` varchar(64) NOT NULL,
  `group_order` tinyint(3) UNSIGNED NOT NULL DEFAULT 0,
  `group_players` tinyint(3) UNSIGNED NOT NULL DEFAULT 0,
  `group_size` tinyint(3) UNSIGNED NOT NULL DEFAULT 8 COMMENT 'nr. maxim de jucatori'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

CREATE TABLE `league_leagues` (
  `league_id` int(10) UNSIGNED NOT NULL,
  `league_name` varchar(64) NOT NULL,
  `league_sport` varchar(16) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

CREATE TABLE `league_matches` (
  `match_id` int(10) UNSIGNED NOT NULL,
  `player1_id` int(11) NOT NULL,
  `player2_id` int(11) NOT NULL,
  `group_id` int(11) NOT NULL,
  `stage_id` int(10) UNSIGNED NOT NULL,
  `match_winner` int(11) NOT NULL DEFAULT 0,
  `match_absentee` int(11) NOT NULL DEFAULT 0,
  `match_abandoner` int(10) UNSIGNED NOT NULL DEFAULT 0,
  `match_played` tinyint(3) UNSIGNED NOT NULL DEFAULT 0 COMMENT '1 - jucat; 0 - nejucat',
  `match_status` tinyint(3) UNSIGNED NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

CREATE TABLE `league_players` (
  `player_id` int(10) UNSIGNED NOT NULL,
  `league_id` int(10) UNSIGNED NOT NULL,
  `group_id` int(11) NOT NULL,
  `player_name` varchar(128) NOT NULL,
  `player_points` int(10) UNSIGNED NOT NULL DEFAULT 0,
  `player_rank` smallint(5) UNSIGNED NOT NULL DEFAULT 0,
  `player_stats` text NOT NULL COMMENT 'json array stats',
  `player_locked` tinyint(3) UNSIGNED NOT NULL DEFAULT 0 COMMENT '1 - blocat in liga/ nu mai poate fi sters; 0 - poate fi sters',
  `player_status` tinyint(3) UNSIGNED NOT NULL DEFAULT 1 COMMENT '1 - activ; 0 - inactiv',
  `player_date_added` int(11) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

CREATE TABLE `league_rankings` (
  `rank_id` int(10) UNSIGNED NOT NULL,
  `player_id` int(11) NOT NULL,
  `rank_ranking` tinyint(3) UNSIGNED NOT NULL,
  `rank_points` int(10) UNSIGNED NOT NULL,
  `rank_stats` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

CREATE TABLE `league_scores` (
  `score_id` int(10) UNSIGNED NOT NULL,
  `match_id` int(11) NOT NULL,
  `score_player1` tinyint(3) UNSIGNED DEFAULT NULL,
  `score_player2` tinyint(3) UNSIGNED DEFAULT NULL,
  `score_set1` varchar(5) DEFAULT NULL COMMENT 'xx-yy (xx - puncte player1; yy - puncte player2)',
  `score_set2` varchar(5) DEFAULT NULL,
  `score_set3` varchar(5) DEFAULT NULL,
  `score_set4` varchar(5) DEFAULT NULL,
  `score_set5` varchar(5) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

CREATE TABLE `league_seasons` (
  `season_id` int(10) UNSIGNED NOT NULL,
  `league_id` int(10) UNSIGNED NOT NULL,
  `season_name` varchar(64) NOT NULL,
  `season_description` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

CREATE TABLE `league_stages` (
  `stage_id` int(10) UNSIGNED NOT NULL,
  `season_id` int(11) NOT NULL,
  `stage_name` varchar(64) NOT NULL,
  `stage_description` text NOT NULL,
  `stage_started` tinyint(3) UNSIGNED NOT NULL DEFAULT 0 COMMENT '1 - inceputa; 0 - neinceputa',
  `stage_ended` tinyint(3) UNSIGNED NOT NULL DEFAULT 0 COMMENT '1 - terminata; 0 - neterminata'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;

CREATE TABLE `locations` (
  `location_id` int(11) UNSIGNED NOT NULL,
  `location_name` varchar(255) DEFAULT NULL,
  `location_start_hour` time DEFAULT NULL,
  `location_end_hour` time DEFAULT NULL,
  `location_address` varchar(255) DEFAULT NULL,
  `location_phone` varchar(255) DEFAULT NULL,
  `location_email` varchar(255) DEFAULT NULL,
  `location_fax` varchar(255) DEFAULT NULL,
  `location_gps` varchar(255) DEFAULT NULL,
  `location_status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '0 - inactiv; 1 - activ'
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

CREATE TABLE `news` (
  `news_id` int(12) NOT NULL,
  `news_type` tinyint(4) NOT NULL DEFAULT 1 COMMENT '1 - news, 2 - events, 3 - courses, 4 - other',
  `news_title` varchar(255) DEFAULT NULL,
  `news_text` text DEFAULT NULL,
  `news_date` int(11) NOT NULL DEFAULT 0,
  `news_activ` tinyint(1) NOT NULL DEFAULT 0,
  `news_date_added` int(11) NOT NULL DEFAULT 0,
  `seo_link` varchar(255) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

CREATE TABLE `newsletter_emails` (
  `eid` int(10) UNSIGNED NOT NULL,
  `email` varchar(255) DEFAULT NULL,
  `nume` varchar(255) DEFAULT NULL,
  `prenume` varchar(255) DEFAULT NULL,
  `sex` enum('m','f','n') NOT NULL DEFAULT 'n' COMMENT 'm-masculin, f-feminin, n-neutru (firme)',
  `status` tinyint(4) NOT NULL DEFAULT 0,
  `data` int(11) NOT NULL DEFAULT 0,
  `sursa` varchar(32) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

CREATE TABLE `newsletter_newsletter` (
  `n_id` int(10) UNSIGNED NOT NULL,
  `n_subject` varchar(255) NOT NULL DEFAULT '',
  `n_suplimentare` varchar(255) NOT NULL,
  `n_html` longtext DEFAULT NULL,
  `n_text` text DEFAULT NULL,
  `n_template` varchar(255) DEFAULT NULL,
  `n_emailati` int(11) NOT NULL DEFAULT 0,
  `n_trimis` tinyint(4) NOT NULL DEFAULT 0,
  `n_send_pending` tinyint(3) UNSIGNED NOT NULL DEFAULT 0 COMMENT '0 - nu se va trimite; 1 - se va trimite',
  `n_views` int(11) NOT NULL DEFAULT 0,
  `n_data_trimitere` varchar(255) NOT NULL DEFAULT '0',
  `n_last_eid` int(11) NOT NULL DEFAULT 0 COMMENT 'ultimul ID de email caruia i s-a trimis - pentru trimiteri partiale',
  `n_data` int(11) NOT NULL DEFAULT 0
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

CREATE TABLE `newsletter_stats` (
  `email` varchar(255) DEFAULT NULL,
  `newsletter_id` int(11) NOT NULL DEFAULT 0,
  `stats_views` int(11) NOT NULL DEFAULT 0,
  `stats_last_view` int(10) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

CREATE TABLE `news_photos` (
  `photo_id` int(10) UNSIGNED NOT NULL,
  `news_id` int(11) NOT NULL DEFAULT 0,
  `photo_order` int(11) NOT NULL DEFAULT 0,
  `photo_main` int(11) NOT NULL DEFAULT 0
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

CREATE TABLE `orders` (
  `order_id` int(10) UNSIGNED NOT NULL,
  `user_id` int(10) UNSIGNED DEFAULT NULL,
  `order_amount` decimal(6,2) UNSIGNED NOT NULL DEFAULT 0.00,
  `order_type` varchar(255) DEFAULT NULL,
  `order_type_id` int(10) UNSIGNED DEFAULT NULL,
  `order_status` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '1-payment aproved; 0-payment denied',
  `order_payment_data` text DEFAULT NULL COMMENT 'json encoded payment response data',
  `order_date` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

CREATE TABLE `payU_IPN` (
  `ipn_id` int(10) UNSIGNED NOT NULL,
  `user_id` int(10) UNSIGNED DEFAULT NULL,
  `ipn_error` varchar(255) DEFAULT NULL,
  `ipn_status` varchar(255) DEFAULT NULL,
  `ipn_data` text DEFAULT NULL,
  `ipn_date_added` int(10) UNSIGNED DEFAULT NULL,
  `ipn_confirmed` tinyint(4) NOT NULL DEFAULT 0
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

CREATE TABLE `photoAlbum_categories` (
  `category_id` int(10) UNSIGNED NOT NULL,
  `category_parent_id` int(10) UNSIGNED DEFAULT NULL,
  `category_name` varchar(255) DEFAULT NULL,
  `category_description` text DEFAULT NULL,
  `category_date_added` int(10) UNSIGNED DEFAULT NULL,
  `category_active` tinyint(3) UNSIGNED NOT NULL DEFAULT 1,
  `seo_link` varchar(255) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

CREATE TABLE `photoAlbum_photos` (
  `photo_id` int(10) UNSIGNED NOT NULL,
  `category_id` int(10) UNSIGNED DEFAULT NULL,
  `photo_name` varchar(255) DEFAULT NULL,
  `photo_caption` varchar(255) DEFAULT NULL,
  `photo_views` int(10) UNSIGNED DEFAULT NULL,
  `photo_date_added` int(10) UNSIGNED DEFAULT NULL,
  `photo_file_size` int(10) UNSIGNED DEFAULT NULL,
  `photo_width` int(11) DEFAULT NULL,
  `photo_height` int(11) DEFAULT NULL,
  `photo_active` tinyint(4) NOT NULL DEFAULT 1,
  `photo_order` int(11) DEFAULT NULL,
  `seo_link` varchar(255) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

CREATE TABLE `registrations` (
  `registration_id` int(10) UNSIGNED NOT NULL,
  `registration_type` tinyint(3) UNSIGNED NOT NULL DEFAULT 2 COMMENT '2 - events, 3 - trainings',
  `item_id` int(10) UNSIGNED DEFAULT NULL COMMENT 'event ID / training ID',
  `user_id` int(11) DEFAULT NULL,
  `subscription_id` int(10) UNSIGNED NOT NULL,
  `registration_date_added` int(10) UNSIGNED DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

CREATE TABLE `reservations` (
  `reservation_id` int(10) UNSIGNED NOT NULL,
  `user_id` int(11) DEFAULT NULL,
  `field_id` int(11) DEFAULT NULL,
  `event_id` int(11) DEFAULT NULL,
  `training_id` int(10) UNSIGNED DEFAULT NULL,
  `trainer_id` int(10) UNSIGNED NOT NULL DEFAULT 0,
  `reservation_date` date DEFAULT NULL,
  `reservation_start_hour` time DEFAULT NULL,
  `reservation_end_hour` time DEFAULT NULL,
  `reservation_type` tinyint(4) NOT NULL DEFAULT 1 COMMENT '1 - normal, 2 - event; 3 - training, 4 - custom',
  `reservation_status` tinyint(4) NOT NULL DEFAULT 1 COMMENT '0 - canceled; 1 - active',
  `reservation_visible` tinyint(4) NOT NULL DEFAULT 1 COMMENT '1 - vizibila; 0 - stearsa / invizibila',
  `reservation_notified` tinyint(4) NOT NULL DEFAULT 0,
  `reservation_payment_type` tinyint(4) NOT NULL DEFAULT 1 COMMENT '1 - cash, 2 - abonament, 3 - online',
  `reservation_payed` tinyint(4) NOT NULL DEFAULT 0 COMMENT '0 - neplatita; 1 - platita; 2 - pending (online)',
  `reservation_payment_id` int(11) DEFAULT NULL,
  `reservation_attended` tinyint(4) NOT NULL DEFAULT 0 COMMENT '0 - neonorata; 1 - onorata',
  `reservation_date_added` int(11) DEFAULT NULL COMMENT 'data adaugarii rezervarii',
  `reservation_added_by_user_id` int(10) UNSIGNED DEFAULT NULL,
  `reservation_date_canceled` int(11) DEFAULT NULL,
  `reservation_canceled_by_user_id` int(11) DEFAULT NULL,
  `reservation_comments` varchar(255) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

CREATE TABLE `reservations_copy_20240304` (
  `reservation_id` int(10) UNSIGNED NOT NULL,
  `user_id` int(11) DEFAULT NULL,
  `field_id` int(11) DEFAULT NULL,
  `event_id` int(11) DEFAULT NULL,
  `training_id` int(10) UNSIGNED DEFAULT NULL,
  `trainer_id` int(10) UNSIGNED NOT NULL DEFAULT 0,
  `reservation_date` date DEFAULT NULL,
  `reservation_start_hour` time DEFAULT NULL,
  `reservation_end_hour` time DEFAULT NULL,
  `reservation_type` tinyint(4) NOT NULL DEFAULT 1 COMMENT '1 - normal, 2 - event; 3 - training, 4 - custom',
  `reservation_status` tinyint(4) NOT NULL DEFAULT 1 COMMENT '0 - canceled; 1 - active',
  `reservation_visible` tinyint(4) NOT NULL DEFAULT 1 COMMENT '1 - vizibila; 0 - stearsa / invizibila',
  `reservation_notified` tinyint(4) NOT NULL DEFAULT 0,
  `reservation_payment_type` tinyint(4) NOT NULL DEFAULT 1 COMMENT '1 - cash, 2 - abonament, 3 - online',
  `reservation_payed` tinyint(4) NOT NULL DEFAULT 0 COMMENT '0 - neplatita; 1 - platita; 2 - pending (online)',
  `reservation_payment_id` int(11) DEFAULT NULL,
  `reservation_attended` tinyint(4) NOT NULL DEFAULT 0 COMMENT '0 - neonorata; 1 - onorata',
  `reservation_date_added` int(11) DEFAULT NULL COMMENT 'data adaugarii rezervarii',
  `reservation_added_by_user_id` int(10) UNSIGNED DEFAULT NULL,
  `reservation_date_canceled` int(11) DEFAULT NULL,
  `reservation_canceled_by_user_id` int(11) DEFAULT NULL,
  `reservation_comments` varchar(255) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

CREATE TABLE `reservations_waiting_list` (
  `wait_id` int(11) NOT NULL,
  `user_id` int(11) DEFAULT NULL,
  `reservation_id` int(11) DEFAULT NULL,
  `field_type` varchar(16) DEFAULT NULL,
  `reservation_date` date DEFAULT NULL,
  `reservation_start_hour` time DEFAULT NULL,
  `reservation_end_hour` time DEFAULT NULL,
  `wait_payment_method` tinyint(3) UNSIGNED DEFAULT NULL,
  `wait_payment_id` tinyint(4) NOT NULL DEFAULT 0,
  `wait_date_added` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

CREATE TABLE `seo_` (
  `seo_id` int(10) UNSIGNED NOT NULL,
  `seo_url` varchar(255) NOT NULL,
  `seo_uri` varchar(255) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

CREATE TABLE `seo_events` (
  `seo_id` int(10) UNSIGNED NOT NULL,
  `seo_url` varchar(255) NOT NULL,
  `seo_uri` varchar(255) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

CREATE TABLE `seo_invitations` (
  `seo_id` int(10) UNSIGNED NOT NULL,
  `seo_url` varchar(255) NOT NULL,
  `seo_uri` varchar(255) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

CREATE TABLE `seo_news` (
  `seo_id` int(10) UNSIGNED NOT NULL,
  `seo_url` varchar(255) NOT NULL,
  `seo_uri` varchar(255) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

CREATE TABLE `seo_newsletter` (
  `seo_id` int(10) UNSIGNED NOT NULL,
  `seo_url` varchar(255) NOT NULL,
  `seo_uri` varchar(255) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

CREATE TABLE `seo_photoalbum` (
  `seo_id` int(10) UNSIGNED NOT NULL,
  `seo_url` varchar(255) NOT NULL,
  `seo_uri` varchar(255) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

CREATE TABLE `seo_reservations` (
  `seo_id` int(10) UNSIGNED NOT NULL,
  `seo_url` varchar(255) NOT NULL,
  `seo_uri` varchar(255) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

CREATE TABLE `seo_subscriptions` (
  `seo_id` int(10) UNSIGNED NOT NULL,
  `seo_url` varchar(255) NOT NULL,
  `seo_uri` varchar(255) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

CREATE TABLE `seo_urls` (
  `seo_id` int(10) UNSIGNED NOT NULL,
  `seo_url` varchar(255) NOT NULL,
  `seo_uri` varchar(255) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

CREATE TABLE `seo_user` (
  `seo_id` int(10) UNSIGNED NOT NULL,
  `seo_url` varchar(255) NOT NULL DEFAULT '',
  `seo_uri` varchar(255) NOT NULL DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

CREATE TABLE `settings` (
  `setting_id` int(11) NOT NULL,
  `setting_group` varchar(255) DEFAULT NULL,
  `setting_key` varchar(255) DEFAULT NULL,
  `setting_type` varchar(255) DEFAULT NULL,
  `setting_value` text DEFAULT NULL,
  `setting_serialized` tinyint(4) DEFAULT NULL,
  `setting_order` tinyint(3) UNSIGNED NOT NULL DEFAULT 0,
  `setting_text` varchar(255) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

CREATE TABLE `sports` (
  `sport_id` int(10) UNSIGNED NOT NULL,
  `sport_name` varchar(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
  `sport_cash_max_days` tinyint(3) UNSIGNED NOT NULL DEFAULT 0,
  `sport_online_max_days` tinyint(3) UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

CREATE TABLE `static_pages` (
  `sp_id` int(10) UNSIGNED NOT NULL,
  `sp_name` varchar(255) DEFAULT NULL COMMENT 'numele paginii. o referinta unica textuala scurta a paginii',
  `sp_title` varchar(255) DEFAULT NULL COMMENT 'titlul paginii - apare pa pagina si are si functie de SEO',
  `sp_meta_description` varchar(255) DEFAULT NULL,
  `sp_meta_keywords` varchar(255) DEFAULT NULL,
  `sp_breadcrumb` varchar(255) DEFAULT NULL COMMENT 'lista IDurilor paginilor statice, cu virgula, care compun calea pana la pag. curenta',
  `sp_seo_link` varchar(255) DEFAULT NULL COMMENT 'URLul SEO al paginii',
  `sp_text` text DEFAULT NULL,
  `sp_date_added` int(11) DEFAULT NULL COMMENT 'data adaugarii paginii - unixtime',
  `sp_views` int(11) DEFAULT NULL COMMENT 'numarul de vizualizari',
  `sp_status` tinyint(4) DEFAULT NULL COMMENT '0-inactiva; 1-activa'
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='tabela cu paginile statice';

CREATE TABLE `subscriptions` (
  `subscription_id` int(10) UNSIGNED NOT NULL,
  `subscriptionType_id` int(11) DEFAULT NULL,
  `subscription_code` varchar(255) NOT NULL DEFAULT '',
  `user_id` int(11) DEFAULT NULL,
  `subscription_date_start` date DEFAULT NULL,
  `subscription_date_end` date DEFAULT NULL,
  `subscription_payment_method` tinyint(4) NOT NULL DEFAULT 1 COMMENT '1 - numerar; 2 - virament; 3 - online; 4 - voucher; 5 - coupon',
  `subscription_payment_status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '0 - neplatit; 1 - platit; 2 - in asteptare',
  `subscription_status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '-1 - banat; 0 - inactiv; 1 - activ',
  `subscription_date_added` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

CREATE TABLE `subscriptionsCoupons` (
  `coupon_id` int(10) UNSIGNED NOT NULL,
  `subscriptionType_id` int(11) DEFAULT NULL,
  `visitor_id` int(11) DEFAULT NULL COMMENT 'IDul vizitatorului care l-a cumparat',
  `user_id` int(11) DEFAULT NULL COMMENT 'IDul userului care l-a folosit',
  `subscription_id` int(11) DEFAULT NULL COMMENT 'IDul abonamentului generat din acest cupon',
  `coupon_code` varchar(32) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin DEFAULT NULL,
  `payment_method` tinyint(3) UNSIGNED NOT NULL DEFAULT 1,
  `payment_status` tinyint(3) UNSIGNED NOT NULL DEFAULT 1 COMMENT '0 - neplatit; 1 - platit',
  `payment_date` int(10) UNSIGNED DEFAULT NULL,
  `transfer_date` int(10) UNSIGNED DEFAULT NULL,
  `status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '0 - nefolosit; 1 - folosit de user_id',
  `date_added` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

CREATE TABLE `subscriptionsTypes` (
  `subscriptionType_id` int(10) UNSIGNED NOT NULL,
  `subscriptionType_kind` enum('voucher','subscription') NOT NULL DEFAULT 'subscription',
  `subscriptionType_type` varchar(255) DEFAULT NULL,
  `subscriptionType_dow` varchar(255) NOT NULL DEFAULT '1,2,3,4,5,6,7' COMMENT 'days of week: 1 (for Monday) through 7 (for Sunday)',
  `subscriptionType_interval` varchar(255) NOT NULL DEFAULT '1,2' COMMENT 'interval orar: 1 si/sau 2',
  `subscriptionType_name` varchar(255) DEFAULT NULL,
  `subscriptionType_desc` varchar(255) DEFAULT NULL,
  `subscriptionType_status` tinyint(3) UNSIGNED NOT NULL DEFAULT 1,
  `subscriptionType_order` tinyint(4) UNSIGNED DEFAULT NULL,
  `subscriptionType_coach` tinyint(3) UNSIGNED NOT NULL DEFAULT 0 COMMENT '0 - fara antrenor; 1 - cu antrenor',
  `subscriptionType_hours` tinyint(3) UNSIGNED DEFAULT NULL COMMENT 'numar de ore incluse',
  `subscriptionType_duration` tinyint(3) UNSIGNED NOT NULL DEFAULT 0,
  `subscriptionType_availability` tinyint(4) DEFAULT NULL,
  `subscriptionType_price` smallint(5) UNSIGNED DEFAULT NULL,
  `subscriptionType_date_added` int(10) UNSIGNED DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

CREATE TABLE `subscriptions_copy_20240304` (
  `subscription_id` int(10) UNSIGNED NOT NULL,
  `subscriptionType_id` int(11) DEFAULT NULL,
  `subscription_code` varchar(255) NOT NULL DEFAULT '',
  `user_id` int(11) DEFAULT NULL,
  `subscription_date_start` date DEFAULT NULL,
  `subscription_date_end` date DEFAULT NULL,
  `subscription_payment_method` tinyint(4) NOT NULL DEFAULT 1 COMMENT '1 - numerar; 2 - virament; 3 - online; 4 - voucher; 5 - coupon',
  `subscription_payment_status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '0 - neplatit; 1 - platit; 2 - in asteptare',
  `subscription_status` tinyint(4) NOT NULL DEFAULT 0 COMMENT '-1 - banat; 0 - inactiv; 1 - activ',
  `subscription_date_added` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

CREATE TABLE `trainings` (
  `training_id` int(10) UNSIGNED NOT NULL,
  `reservation_id` int(10) UNSIGNED DEFAULT NULL,
  `coach_id` int(10) UNSIGNED DEFAULT NULL,
  `training_price` float NOT NULL DEFAULT 0,
  `training_max_participants` tinyint(3) UNSIGNED DEFAULT NULL,
  `training_level` varchar(255) DEFAULT NULL,
  `training_type` tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '0 - inchis (fara inscrieri); 1 - deschis (cu inscrieri)'
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

CREATE TABLE `users` (
  `user_id` int(10) UNSIGNED NOT NULL,
  `user_name` varchar(255) DEFAULT NULL,
  `user_firstname` varchar(255) DEFAULT NULL,
  `user_lastname` varchar(255) DEFAULT NULL,
  `user_county` varchar(255) DEFAULT NULL,
  `user_city` varchar(255) DEFAULT NULL,
  `user_address` text DEFAULT NULL,
  `user_email` varchar(255) DEFAULT NULL,
  `user_phone` varchar(255) DEFAULT NULL,
  `user_password_reset` int(10) UNSIGNED NOT NULL DEFAULT 0,
  `user_hashed_password` varchar(255) DEFAULT NULL,
  `user_date` int(11) UNSIGNED NOT NULL DEFAULT 0,
  `user_last_login` int(10) UNSIGNED NOT NULL DEFAULT 0,
  `user_ip` varchar(15) DEFAULT NULL,
  `user_status` tinyint(3) UNSIGNED NOT NULL DEFAULT 0 COMMENT '0=inactiv, 1=activ, 2=banat',
  `user_newsletter` tinyint(3) UNSIGNED NOT NULL DEFAULT 0 COMMENT '0=inactiv, 1=activ, 2=dezabonat, 3=returned',
  `user_newsletter_date` int(10) UNSIGNED DEFAULT 0,
  `user_skills` text DEFAULT NULL COMMENT 'json array of skill levels',
  `user_level` varchar(64) NOT NULL DEFAULT 'specialist',
  `user_patron` int(11) DEFAULT 0 COMMENT 'ID of the user that recommended the current user',
  `user_comments` text DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

CREATE TABLE `users_bkp` (
  `user_id` int(10) UNSIGNED NOT NULL,
  `user_name` varchar(255) DEFAULT NULL,
  `user_firstname` varchar(255) DEFAULT NULL,
  `user_lastname` varchar(255) DEFAULT NULL,
  `user_county` varchar(255) DEFAULT NULL,
  `user_city` varchar(255) DEFAULT NULL,
  `user_address` text DEFAULT NULL,
  `user_email` varchar(255) DEFAULT NULL,
  `user_phone` varchar(255) DEFAULT NULL,
  `user_password_reset` int(10) UNSIGNED NOT NULL DEFAULT 0,
  `user_password` varchar(255) DEFAULT NULL,
  `user_date` int(11) UNSIGNED NOT NULL DEFAULT 0,
  `user_last_login` int(10) UNSIGNED NOT NULL DEFAULT 0,
  `user_ip` varchar(15) DEFAULT NULL,
  `user_status` tinyint(3) UNSIGNED NOT NULL DEFAULT 0 COMMENT '0=inactiv, 1=activ, 2=banat',
  `user_newsletter` tinyint(3) UNSIGNED NOT NULL DEFAULT 0 COMMENT '0=inactiv, 1=activ, 2=dezabonat, 3=returned',
  `user_newsletter_date` int(10) UNSIGNED DEFAULT 0,
  `user_skills` text DEFAULT NULL COMMENT 'json array of skill levels',
  `user_level` varchar(64) NOT NULL DEFAULT 'specialist',
  `user_patron` int(11) DEFAULT 0 COMMENT 'ID of the user that recommended the current user',
  `user_comments` text DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

CREATE TABLE `users_bkp_old` (
  `user_id` int(10) UNSIGNED NOT NULL,
  `user_name` varchar(255) DEFAULT NULL,
  `user_firstname` varchar(255) DEFAULT NULL,
  `user_lastname` varchar(255) DEFAULT NULL,
  `user_county` varchar(255) DEFAULT NULL,
  `user_city` varchar(255) DEFAULT NULL,
  `user_address` text DEFAULT NULL,
  `user_email` varchar(255) DEFAULT NULL,
  `user_phone` varchar(255) DEFAULT NULL,
  `user_password_reset` int(10) UNSIGNED NOT NULL DEFAULT 0,
  `user_password` varchar(255) DEFAULT NULL,
  `user_date` int(11) UNSIGNED NOT NULL DEFAULT 0,
  `user_last_login` int(10) UNSIGNED NOT NULL DEFAULT 0,
  `user_ip` varchar(15) DEFAULT NULL,
  `user_status` tinyint(3) UNSIGNED NOT NULL DEFAULT 0 COMMENT '0=inactiv, 1=activ, 2=banat',
  `user_newsletter` tinyint(3) UNSIGNED NOT NULL DEFAULT 0 COMMENT '0=inactiv, 1=activ, 2=dezabonat, 3=returned',
  `user_newsletter_date` int(10) UNSIGNED DEFAULT 0,
  `user_skills` text DEFAULT NULL COMMENT 'json array of skill levels',
  `user_level` varchar(64) NOT NULL DEFAULT 'specialist',
  `user_patron` int(11) DEFAULT 0 COMMENT 'ID of the user that recommended the current user',
  `user_comments` text DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

CREATE TABLE `videos` (
  `video_id` int(10) UNSIGNED NOT NULL,
  `video_title` varchar(255) DEFAULT NULL,
  `video_embed` text DEFAULT NULL,
  `video_date_added` int(11) DEFAULT NULL,
  `video_status` tinyint(4) DEFAULT 0
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

CREATE TABLE `visitors` (
  `visitor_id` int(11) NOT NULL,
  `visitor_firstname` varchar(255) DEFAULT NULL,
  `visitor_lastname` varchar(255) DEFAULT NULL,
  `visitor_email` varchar(255) DEFAULT NULL,
  `visitor_phone` varchar(255) DEFAULT NULL,
  `visitor_status` tinyint(4) NOT NULL DEFAULT 1,
  `visitor_date_added` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;


ALTER TABLE `events`
  ADD PRIMARY KEY (`event_id`),
  ADD KEY `news_activ` (`event_status`),
  ADD KEY `news_type` (`event_type`),
  ADD KEY `event_end_date` (`event_end_date`);

ALTER TABLE `events_photos`
  ADD PRIMARY KEY (`photo_id`),
  ADD KEY `news_id` (`event_id`,`photo_main`);

ALTER TABLE `fields`
  ADD PRIMARY KEY (`field_id`),
  ADD KEY `location_id` (`location_id`),
  ADD KEY `field_status` (`field_status`),
  ADD KEY `field_type` (`field_type`(1));

ALTER TABLE `fields_prices`
  ADD PRIMARY KEY (`price_id`),
  ADD KEY `field_id` (`field_id`);

ALTER TABLE `gdpr_accepts`
  ADD PRIMARY KEY (`acceptance_id`);

ALTER TABLE `gdpr_requests`
  ADD PRIMARY KEY (`request_id`);

ALTER TABLE `invitations`
  ADD PRIMARY KEY (`invitation_id`),
  ADD KEY `invitation_from_user_id` (`invitation_from_user_id`) USING BTREE,
  ADD KEY `invitation_to_user_id` (`invitation_to_user_id`) USING BTREE,
  ADD KEY `invitation_location_id` (`invitation_location_id`);

ALTER TABLE `league_awards`
  ADD PRIMARY KEY (`award_id`),
  ADD KEY `player_id` (`player_id`);

ALTER TABLE `league_categories`
  ADD PRIMARY KEY (`category_id`),
  ADD KEY `league_id` (`league_id`);

ALTER TABLE `league_groups`
  ADD PRIMARY KEY (`group_id`),
  ADD KEY `category_id` (`category_id`);

ALTER TABLE `league_leagues`
  ADD PRIMARY KEY (`league_id`);

ALTER TABLE `league_matches`
  ADD PRIMARY KEY (`match_id`),
  ADD KEY `player_id` (`player1_id`,`player2_id`,`match_winner`,`match_absentee`),
  ADD KEY `group_id` (`group_id`),
  ADD KEY `stage_id` (`stage_id`),
  ADD KEY `match_played` (`match_played`) USING BTREE,
  ADD KEY `match_status` (`match_status`);

ALTER TABLE `league_players`
  ADD PRIMARY KEY (`player_id`),
  ADD KEY `group_id` (`group_id`),
  ADD KEY `league_id` (`league_id`),
  ADD KEY `player_status` (`player_status`);

ALTER TABLE `league_rankings`
  ADD PRIMARY KEY (`rank_id`),
  ADD KEY `player_id` (`player_id`);

ALTER TABLE `league_scores`
  ADD PRIMARY KEY (`score_id`),
  ADD KEY `match_id` (`match_id`) USING BTREE;

ALTER TABLE `league_seasons`
  ADD PRIMARY KEY (`season_id`),
  ADD KEY `league_id` (`league_id`);

ALTER TABLE `league_stages`
  ADD PRIMARY KEY (`stage_id`),
  ADD KEY `season_id` (`season_id`),
  ADD KEY `stage_active` (`stage_started`,`stage_ended`);

ALTER TABLE `locations`
  ADD PRIMARY KEY (`location_id`),
  ADD KEY `location_status` (`location_status`);

ALTER TABLE `news`
  ADD PRIMARY KEY (`news_id`),
  ADD KEY `news_activ` (`news_activ`),
  ADD KEY `news_type` (`news_type`);

ALTER TABLE `newsletter_emails`
  ADD PRIMARY KEY (`eid`),
  ADD UNIQUE KEY `email` (`email`),
  ADD KEY `status` (`status`),
  ADD KEY `sursa` (`sursa`);

ALTER TABLE `newsletter_newsletter`
  ADD PRIMARY KEY (`n_id`),
  ADD KEY `n_template` (`n_template`),
  ADD KEY `n_trimis` (`n_trimis`),
  ADD KEY `n_data_trimitere` (`n_data_trimitere`),
  ADD KEY `n_send_pending` (`n_send_pending`);

ALTER TABLE `newsletter_stats`
  ADD UNIQUE KEY `site_id_2` (`email`,`newsletter_id`),
  ADD KEY `user_id` (`email`),
  ADD KEY `newsletter_id` (`newsletter_id`);

ALTER TABLE `news_photos`
  ADD PRIMARY KEY (`photo_id`),
  ADD KEY `news_id` (`news_id`,`photo_main`);

ALTER TABLE `orders`
  ADD PRIMARY KEY (`order_id`),
  ADD KEY `user_id` (`user_id`),
  ADD KEY `order_type` (`order_type`),
  ADD KEY `order_type_id` (`order_type_id`);

ALTER TABLE `payU_IPN`
  ADD PRIMARY KEY (`ipn_id`);

ALTER TABLE `photoAlbum_categories`
  ADD PRIMARY KEY (`category_id`),
  ADD KEY `category_active` (`category_active`),
  ADD KEY `category_parent_id` (`category_parent_id`);

ALTER TABLE `photoAlbum_photos`
  ADD PRIMARY KEY (`photo_id`),
  ADD KEY `category_id` (`category_id`),
  ADD KEY `photo_order` (`photo_order`);

ALTER TABLE `registrations`
  ADD PRIMARY KEY (`registration_id`),
  ADD KEY `registration_type` (`registration_type`,`user_id`),
  ADD KEY `item_id` (`item_id`);

ALTER TABLE `reservations`
  ADD PRIMARY KEY (`reservation_id`),
  ADD KEY `reservation_visible` (`reservation_visible`),
  ADD KEY `reservation_notified` (`reservation_notified`),
  ADD KEY `user_id` (`user_id`),
  ADD KEY `field_id` (`field_id`),
  ADD KEY `reservation_date` (`reservation_date`),
  ADD KEY `reservation_type` (`reservation_type`),
  ADD KEY `reservation_status` (`reservation_status`),
  ADD KEY `reservation_attended` (`reservation_attended`),
  ADD KEY `trainer_id` (`trainer_id`);

ALTER TABLE `reservations_copy_20240304`
  ADD PRIMARY KEY (`reservation_id`),
  ADD KEY `user_id` (`user_id`,`field_id`,`reservation_date`,`reservation_start_hour`,`reservation_end_hour`,`reservation_type`,`reservation_status`,`reservation_payment_type`,`reservation_payed`,`reservation_attended`),
  ADD KEY `reservation_canceled_by_user_id` (`reservation_canceled_by_user_id`),
  ADD KEY `news_id` (`event_id`),
  ADD KEY `training_id` (`training_id`),
  ADD KEY `reservation_visible` (`reservation_visible`),
  ADD KEY `reservation_notified` (`reservation_notified`),
  ADD KEY `reservation_added_by_user_id` (`reservation_added_by_user_id`);

ALTER TABLE `reservations_waiting_list`
  ADD PRIMARY KEY (`wait_id`),
  ADD KEY `user_id` (`user_id`,`reservation_id`),
  ADD KEY `field_type` (`field_type`,`reservation_date`);

ALTER TABLE `seo_`
  ADD PRIMARY KEY (`seo_id`),
  ADD KEY `seo_url` (`seo_url`);

ALTER TABLE `seo_events`
  ADD PRIMARY KEY (`seo_id`),
  ADD KEY `seo_url` (`seo_url`);

ALTER TABLE `seo_invitations`
  ADD PRIMARY KEY (`seo_id`),
  ADD KEY `seo_url` (`seo_url`);

ALTER TABLE `seo_news`
  ADD PRIMARY KEY (`seo_id`),
  ADD KEY `seo_url` (`seo_url`);

ALTER TABLE `seo_newsletter`
  ADD PRIMARY KEY (`seo_id`),
  ADD KEY `seo_url` (`seo_url`);

ALTER TABLE `seo_photoalbum`
  ADD PRIMARY KEY (`seo_id`),
  ADD KEY `seo_url` (`seo_url`);

ALTER TABLE `seo_reservations`
  ADD PRIMARY KEY (`seo_id`),
  ADD KEY `seo_url` (`seo_url`);

ALTER TABLE `seo_subscriptions`
  ADD PRIMARY KEY (`seo_id`),
  ADD KEY `seo_url` (`seo_url`);

ALTER TABLE `seo_urls`
  ADD PRIMARY KEY (`seo_id`),
  ADD KEY `seo_url` (`seo_url`);

ALTER TABLE `seo_user`
  ADD PRIMARY KEY (`seo_id`),
  ADD KEY `seo_url` (`seo_url`);

ALTER TABLE `settings`
  ADD PRIMARY KEY (`setting_id`),
  ADD UNIQUE KEY `group` (`setting_group`,`setting_key`);

ALTER TABLE `sports`
  ADD PRIMARY KEY (`sport_id`);

ALTER TABLE `static_pages`
  ADD PRIMARY KEY (`sp_id`),
  ADD KEY `sp_status` (`sp_status`);
ALTER TABLE `static_pages` ADD FULLTEXT KEY `sp_title` (`sp_title`,`sp_text`);

ALTER TABLE `subscriptions`
  ADD PRIMARY KEY (`subscription_id`),
  ADD KEY `subscription_code` (`subscription_code`),
  ADD KEY `subscriptionType_id` (`subscriptionType_id`),
  ADD KEY `user_id` (`user_id`),
  ADD KEY `subscription_status` (`subscription_status`);

ALTER TABLE `subscriptionsCoupons`
  ADD PRIMARY KEY (`coupon_id`),
  ADD KEY `subscriptionType_id` (`subscriptionType_id`,`visitor_id`,`user_id`,`coupon_code`,`status`),
  ADD KEY `subscription_id` (`subscription_id`);

ALTER TABLE `subscriptionsTypes`
  ADD PRIMARY KEY (`subscriptionType_id`),
  ADD KEY `subscriptionType_kind` (`subscriptionType_kind`);

ALTER TABLE `subscriptions_copy_20240304`
  ADD PRIMARY KEY (`subscription_id`),
  ADD KEY `subcriptionType_id` (`subscriptionType_id`,`user_id`,`subscription_date_start`,`subscription_date_end`,`subscription_payment_method`,`subscription_payment_status`,`subscription_status`),
  ADD KEY `subscription_code` (`subscription_code`);

ALTER TABLE `trainings`
  ADD PRIMARY KEY (`training_id`),
  ADD KEY `user_id` (`coach_id`),
  ADD KEY `reservation_id` (`reservation_id`);

ALTER TABLE `users`
  ADD PRIMARY KEY (`user_id`),
  ADD KEY `activ` (`user_status`),
  ADD KEY `level` (`user_level`),
  ADD KEY `user_newsletter` (`user_newsletter`),
  ADD KEY `user_status` (`user_status`);

ALTER TABLE `users_bkp`
  ADD PRIMARY KEY (`user_id`),
  ADD KEY `activ` (`user_status`),
  ADD KEY `level` (`user_level`),
  ADD KEY `user_newsletter` (`user_newsletter`),
  ADD KEY `user_status` (`user_status`);

ALTER TABLE `users_bkp_old`
  ADD PRIMARY KEY (`user_id`),
  ADD KEY `data_adaugarii` (`user_date`),
  ADD KEY `activ` (`user_status`),
  ADD KEY `level` (`user_level`),
  ADD KEY `ip` (`user_ip`),
  ADD KEY `utilizator` (`user_email`),
  ADD KEY `user_newsletter` (`user_newsletter`);

ALTER TABLE `videos`
  ADD PRIMARY KEY (`video_id`),
  ADD KEY `video_active` (`video_status`);

ALTER TABLE `visitors`
  ADD PRIMARY KEY (`visitor_id`);


ALTER TABLE `events`
  MODIFY `event_id` int(12) NOT NULL AUTO_INCREMENT;

ALTER TABLE `events_photos`
  MODIFY `photo_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

ALTER TABLE `fields`
  MODIFY `field_id` int(11) NOT NULL AUTO_INCREMENT;

ALTER TABLE `fields_prices`
  MODIFY `price_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

ALTER TABLE `gdpr_accepts`
  MODIFY `acceptance_id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT;

ALTER TABLE `gdpr_requests`
  MODIFY `request_id` int(11) NOT NULL AUTO_INCREMENT;

ALTER TABLE `invitations`
  MODIFY `invitation_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

ALTER TABLE `league_awards`
  MODIFY `award_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

ALTER TABLE `league_categories`
  MODIFY `category_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

ALTER TABLE `league_groups`
  MODIFY `group_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

ALTER TABLE `league_leagues`
  MODIFY `league_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

ALTER TABLE `league_matches`
  MODIFY `match_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

ALTER TABLE `league_players`
  MODIFY `player_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

ALTER TABLE `league_rankings`
  MODIFY `rank_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

ALTER TABLE `league_scores`
  MODIFY `score_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

ALTER TABLE `league_seasons`
  MODIFY `season_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

ALTER TABLE `league_stages`
  MODIFY `stage_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

ALTER TABLE `locations`
  MODIFY `location_id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT;

ALTER TABLE `news`
  MODIFY `news_id` int(12) NOT NULL AUTO_INCREMENT;

ALTER TABLE `newsletter_emails`
  MODIFY `eid` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

ALTER TABLE `newsletter_newsletter`
  MODIFY `n_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

ALTER TABLE `news_photos`
  MODIFY `photo_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

ALTER TABLE `orders`
  MODIFY `order_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

ALTER TABLE `payU_IPN`
  MODIFY `ipn_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

ALTER TABLE `photoAlbum_categories`
  MODIFY `category_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

ALTER TABLE `photoAlbum_photos`
  MODIFY `photo_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

ALTER TABLE `registrations`
  MODIFY `registration_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

ALTER TABLE `reservations`
  MODIFY `reservation_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

ALTER TABLE `reservations_copy_20240304`
  MODIFY `reservation_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

ALTER TABLE `reservations_waiting_list`
  MODIFY `wait_id` int(11) NOT NULL AUTO_INCREMENT;

ALTER TABLE `seo_`
  MODIFY `seo_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

ALTER TABLE `seo_events`
  MODIFY `seo_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

ALTER TABLE `seo_invitations`
  MODIFY `seo_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

ALTER TABLE `seo_news`
  MODIFY `seo_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

ALTER TABLE `seo_newsletter`
  MODIFY `seo_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

ALTER TABLE `seo_photoalbum`
  MODIFY `seo_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

ALTER TABLE `seo_reservations`
  MODIFY `seo_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

ALTER TABLE `seo_subscriptions`
  MODIFY `seo_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

ALTER TABLE `seo_urls`
  MODIFY `seo_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

ALTER TABLE `seo_user`
  MODIFY `seo_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

ALTER TABLE `settings`
  MODIFY `setting_id` int(11) NOT NULL AUTO_INCREMENT;

ALTER TABLE `sports`
  MODIFY `sport_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

ALTER TABLE `static_pages`
  MODIFY `sp_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

ALTER TABLE `subscriptions`
  MODIFY `subscription_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

ALTER TABLE `subscriptionsCoupons`
  MODIFY `coupon_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

ALTER TABLE `subscriptionsTypes`
  MODIFY `subscriptionType_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

ALTER TABLE `subscriptions_copy_20240304`
  MODIFY `subscription_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

ALTER TABLE `trainings`
  MODIFY `training_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

ALTER TABLE `users`
  MODIFY `user_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

ALTER TABLE `users_bkp`
  MODIFY `user_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

ALTER TABLE `users_bkp_old`
  MODIFY `user_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

ALTER TABLE `videos`
  MODIFY `video_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

ALTER TABLE `visitors`
  MODIFY `visitor_id` int(11) NOT NULL AUTO_INCREMENT;
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
