--
-- `#prefix#ProductSettings`
--
CREATE TABLE IF NOT EXISTS `#prefix#ProductSettings` (
    `id`                int(10) unsigned NOT NULL AUTO_INCREMENT,
    `product_id`        int(10)  NOT NULL,
    `setting`           VARCHAR(64) NOT NULL,
    `value`             VARCHAR(100),
    PRIMARY KEY (`id`),
    UNIQUE KEY `product_id` (`product_id`,`setting`)
    ) ENGINE=InnoDB DEFAULT CHARSET=#charset# DEFAULT COLLATE #collation#;

--
-- `#prefix#ProductReminders`
--
CREATE TABLE IF NOT EXISTS `#prefix#ProductReminders` (
    `id`                int(10) unsigned NOT NULL AUTO_INCREMENT,
    `product_id`        int(10) NOT NULL,
    `billing_cycle`     VARCHAR(100) NOT NULL,
    `template_id`       int(10) NOT NULL,
    `period`            int(10) NOT NULL,
    `status`            VARCHAR(4) NOT NULL,
    PRIMARY KEY (`id`)
    ) ENGINE=InnoDB DEFAULT CHARSET=#charset# DEFAULT COLLATE #collation#;

--
-- `#prefix#DiscountItems`
--
CREATE TABLE IF NOT EXISTS `#prefix#DiscountItems` (
    `id`                int(10) unsigned NOT NULL AUTO_INCREMENT,
    `product_id`        int(10) unsigned NOT NULL,
    `rule_id`           int(10) NOT NULL,
    `type`              varchar(100) NOT NULL,
    PRIMARY KEY (`id`)
    ) ENGINE=InnoDB DEFAULT CHARSET=#charset# DEFAULT COLLATE #collation#;

--
-- `#prefix#Discount`
--
CREATE TABLE IF NOT EXISTS `#prefix#Discount` (
    `id`                int(10) unsigned NOT NULL AUTO_INCREMENT,
    `name`              VARCHAR(100) NOT NULL,
    `type`              VARCHAR(100) NOT NULL,
    `value`             VARCHAR(100) NOT NULL,
    `enabled`           VARCHAR(4)   NOT NULL,
    `discount_type`     VARCHAR(100) NOT NULL,
    `cycle_from`        VARCHAR(100) NOT NULL,
    `cycle_to`          VARCHAR(100) NOT NULL,
    PRIMARY KEY (`id`)
    ) ENGINE=InnoDB DEFAULT CHARSET=#charset# DEFAULT COLLATE #collation#;

--
-- `#prefix#UsedDiscount`
--
CREATE TABLE IF NOT EXISTS `#prefix#UsedDiscounts` (
    `rule_id`       int(10) unsigned NOT NULL,
    `hosting_id`    int(10) unsigned NOT NULL,
    PRIMARY KEY (`rule_id`)
    ) ENGINE=InnoDB DEFAULT CHARSET=#charset# DEFAULT COLLATE #collation#;

--
-- `#prefix#ClientsSettings`
--
CREATE TABLE IF NOT EXISTS `#prefix#ClientsSettings` (
    `id`                int(10) unsigned NOT NULL AUTO_INCREMENT,
    `hosting_id`        int(10) unsigned NOT NULL,
    `setting`           VARCHAR(100) NOT NULL,
    `value`             VARCHAR(100),
    PRIMARY KEY (`id`)
    ) ENGINE=InnoDB DEFAULT CHARSET=#charset# DEFAULT COLLATE #collation#;

--
-- `#prefix#SendReminders`
--
CREATE TABLE IF NOT EXISTS `#prefix#SendReminders` (
    `id`                int(10) unsigned NOT NULL AUTO_INCREMENT,
    `reminder_id`       int(10)          NOT NULL,
    `client_id`         int(10)          NOT NULL,
    `date`              TIMESTAMP        NOT NULL,
    PRIMARY KEY (`id`)
    ) ENGINE=InnoDB DEFAULT CHARSET=#charset# DEFAULT COLLATE #collation#;

--
-- `#prefix#GeneralSettings`
--
CREATE TABLE IF NOT EXISTS `#prefix#SendReminders` (
    `id`            int(10) unsigned      NOT NULL AUTO_INCREMENT,
    `setting`       VARCHAR(100)          NOT NULL,
    `value`         VARCHAR(100)          NOT NULL,
    PRIMARY KEY (`id`)
    ) ENGINE=InnoDB DEFAULT CHARSET=#charset# DEFAULT COLLATE #collation#;

--
-- `#prefix#GeneralSettings`
--
CREATE TABLE IF NOT EXISTS `#prefix#GeneralSettings` (
    `id`            int(10) unsigned      NOT NULL AUTO_INCREMENT,
    `setting`       VARCHAR(100)          NOT NULL,
    `value`         VARCHAR(100)          NOT NULL,
    PRIMARY KEY (`id`)
    ) ENGINE=InnoDB DEFAULT CHARSET=#charset# DEFAULT COLLATE #collation#;

--
-- `#prefix#DiscountSettings`
--
CREATE TABLE IF NOT EXISTS `#prefix#DiscountSettings` (
    `id`            int(10) unsigned      NOT NULL AUTO_INCREMENT,
    `rule_id`       VARCHAR(100)          NOT NULL,
    `setting`       VARCHAR(100)          NOT NULL,
    `value`         VARCHAR(100)          NOT NULL,
    PRIMARY KEY (`id`)
    ) ENGINE=InnoDB DEFAULT CHARSET=#charset# DEFAULT COLLATE #collation#;