- Created new track-map page with aerial image and SVG overlay - Implemented custom rotated square markers with obstacle numbers - Added admin edit mode for placing and repositioning markers - Database migration for track_obstacles table - Modal form for adding new obstacles (replaces browser alerts) - Drag-to-reposition functionality with auto-save - Color-coded markers (green/red/black/split) for difficulty levels - Clickable popups showing obstacle details - Added track-map to navigation menu and sitemap - URL rewrite rule for clean /track-map URL
26 lines
1.5 KiB
SQL
26 lines
1.5 KiB
SQL
-- ============================================================================
|
|
-- MIGRATION: Create Track Obstacles Table
|
|
-- Date: 2025-12-12
|
|
-- Description: Create table to store 4x4 track obstacles with positioning and details
|
|
-- ============================================================================
|
|
|
|
CREATE TABLE IF NOT EXISTS track_obstacles (
|
|
obstacle_id INT PRIMARY KEY AUTO_INCREMENT,
|
|
name VARCHAR(100) NOT NULL COMMENT 'Obstacle name (e.g., "Rock Crawl", "Water Crossing")',
|
|
x_position INT NOT NULL COMMENT 'X pixel position on the track map',
|
|
y_position INT NOT NULL COMMENT 'Y pixel position on the track map',
|
|
difficulty VARCHAR(20) NOT NULL COMMENT 'Difficulty level (easy, medium, hard, extreme)',
|
|
description TEXT COMMENT 'Detailed description of the obstacle',
|
|
image_path VARCHAR(255) COMMENT 'Path to obstacle image (e.g., assets/images/obstacles/obstacle1.jpg)',
|
|
marker_color VARCHAR(20) NOT NULL COMMENT 'Marker color: red, green, black, or split (red-green)',
|
|
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
|
INDEX idx_name (name),
|
|
INDEX idx_difficulty (difficulty)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
|
|
-- ============================================================================
|
|
-- ROLLBACK INSTRUCTIONS (if needed)
|
|
-- ============================================================================
|
|
-- DROP TABLE IF EXISTS track_obstacles;
|