START TRANSACTION;

CREATE TABLE `sport` (
	`sport_id` INT(11) NOT NULL AUTO_INCREMENT,
	`name` CHAR(50) NOT NULL COLLATE 'utf8_hungarian_ci',
	PRIMARY KEY (`sport_id`) USING BTREE
)
COLLATE='utf8_hungarian_ci'
ENGINE=InnoDB
;

CREATE TABLE IF NOT EXISTS `sport_translation` (
  `translation_id` int(13) NOT NULL AUTO_INCREMENT,
  `language_code` char(2) NOT NULL DEFAULT 'en',
  `sport_id` int(13) NOT NULL DEFAULT 0,
  `sport_name` char(50) DEFAULT NULL,
  PRIMARY KEY (`translation_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4;

ALTER TABLE `customer`
	ADD COLUMN `sport_id` INT(13) NULL DEFAULT NULL AFTER `firebase_uid`;

ALTER TABLE `customer`
	ADD COLUMN `email_subscription` TINYINT(1) NULL DEFAULT 0 AFTER `sport_id`;


UPDATE configuration set config_value = "1.0.31", date_change=CURRENT_DATE WHERE config_key = "db_version";

COMMIT;

