[
  {
    "type": "alter_table",
    "description": "Add real-world dimension fields to fpFloorPlans for square footage-based scaling",
    "database": "{{store}}",
    "check_query": "SHOW COLUMNS FROM fpFloorPlans LIKE 'widthFeet'",
    "sql": "ALTER TABLE `fpFloorPlans` ADD COLUMN `widthFeet` DECIMAL(8,2) NULL COMMENT 'Store width in feet' AFTER `gridSize`, ADD COLUMN `depthFeet` DECIMAL(8,2) NULL COMMENT 'Store depth in feet' AFTER `widthFeet`, ADD COLUMN `squareFootage` INT UNSIGNED NULL COMMENT 'Total square footage (computed or manual)' AFTER `depthFeet`, ADD COLUMN `pixelsPerFoot` DECIMAL(6,2) NOT NULL DEFAULT 20.00 COMMENT 'Scale: pixels per foot (20=1ft:20px)' AFTER `squareFootage`"
  },
  {
    "type": "update",
    "description": "Set default dimensions for existing floor plans based on gridSize",
    "database": "{{store}}",
    "check_query": "SELECT id FROM fpFloorPlans WHERE widthFeet IS NULL AND gridSize = 'small' LIMIT 1",
    "sql": "UPDATE `fpFloorPlans` SET widthFeet = 30, depthFeet = 40, squareFootage = 1200, pixelsPerFoot = 100, canvasWidth = 3000, canvasHeight = 4000 WHERE widthFeet IS NULL AND gridSize = 'small'"
  },
  {
    "type": "update",
    "description": "Set default dimensions for existing medium floor plans",
    "database": "{{store}}",
    "check_query": "SELECT id FROM fpFloorPlans WHERE widthFeet IS NULL AND gridSize = 'medium' LIMIT 1",
    "sql": "UPDATE `fpFloorPlans` SET widthFeet = 50, depthFeet = 70, squareFootage = 3500, pixelsPerFoot = 80, canvasWidth = 4000, canvasHeight = 5600 WHERE widthFeet IS NULL AND gridSize = 'medium'"
  },
  {
    "type": "update",
    "description": "Set default dimensions for existing large floor plans",
    "database": "{{store}}",
    "check_query": "SELECT id FROM fpFloorPlans WHERE widthFeet IS NULL AND gridSize = 'large' LIMIT 1",
    "sql": "UPDATE `fpFloorPlans` SET widthFeet = 50, depthFeet = 100, squareFootage = 5000, pixelsPerFoot = 80, canvasWidth = 4000, canvasHeight = 8000 WHERE widthFeet IS NULL AND gridSize = 'large'"
  }
]
