-- Active: 1746429579235@@localhost@3306@snapmome_2016
CREATE TABLE
  `event_type` (
    `id` INT NOT NULL,
    `name` VARCHAR(255) NOT NULL,
    `status` INT (1) NOT NULL
  )
  -- //////////////////////
CREATE TABLE
  `package` (
    `id` INT NOT NULL,
    `name` VARCHAR(255) NOT NULL,
    `amt` INT (11) NOT NULL DEFAULT 0,
    `status` INT (1) NOT NULL
  )
-- //////////////////////
CREATE TABLE
  `addons` (
    `id` INT NOT NULL AUTO_INCREMENT,
    `name` VARCHAR(255) NOT NULL,
    `amt` INT (11) NOT NULL DEFAULT 0,
    `status` INT (1) NOT NULL,
    PRIMARY KEY (`id`),
    UNIQUE `addons_name_uk` (`name`)
  )
  -- //////////////////////


-- //////////////////////
-- //////////////////////

INSERT INTO
  `event_type` (`id`, `name`, `status`)
VALUES
  (1, 'Wedding', 1),
  (2, 'Reception', 1),
  (3, 'Engagement', 1),
  (4, 'Halud', 1),
  (5, 'Mehadi', 1),
  (6, 'Akhd', 1),
  (7, 'Anniversary', 1),
  (8, 'Rong Khela', 1),
  (9, 'Ashirbad', 1),
  (10, 'Birthday', 1),
  (11, 'Architectural', 1),
  (12, 'Corporate', 1),
  (13, 'Fashion & Lifetyle', 1);

INSERT INTO
  `package` (`id`, `name`, `amt`, `status`)
VALUES
  (1, 'Standard - I', 17900, 1),
  (2, 'Standard - II', 28900, 1),
  (3, 'Standard - III', 48900, 1),
  (4, 'Premium - I', 25000, 1),
  (5, 'Premium - II', 36000, 1),
  (6, 'Premium - III', 50000, 1),
  (7, 'Elite - I', 65000, 1),
  (8, 'Elite - II', 100000, 1),
  (9, 'Sonaton - Standrad', 68000, 1),
  (10, 'Sonaton - Premium', 117000, 1),
  (11, 'Only Photography', 7900, 1),
  (12, 'Only Photography - Premium', 18000, 1),
  (13, 'Other', 0, 1);

ALTER TABLE `event_type` ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `event_type_name_uk` (`name`);

ALTER TABLE `package` ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `package_name_uk` (`name`);

ALTER TABLE `event_type` MODIFY `id` int (11) NOT NULL AUTO_INCREMENT,
AUTO_INCREMENT = 1;

ALTER TABLE `package` MODIFY `id` int (11) NOT NULL AUTO_INCREMENT,
AUTO_INCREMENT = 1;

-- //////////////////////
CREATE TABLE
  `package_discount` (
    `id` INT NOT NULL AUTO_INCREMENT,
    `package_id` INT NOT NULL,
    `valid_from` DATE NOT NULL,
    `valid_until` DATE NOT NULL,
    `discount_amt` INT (11) NOT NULL DEFAULT 0,
    PRIMARY KEY (`id`),
    CONSTRAINT `package_discount_package_id_fk` FOREIGN KEY (`package_id`) REFERENCES `package` (`id`)
  );

  CREATE TABLE
  `package_details` (
    `id` INT NOT NULL AUTO_INCREMENT,
    `package_id` INT (11) NOT NULL,
    `title` VARCHAR(255) NOT NULL,
    `details` VARCHAR(255) NOT NULL,
    `status` INT (1) NOT NULL,
    PRIMARY KEY (`id`),
    CONSTRAINT `details_package_id_fk` FOREIGN KEY (`package_id`) REFERENCES `package` (`id`),
    UNIQUE `details_package_id_uk` (`package_id`, `title`)
  );
-- //////////////////////
-- //////////////////////


RENAME TABLE `payment_info` TO `event_payment`;

