-- Harmony e-Solution — full schema + seed data
-- Generated for MySQL / MariaDB (phpMyAdmin import)
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS=0;

DROP TABLE IF EXISTS `migrations`;
CREATE TABLE `migrations` (`id` INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, `migration` VARCHAR(255) NOT NULL, `batch` INT NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
INSERT INTO `migrations` (`migration`,`batch`) VALUES ('0001_01_01_000000_create_users_table',1);
INSERT INTO `migrations` (`migration`,`batch`) VALUES ('0001_01_01_000001_create_cache_table',1);
INSERT INTO `migrations` (`migration`,`batch`) VALUES ('0001_01_01_000002_create_jobs_table',1);
INSERT INTO `migrations` (`migration`,`batch`) VALUES ('2026_08_28_000001_create_machines_table',1);
INSERT INTO `migrations` (`migration`,`batch`) VALUES ('2026_08_28_000002_create_contact_submissions_table',1);
INSERT INTO `migrations` (`migration`,`batch`) VALUES ('2026_08_28_000003_create_industries_table',1);
INSERT INTO `migrations` (`migration`,`batch`) VALUES ('2026_08_28_000004_create_machine_categories_table',1);
INSERT INTO `migrations` (`migration`,`batch`) VALUES ('2026_08_28_000005_create_settings_table',1);

DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
  `id` BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
  `name` VARCHAR(255) NOT NULL,
  `email` VARCHAR(255) NOT NULL UNIQUE,
  `email_verified_at` TIMESTAMP NULL,
  `password` VARCHAR(255) NOT NULL,
  `remember_token` VARCHAR(100) NULL,
  `created_at` TIMESTAMP NULL,
  `updated_at` TIMESTAMP NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
INSERT INTO `users` (`name`,`email`,`email_verified_at`,`password`,`created_at`,`updated_at`) VALUES ('Harmony Admin','admin@harmonyesolution.com','2026-09-09 07:06:14','$2y$10$Y39yyzEPd8VC3N8XrhIDfeYIOsSTEkLY8Z8W1qnGYNrUYgHviUIC2','2026-09-09 07:06:14','2026-09-09 07:06:14');

DROP TABLE IF EXISTS `password_reset_tokens`;
CREATE TABLE `password_reset_tokens` (`email` VARCHAR(255) PRIMARY KEY, `token` VARCHAR(255) NOT NULL, `created_at` TIMESTAMP NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

DROP TABLE IF EXISTS `sessions`;
CREATE TABLE `sessions` (
  `id` VARCHAR(255) PRIMARY KEY,
  `user_id` BIGINT UNSIGNED NULL,
  `ip_address` VARCHAR(45) NULL,
  `user_agent` TEXT NULL,
  `payload` LONGTEXT NOT NULL,
  `last_activity` INT NOT NULL,
  INDEX (`user_id`), INDEX (`last_activity`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

DROP TABLE IF EXISTS `cache`;
CREATE TABLE `cache` (`key` VARCHAR(255) PRIMARY KEY, `value` MEDIUMTEXT NOT NULL, `expiration` INT NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
DROP TABLE IF EXISTS `cache_locks`;
CREATE TABLE `cache_locks` (`key` VARCHAR(255) PRIMARY KEY, `owner` VARCHAR(255) NOT NULL, `expiration` INT NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

DROP TABLE IF EXISTS `jobs`;
CREATE TABLE `jobs` (
  `id` BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
  `queue` VARCHAR(255) NOT NULL,
  `payload` LONGTEXT NOT NULL,
  `attempts` TINYINT UNSIGNED NOT NULL,
  `reserved_at` INT UNSIGNED NULL,
  `available_at` INT UNSIGNED NOT NULL,
  `created_at` INT UNSIGNED NOT NULL,
  INDEX(`queue`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
DROP TABLE IF EXISTS `job_batches`;
CREATE TABLE `job_batches` (
  `id` VARCHAR(255) PRIMARY KEY, `name` VARCHAR(255) NOT NULL, `total_jobs` INT NOT NULL,
  `pending_jobs` INT NOT NULL, `failed_jobs` INT NOT NULL, `failed_job_ids` LONGTEXT NOT NULL,
  `options` MEDIUMTEXT NULL, `cancelled_at` INT NULL, `created_at` INT NOT NULL, `finished_at` INT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
DROP TABLE IF EXISTS `failed_jobs`;
CREATE TABLE `failed_jobs` (
  `id` BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY, `uuid` VARCHAR(255) NOT NULL UNIQUE,
  `connection` TEXT NOT NULL, `queue` TEXT NOT NULL, `payload` LONGTEXT NOT NULL,
  `exception` LONGTEXT NOT NULL, `failed_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

DROP TABLE IF EXISTS `machine_categories`;
CREATE TABLE `machine_categories` (
  `id` BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
  `name` VARCHAR(255) NOT NULL UNIQUE,
  `description` TEXT NULL,
  `sort_order` INT UNSIGNED NOT NULL DEFAULT 0,
  `is_active` TINYINT(1) NOT NULL DEFAULT 1,
  `created_at` TIMESTAMP NULL, `updated_at` TIMESTAMP NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
INSERT INTO `machine_categories` (`name`,`description`,`sort_order`,`is_active`,`created_at`,`updated_at`) VALUES ('Spreading','Consistent, tension-controlled fabric laying for cleaner downstream cutting.',1,1,'2026-09-09 07:06:14','2026-09-09 07:06:14');
INSERT INTO `machine_categories` (`name`,`description`,`sort_order`,`is_active`,`created_at`,`updated_at`) VALUES ('Automatic Cutting','High-throughput multi-ply cutting engineered for precision and repeatability.',2,1,'2026-09-09 07:06:14','2026-09-09 07:06:14');
INSERT INTO `machine_categories` (`name`,`description`,`sort_order`,`is_active`,`created_at`,`updated_at`) VALUES ('Single-Layer Cutting','Agile digital cutting for samples, technical textiles, and short production runs.',3,1,'2026-09-09 07:06:14','2026-09-09 07:06:14');
INSERT INTO `machine_categories` (`name`,`description`,`sort_order`,`is_active`,`created_at`,`updated_at`) VALUES ('Supporting Equipment','Tables, preparation systems, and tools that complete the cutting-room workflow.',4,1,'2026-09-09 07:06:14','2026-09-09 07:06:14');

DROP TABLE IF EXISTS `machines`;
CREATE TABLE `machines` (
  `id` BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
  `slug` VARCHAR(255) NOT NULL UNIQUE,
  `model` VARCHAR(255) NOT NULL,
  `name` VARCHAR(255) NOT NULL,
  `category` VARCHAR(255) NOT NULL,
  `description` TEXT NOT NULL,
  `image` VARCHAR(255) NULL,
  `specs` JSON NULL,
  `features` JSON NULL,
  `sort_order` INT UNSIGNED NOT NULL DEFAULT 0,
  `is_featured` TINYINT(1) NOT NULL DEFAULT 1,
  `is_active` TINYINT(1) NOT NULL DEFAULT 1,
  `created_at` TIMESTAMP NULL, `updated_at` TIMESTAMP NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
INSERT INTO `machines` (`slug`,`model`,`name`,`category`,`description`,`image`,`specs`,`features`,`sort_order`,`is_featured`,`is_active`,`created_at`,`updated_at`) VALUES ('hrc-p-automatic-cutter','HRC-P','Automatic Fabric Cutting Machine','Automatic Cutting','A high-throughput cutting platform designed for stable multi-ply production and precise pattern execution.','https://image.made-in-china.com/2f0j00rpFkYIJqAMue/Bangzheng-Cloth-Cutting-Machine-Automatic-Textile-Cloth-Fabric-Cutting-Machine-Garment-Cutter-Plotter-Apparel-Machinery.webp','[{\"label\":\"Application\",\"value\":\"Multi-ply fabric\"},{\"label\":\"Workflow\",\"value\":\"Continuous production\"}]','[\"Precision cutting control\",\"Vacuum-assisted material hold\",\"Production-ready operating interface\",\"Modular cutting-room integration\"]',1,1,1,'2026-09-09 07:06:14','2026-09-09 07:06:14');
INSERT INTO `machines` (`slug`,`model`,`name`,`category`,`description`,`image`,`specs`,`features`,`sort_order`,`is_featured`,`is_active`,`created_at`,`updated_at`) VALUES ('hsp-series-spreader','HSP Series','Automatic Fabric Spreader','Spreading','Controlled fabric laying that supports consistent tension, alignment, and layer quality before cutting.','https://s.alicdn.com/@sc04/kf/Hdd2a9c82208c4dc28ad769af54a1a28cC/Automatic-Cloth-Spreading-Machine-China-Supplier-Cloth-Fabric-Spreading-Machine-for-Factory.jpg','[{\"label\":\"Application\",\"value\":\"Roll fabric\"},{\"label\":\"Workflow\",\"value\":\"Automated spreading\"}]','[\"Tension-aware spreading\",\"Edge alignment support\",\"Flexible roll handling\",\"Consistent layer preparation\"]',2,1,1,'2026-09-09 07:06:14','2026-09-09 07:06:14');
INSERT INTO `machines` (`slug`,`model`,`name`,`category`,`description`,`image`,`specs`,`features`,`sort_order`,`is_featured`,`is_active`,`created_at`,`updated_at`) VALUES ('hsc-digital-cutter','HSC Digital','Single-Layer Cutting System','Single-Layer Cutting','A flexible digital cutter for samples, short runs, and materials that demand agile changeovers.','https://image.made-in-china.com/365f3j00cHWVKqLyZbGp/CNC-Textile-Fabric-Cutter-Automatic-Clothes-Material-Cutting-Machine-for-Automotive-Interior.webp','[{\"label\":\"Application\",\"value\":\"Single-ply material\"},{\"label\":\"Workflow\",\"value\":\"Digital pattern cutting\"}]','[\"Fast pattern changeover\",\"Material versatility\",\"Digital workflow compatibility\",\"Sample-to-production flexibility\"]',3,1,1,'2026-09-09 07:06:14','2026-09-09 07:06:14');

DROP TABLE IF EXISTS `industries`;
CREATE TABLE `industries` (
  `id` BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
  `title` VARCHAR(255) NOT NULL,
  `description` TEXT NULL,
  `sort_order` INT UNSIGNED NOT NULL DEFAULT 0,
  `is_active` TINYINT(1) NOT NULL DEFAULT 1,
  `created_at` TIMESTAMP NULL, `updated_at` TIMESTAMP NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
INSERT INTO `industries` (`title`,`description`,`sort_order`,`is_active`,`created_at`,`updated_at`) VALUES ('Garment & Apparel','Woven, knitwear, sportswear, denim, uniforms, and fashion production.',1,1,'2026-09-09 07:06:14','2026-09-09 07:06:14');
INSERT INTO `industries` (`title`,`description`,`sort_order`,`is_active`,`created_at`,`updated_at`) VALUES ('Bags & Accessories','Accurate cutting for layered textiles, synthetic materials, and repeatable components.',2,1,'2026-09-09 07:06:14','2026-09-09 07:06:14');
INSERT INTO `industries` (`title`,`description`,`sort_order`,`is_active`,`created_at`,`updated_at`) VALUES ('Footwear','Flexible cutting workflows for fabric, foam, lining, and technical materials.',3,1,'2026-09-09 07:06:14','2026-09-09 07:06:14');
INSERT INTO `industries` (`title`,`description`,`sort_order`,`is_active`,`created_at`,`updated_at`) VALUES ('Upholstery','Digital and single-layer cutting for furniture textiles and complex nesting.',4,1,'2026-09-09 07:06:14','2026-09-09 07:06:14');
INSERT INTO `industries` (`title`,`description`,`sort_order`,`is_active`,`created_at`,`updated_at`) VALUES ('Automotive','Consistent processing for interior textiles, insulation, and composite materials.',5,1,'2026-09-09 07:06:14','2026-09-09 07:06:14');

DROP TABLE IF EXISTS `contact_submissions`;
CREATE TABLE `contact_submissions` (
  `id` BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
  `name` VARCHAR(255) NOT NULL,
  `company` VARCHAR(255) NULL,
  `country` VARCHAR(255) NULL,
  `email` VARCHAR(255) NULL,
  `machine_of_interest` VARCHAR(255) NULL,
  `message` TEXT NOT NULL,
  `is_read` TINYINT(1) NOT NULL DEFAULT 0,
  `created_at` TIMESTAMP NULL, `updated_at` TIMESTAMP NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

DROP TABLE IF EXISTS `settings`;
CREATE TABLE `settings` (
  `id` BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
  `site_name` VARCHAR(255) NOT NULL DEFAULT 'Harmony e-Solution',
  `hero_title` VARCHAR(255) NULL,
  `hero_subtitle` TEXT NULL,
  `hero_stats` JSON NULL,
  `about_eyebrow` VARCHAR(255) NULL,
  `about_heading` VARCHAR(255) NULL,
  `about_intro` TEXT NULL,
  `about_body` TEXT NULL,
  `timeline` JSON NULL,
  `global_presence_heading` VARCHAR(255) NULL,
  `global_presence_countries` JSON NULL,
  `contact_email` VARCHAR(255) NULL,
  `contact_phone` VARCHAR(255) NULL,
  `contact_address` VARCHAR(255) NULL,
  `footer_tagline` TEXT NULL,
  `contact_cta_heading` VARCHAR(255) NULL,
  `contact_cta_text` TEXT NULL,
  `created_at` TIMESTAMP NULL, `updated_at` TIMESTAMP NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
INSERT INTO `settings` (`site_name`,`hero_title`,`hero_subtitle`,`hero_stats`,`about_eyebrow`,`about_heading`,`about_intro`,`about_body`,`timeline`,`global_presence_heading`,`global_presence_countries`,`contact_email`,`contact_phone`,`contact_address`,`footer_tagline`,`contact_cta_heading`,`contact_cta_text`,`created_at`,`updated_at`) VALUES ('Harmony e-Solution','Precision in Every Cut.','Integrated spreading and cutting technology designed to make production faster, more consistent, and easier to control.','[{\"value\":\"33+\",\"label\":\"Years of combined industry experience\"},{\"value\":\"200+\",\"label\":\"Machines installed across markets\"},{\"value\":\"5+\",\"label\":\"Countries with Harmony systems\"}]','About Harmony','Experience transformed into better machinery.','Established in Hong Kong in 2019, Harmony e-Solution builds on decades of accumulated garment and cutting-room expertise.','Harmony was created to deliver dependable spreading, cutting, and supporting equipment for modern manufacturers. Our understanding reaches beyond the machine itself to fabric behavior, production flow, installation, and everyday operation.

That practical perspective helps us match technology with the requirements that actually matter on the factory floor.','[{\"year\":\"1990s\",\"label\":\"Industry experience begins\"},{\"year\":\"30+ years\",\"label\":\"Cutting-room expertise grows\"},{\"year\":\"2019\",\"label\":\"Harmony e-Solution established\"},{\"year\":\"Today\",\"label\":\"Systems operating internationally\"}]','Harmony around the world.','[\"Hong Kong\",\"China\",\"Indonesia\",\"Bangladesh\",\"Vietnam\",\"Malaysia\",\"Ethiopia\"]','mail@pukkaindonusa.com','+62 21 2255 0100','Ruko Osaka PIK 2, Tangerang, Banten','Industrial spreading and cutting machinery built around real production.','Machines are only the beginning. Local support completes the solution.','Harmony machines are represented, installed, and supported in Indonesia by Pukka Indonusa.','2026-09-09 07:06:14','2026-09-09 07:06:14');

SET FOREIGN_KEY_CHECKS=1;
