[
  {
    "type": "create_table",
    "description": "Create schedulePositions table for store job positions with colors",
    "database": "{{store}}",
    "check_query": "SHOW TABLES LIKE 'schedulePositions'",
    "sql": "CREATE TABLE `schedulePositions` (\n  `positionId` int(10) unsigned NOT NULL AUTO_INCREMENT,\n  `name` varchar(100) NOT NULL COMMENT 'Position display name',\n  `color` varchar(20) NOT NULL COMMENT 'Hex color for calendar display',\n  `sortOrder` int(10) NOT NULL DEFAULT 0 COMMENT 'Display order in lists',\n  `isActive` tinyint(1) NOT NULL DEFAULT 1 COMMENT 'Whether position is active',\n  `createdByUserId` int(10) unsigned NOT NULL COMMENT 'User who created position',\n  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),\n  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),\n  `deleted_at` timestamp NULL DEFAULT NULL COMMENT 'Soft delete timestamp',\n  PRIMARY KEY (`positionId`),\n  UNIQUE KEY `idx_name` (`name`),\n  KEY `idx_active` (`isActive`),\n  KEY `idx_sortOrder` (`sortOrder`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Store job positions for scheduling'"
  },
  {
    "type": "insert",
    "description": "Insert default positions for new stores",
    "database": "{{store}}",
    "check_query": "SELECT positionId FROM schedulePositions WHERE name = 'Owner' LIMIT 1",
    "sql": "INSERT INTO `schedulePositions` (`name`, `color`, `sortOrder`, `isActive`, `createdByUserId`) VALUES\n('Owner', '#1e293b', 1, 1, 1),\n('General Manager', '#7c3aed', 2, 1, 1),\n('Store Manager', '#2563eb', 3, 1, 1),\n('Shift Lead', '#ea580c', 4, 1, 1),\n('Buyer', '#16a34a', 5, 1, 1),\n('Sales Associate', '#0891b2', 6, 1, 1)"
  }
]
