API 1.1 WT Club, add customer_membership

This commit is contained in:
Tibor Bossanyi
2023-02-05 09:35:17 +01:00
parent 564e749bc2
commit cf3abdaf01
15 changed files with 71 additions and 102 deletions
+8 -5
View File
@@ -7,16 +7,19 @@ CREATE TABLE `membership` (
`duration` INT(11) NULL DEFAULT NULL,
`duration_type` ENUM('free','subscription','lifetime','limited') NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
`duration_unit` ENUM('day','week','month','year') NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
`training_plan_id` INT(11) NULL DEFAULT '0',
`training_plan_day_ids` CHAR(100) NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
PRIMARY KEY (`membership_id`) USING BTREE
);
INDEX `training_plan_id` (`training_plan_id`) USING BTREE,
)
ENGINE=InnoDB
;
CREATE TABLE `customer_membership` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`customer_id` INT(11) NOT NULL DEFAULT '0',
`membership_id` INT(11) NOT NULL DEFAULT '0',
`start_date` DATETIME NULL DEFAULT NULL,
`training_plan_id` INT(11) NULL DEFAULT NULL,
`days` CHAR(100) NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
PRIMARY KEY (`id`) USING BTREE,
INDEX `customer_id` (`customer_id`) USING BTREE,
INDEX `membership_id` (`membership_id`) USING BTREE
@@ -36,9 +39,9 @@ ALTER TABLE `customer_training_plan`
ALTER TABLE `customer`
CHANGE COLUMN `firebase_uid` `firebase_uid` CHAR(200) NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci' AFTER `body_type`;
ALTER TABLE `customer`
ADD COLUMN `id_token` TEXT NULL DEFAULT NULL AFTER `lang_sync`;
CHANGE COLUMN `firebase_reg_token` `firebase_reg_token` TEXT NULL COLLATE 'utf8mb4_general_ci' AFTER `trial_date`;
ALTER TABLE `customer`
ADD INDEX `id_token` (`id_token`);
ADD INDEX `firebase_reg_token` (`firebase_reg_token`);
UPDATE configuration set config_value = "1.1.0", date_change=CURRENT_DATE WHERE config_key = "db_version";