-- Adminer 4.7.1 MySQL dump

SET NAMES utf8;
SET time_zone = '+00:00';
SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';

CREATE TABLE `parsers` (
  `parser_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `parser_name` varchar(100) NOT NULL,
  `parser_file` varchar(100) NOT NULL,
  PRIMARY KEY (`parser_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;


CREATE TABLE `rel_site_source` (
  `rel_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `site_id` bigint(20) NOT NULL,
  `source_id` bigint(20) NOT NULL,
  `import` tinyint(1) NOT NULL DEFAULT 1,
  `date_last_import` datetime DEFAULT NULL,
  PRIMARY KEY (`rel_id`),
  UNIQUE KEY `site_source_uniq` (`site_id`,`source_id`),
  KEY `source_id` (`source_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;


CREATE TABLE `sites` (
  `site_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `status` varchar(1) NOT NULL DEFAULT 'A',
  `site_url` varchar(100) NOT NULL,
  `table_prefix` varchar(5) DEFAULT NULL,
  `table_group` varchar(15) DEFAULT NULL,
  PRIMARY KEY (`site_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;


CREATE TABLE `sites_data` (
  `rel_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `site_id` bigint(20) NOT NULL,
  `locale` varchar(3) DEFAULT NULL,
  `locale_lang` varchar(5) DEFAULT NULL,
  `project_name` varchar(50) NOT NULL,
  `site_name` varchar(50) NOT NULL,
  `home_title` varchar(200) DEFAULT NULL,
  `home_heading` varchar(100) DEFAULT NULL,
  `home_subhead` text DEFAULT NULL,
  `search_title` varchar(200) DEFAULT NULL,
  `brands_title` varchar(200) DEFAULT NULL,
  `shops_title` varchar(200) DEFAULT NULL,
  `terms_title` varchar(200) DEFAULT NULL,
  PRIMARY KEY (`rel_id`),
  KEY `site_id` (`site_id`),
  CONSTRAINT `sites_data_ibfk_1` FOREIGN KEY (`site_id`) REFERENCES `sites` (`site_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;


CREATE TABLE `sources` (
  `source_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `status` varchar(1) NOT NULL DEFAULT 'A',
  `source_website` varchar(75) NOT NULL,
  `source_campaign_id` int(7) NOT NULL,
  `source_campaign` varchar(75) NOT NULL,
  `source_slug` varchar(75) NOT NULL,
  `source_language` varchar(5) NOT NULL,
  `source_cart_freeshipping` decimal(6,2) DEFAULT NULL COMMENT 'Cart amount for free shipping',
  `source_cart_shipping` decimal(6,2) DEFAULT NULL COMMENT 'Standard shipping',
  `source_cart_minorder` decimal(6,2) DEFAULT NULL COMMENT 'Min. order',
  `source_commission` decimal(4,2) DEFAULT NULL,
  `date_created` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  PRIMARY KEY (`source_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;


CREATE TABLE `sources_data` (
  `rel_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `source_id` bigint(20) NOT NULL,
  `key` varchar(25) NOT NULL,
  `value` varchar(200) NOT NULL,
  PRIMARY KEY (`rel_id`),
  UNIQUE KEY `source_id_key` (`source_id`,`key`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;


CREATE TABLE `sources_feed` (
  `feed_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `source_id` bigint(20) NOT NULL,
  `site_id` bigint(20) DEFAULT NULL,
  `status` varchar(1) NOT NULL DEFAULT 'A',
  `import` tinyint(1) NOT NULL DEFAULT 1,
  `date_last_import` datetime DEFAULT NULL,
  `items` int(8) NOT NULL DEFAULT 0,
  `feed_url` varchar(2000) NOT NULL,
  `feed_root` varchar(50) DEFAULT NULL,
  `feed_note` varchar(150) DEFAULT NULL,
  `parser_id` bigint(20) NOT NULL,
  PRIMARY KEY (`feed_id`),
  KEY `source_id` (`source_id`),
  KEY `parser_id` (`parser_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;


CREATE TABLE `vouchers` (
  `voucher_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `source_id` bigint(20) NOT NULL,
  `status` varchar(1) NOT NULL DEFAULT 'A',
  `source_website` varchar(75) NOT NULL,
  `source_campaign_id` int(7) NOT NULL,
  `source_campaign` varchar(75) NOT NULL,
  `voucher_reference_id` varchar(35) NOT NULL,
  `voucher_code` varchar(100) NOT NULL,
  `voucher_date_from` datetime NOT NULL,
  `voucher_date_to` datetime DEFAULT NULL,
  `voucher_name` varchar(75) DEFAULT NULL,
  `voucher_description` tinytext NOT NULL,
  `voucher_url` varchar(255) NOT NULL,
  `voucher_condition` varchar(255) DEFAULT NULL,
  `voucher_discount_fixed` float(5,2) DEFAULT NULL,
  `voucher_discount_variable` float(5,2) DEFAULT NULL,
  `date_created` datetime DEFAULT NULL,
  `date_modified` datetime DEFAULT NULL,
  PRIMARY KEY (`voucher_id`),
  UNIQUE KEY `source_ref_data` (`source_id`,`source_website`,`voucher_reference_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;


-- 2025-01-31 10:45:09


