CREATE TABLE continent (
	id INT auto_increment NOT NULL,
	name varchar(100) NULL,
	CONSTRAINT continent_pk PRIMARY KEY (id)
)

ALTER TABLE tour ADD code varchar(100) NOT NULL;


ALTER TABLE country ADD id_continent INT DEFAULT 5 NOT NULL;


CREATE TABLE `user_refresh_tokens` (
	`user_refresh_tokenID` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
	`urf_userID` INT(10) UNSIGNED NOT NULL,
	`urf_token` VARCHAR(1000) NOT NULL,
	`urf_ip` VARCHAR(50) NOT NULL,
	`urf_user_agent` VARCHAR(1000) NOT NULL,
	`urf_created` DATETIME NOT NULL COMMENT 'UTC',
	PRIMARY KEY (`user_refresh_tokenID`)
)
COMMENT='For JWT authentication process';



CREATE TABLE IF NOT EXISTS `booking_payment` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `charge_id` varchar(180) NOT NULL DEFAULT '0',
  `livemode` tinyint NOT NULL DEFAULT (0),
  `tour_booking_id` tinyint NOT NULL DEFAULT (0),
  `created_at` varchar(50) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
);


ALTER TABLE tour_availability MODIFY COLUMN `day` int NULL;



CREATE TABLE `tour_optional_extra` (
	`id` INT NOT NULL AUTO_INCREMENT,
	`name` VARCHAR(180) NOT NULL DEFAULT '',
	`name_esp` VARCHAR(180) NOT NULL DEFAULT '',
	`active` TINYINT NOT NULL DEFAULT (1),
	`name_key` VARCHAR(180) NOT NULL DEFAULT '',
	PRIMARY KEY (`id`)
);





CREATE TABLE `tour_guide_type` (
	`id` INT NOT NULL AUTO_INCREMENT,
	`name` VARCHAR(150) NOT NULL DEFAULT '',
	`name_eng` VARCHAR(150) NOT NULL DEFAULT '',
	`active` VARCHAR(150) NOT NULL DEFAULT '',
	PRIMARY KEY (`id`)
);


CREATE TABLE `tour_extra_language` (
	`id` INT NOT NULL AUTO_INCREMENT,
	`name` VARCHAR(150) NOT NULL DEFAULT '',
	`name_eng` VARCHAR(150) NOT NULL DEFAULT '',
	`active` TINYINT NOT NULL DEFAULT (0),
	PRIMARY KEY (`id`)
);



CREATE TABLE `tour_extra_duration` (
	`id` INT NOT NULL AUTO_INCREMENT,
	`name` VARCHAR(150) NOT NULL DEFAULT '',
	`name_eng` VARCHAR(150) NOT NULL DEFAULT '',
	`active` TINYINT NOT NULL DEFAULT (0),
	PRIMARY KEY (`id`)
);


CREATE TABLE `tour_extra_vehicle` (
	`id` INT NOT NULL AUTO_INCREMENT,
	`name` VARCHAR(150) NOT NULL DEFAULT '',
	`name_eng` VARCHAR(150) NOT NULL DEFAULT '',
	`active` TINYINT NOT NULL DEFAULT (0),
	PRIMARY KEY (`id`)
);


CREATE TABLE `tour_extra_vehicle_extra` (
	`id` INT NOT NULL AUTO_INCREMENT,
	`name` VARCHAR(150) NOT NULL DEFAULT '',
	`name_eng` VARCHAR(150) NOT NULL DEFAULT '',
	`active` TINYINT NOT NULL DEFAULT (0),
	PRIMARY KEY (`id`)
);



CREATE TABLE `tour_extras` (
	`id` INT NOT NULL AUTO_INCREMENT,
	`name` VARCHAR(150) NOT NULL DEFAULT '',
	`name_eng` VARCHAR(150) NOT NULL DEFAULT '',
	`type` VARCHAR(150) NOT NULL DEFAULT '',
	`active` TINYINT NOT NULL DEFAULT (0),
	PRIMARY KEY (`id`)
);




CREATE TABLE  `tour_meeting_points` (
  `id` int NOT NULL AUTO_INCREMENT,
  `lat` varchar(50) NOT NULL DEFAULT '',
  `lon` varchar(50) NOT NULL DEFAULT '',
  `address` varchar(250) NOT NULL DEFAULT '',
  `id_tour_details` int NOT NULL DEFAULT (0),
  `pickup` varchar(50) NOT NULL DEFAULT 'downtown',
  PRIMARY KEY (`id`)
);


ALTER TABLE `tour_booking_config`
	CHANGE COLUMN `on_request` `on_request` INT NULL DEFAULT '0' AFTER `max_pax`;