· 5 years ago · Jul 08, 2020, 10:34 AM
1CREATE TABLE IF NOT EXISTS `fanclubCamfeed` (`id` int(10) NOT NULL AUTO_INCREMENT,`performerId` int(10) NOT NULL,`type` int(10) NOT NULL,`description` varchar(255) DEFAULT NULL,`width` int(10) NOT NULL,`height` int(10) NOT NULL,`createDate` datetime NOT NULL,`access` int(2) NOT NULL,`duration` int(10) NOT NULL,`status` int(10) DEFAULT '0',PRIMARY KEY (`id`),KEY `performerId` (`performerId`));
2
3CREATE TABLE IF NOT EXISTS `fanclubCamfeedComments` (`cid` int(10) NOT NULL AUTO_INCREMENT,`feedId` int(10) NOT NULL,`senderId` int(10) NOT NULL,`senderType` int(10) NOT NULL,`text` varchar(255) DEFAULT NULL,`createDate` datetime DEFAULT NULL,`access` int(10) DEFAULT NULL,PRIMARY KEY (`cid`),KEY `feedId` (`feedId`));
4
5CREATE TABLE IF NOT EXISTS `fanclubCamfeedLikes` (`id` int(10) NOT NULL AUTO_INCREMENT,`feedId` int(10) NOT NULL,`customerId` int(10) NOT NULL DEFAULT '0',`customerIp` bigint(20) NOT NULL DEFAULT '0',PRIMARY KEY (`id`),UNIQUE KEY `customerIp` (`feedId`,`customerIp`),KEY `feedId` (`feedId`),KEY `customerId` (`customerId`));
6
7CREATE TABLE IF NOT EXISTS `fanclubCustomerShows` (`customer` int(10) DEFAULT NULL,`showId` int(10) DEFAULT NULL,`type` int(11) NOT NULL,`performer` int(10) DEFAULT NULL,UNIQUE KEY `entry` (`customer`,`showId`),KEY `cp` (`customer`,`performer`));
8
9CREATE TABLE IF NOT EXISTS `fanclubDiaries` (`id` int(10) NOT NULL AUTO_INCREMENT,`performerId` int(10) NOT NULL,`title` varchar(255) NOT NULL,`description` text NOT NULL,`createDate` datetime NOT NULL,`publishDate` datetime NOT NULL,`access` int(2) NOT NULL,`text` text,`price` double DEFAULT '0',PRIMARY KEY (`id`));
10
11
12CREATE TABLE IF NOT EXISTS `fanclubGoals` (`id` int(11) NOT NULL AUTO_INCREMENT,`performerId` int(11) NOT NULL,`currentCredits` decimal(8,2) NOT NULL,`minCredits` decimal(8,2) NOT NULL,`goalCredits` decimal(8,2) NOT NULL,`name` varchar(64) NOT NULL,`description` varchar(256) DEFAULT NULL,`startDate` datetime NOT NULL,`finishDate` datetime NOT NULL,`status` int(11) NOT NULL,PRIMARY KEY (`id`));
13
14CREATE TABLE IF NOT EXISTS `fanclubPictures` (`id` int(10) NOT NULL AUTO_INCREMENT,`setId` int(10) NOT NULL,`priority` int(10) DEFAULT NULL,`width` int(10) NOT NULL,`height` int(10) NOT NULL,PRIMARY KEY (`id`));
15
16CREATE TABLE IF NOT EXISTS `fanclubPurchases` (`id` int(10) NOT NULL AUTO_INCREMENT,`objectId` int(10) NOT NULL,`type` int(2) NOT NULL,`time` datetime NOT NULL,`amount` decimal(8,2) NOT NULL DEFAULT '0.00',`customerId` int(10) NOT NULL,`performerId` int(10) NOT NULL,`transactionId` int(10) NOT NULL,`refund` int(10) DEFAULT '0',PRIMARY KEY (`id`),UNIQUE KEY `transactionId` (`transactionId`),KEY `idx_objects` (`customerId`,`performerId`,`type`));
17
18CREATE TABLE IF NOT EXISTS `fanclubSets` (`id` int(10) NOT NULL AUTO_INCREMENT,`performerId` int(10) NOT NULL,`access` int(2) NOT NULL,`price` decimal(8,2) NOT NULL DEFAULT '0.00',`title` varchar(255) NOT NULL,`description` text NOT NULL,`createDate` datetime NOT NULL,`publishDate` datetime NOT NULL,`featuredPictureId` int(10) NOT NULL,`count` int(10) DEFAULT NULL,PRIMARY KEY (`id`),KEY `performerId` (`performerId`));
19
20CREATE TABLE IF NOT EXISTS `fanclubShows` (`id` int(10) NOT NULL AUTO_INCREMENT,`performerId` int(10) NOT NULL,`title` varchar(255) NOT NULL,`description` text NOT NULL,`createDate` datetime NOT NULL,`publishDate` datetime NOT NULL,`access` int(2) NOT NULL,`subjectId` int(10) NOT NULL,`duration` int(10) NOT NULL,`price` decimal(8,2) NOT NULL DEFAULT '0.00',`status` int(10) DEFAULT '0',PRIMARY KEY (`id`),UNIQUE KEY `subjectId` (`subjectId`),KEY `performerId` (`performerId`));
21
22CREATE TABLE IF NOT EXISTS `fanclubStoreItems` (`id` int(10) NOT NULL AUTO_INCREMENT,`performerId` int(10) NOT NULL,`access` int(2) NOT NULL,`price` decimal(8,2) NOT NULL DEFAULT '0.00',`title` varchar(255) NOT NULL,`description` text NOT NULL,`createDate` datetime NOT NULL,`publishDate` datetime NOT NULL,`type` int(10) NOT NULL,`count` int(10) DEFAULT NULL,`status` int(10) NOT NULL DEFAULT '0',PRIMARY KEY (`id`),KEY `performerId` (`performerId`));
23
24CREATE TABLE IF NOT EXISTS `fanclubVideos` (`id` int(10) NOT NULL AUTO_INCREMENT,`performerId` int(10) NOT NULL,`title` varchar(255) DEFAULT NULL,`description` varchar(255) DEFAULT NULL,`width` int(10) NOT NULL,`height` int(10) NOT NULL,`createDate` datetime NOT NULL,`publishDate` datetime NOT NULL,`access` int(2) NOT NULL,`duration` int(10) NOT NULL,`price` decimal(8,2) NOT NULL DEFAULT '0.00',`status` int(10) DEFAULT '0',PRIMARY KEY (`id`),KEY `performerId` (`performerId`));
25
26/*!50001 CREATE OR REPLACE VIEW `fanclubUpdates` AS select 1 AS `type`,`fanclubDiaries`.`id` AS `id`,`fanclubDiaries`.`performerId` AS `performerId`,concat(`fanclubDiaries`.`title`,' ',`fanclubDiaries`.`description`) AS `title`,`fanclubDiaries`.`publishDate` AS `publishDate`,`fanclubDiaries`.`access` AS `access` from `fanclubDiaries` where (`fanclubDiaries`.`access` > 0) union select 2 AS `type`,`fanclubShows`.`id` AS `id`,`fanclubShows`.`performerId` AS `performerId`,concat(`fanclubShows`.`title`,' ',`fanclubShows`.`description`) AS `title`,`fanclubShows`.`publishDate` AS `publishDate`,`fanclubShows`.`access` AS `access` from `fanclubShows` where (`fanclubShows`.`access` > 0) union select 3 AS `type`,`fanclubVideos`.`id` AS `id`,`fanclubVideos`.`performerId` AS `performerId`,concat(`fanclubVideos`.`title`,' ',`fanclubVideos`.`description`) AS `title`,`fanclubVideos`.`publishDate` AS `publishDate`,`fanclubVideos`.`access` AS `access` from `fanclubVideos` where (`fanclubVideos`.`access` > 0) union select 4 AS `type`,`fanclubSets`.`id` AS `id`,`fanclubSets`.`performerId` AS `performerId`,concat(`fanclubSets`.`title`,' ',`fanclubSets`.`description`) AS `title`,`fanclubSets`.`publishDate` AS `publishDate`,`fanclubSets`.`access` AS `access` from `fanclubSets` where (`fanclubSets`.`access` > 0) */
27
28ALTER TABLE fanclubSets ADD `status` INT DEFAULT 0 NOT NULL;