   INDEX `transaction_product_id_idx` (`product_transaction_product_id` ASC),
   CONSTRAINT `transaction_product_id`
     FOREIGN KEY (`product_transaction_product_id`)
-    REFERENCES `emarket`.`product_info` (`product_id`)
-    ON DELETE CASCADE
-    ON UPDATE CASCADE)
-ENGINE = InnoDB;
-
-
--- -----------------------------------------------------
--- Table `emarket`.`payment_history`
--- -----------------------------------------------------
-CREATE TABLE IF NOT EXISTS `emarket`.`payment_history` (
+    REFERENCES `emarket_test`.`product_info` (`product_id`)
+    ON DELETE CASCADE
+    ON UPDATE CASCADE)
+ENGINE = InnoDB;
+
+
+-- -----------------------------------------------------
+-- Table `emarket_test`.`payment_history`
+-- -----------------------------------------------------
+CREATE TABLE IF NOT EXISTS `emarket_test`.`payment_history` (
   `payment_id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
   `payment_sender_user_id` INT UNSIGNED NOT NULL,
   `payment_recipient_user_id` INT UNSIGNED NOT NULL,

WHERE ps.product_spec_is_draft = 0;

-- -----------------------------------------------------
-- View `emarket`.`report_params`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `emarket`.`report_params`;
USE `emarket`;
CREATE  OR REPLACE VIEW report_params AS SELECT 5000 as operation_cost, 0.05 as sales_fee_percent;

-- -----------------------------------------------------
-- View `emarket`.`report_items`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `emarket`.`report_items`;
USE `emarket`;
CREATE  OR REPLACE VIEW report_items AS
SELECT  category_info.category_id,
    category_info.category_name,

  PRIMARY KEY (`user_login_id`),
  CONSTRAINT `login_user_id`
    FOREIGN KEY (`user_login_id`)
    REFERENCES `emarket_test`.`user_info` (`user_id`)
    ON DELETE CASCADE
    ON UPDATE CASCADE)
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `emarket_test`.`address_history`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `emarket_test`.`address_history` (
  `address_id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
  `address_address` VARCHAR(255) NOT NULL,
  `address_country` VARCHAR(45) NOT NULL,
