-- Create admin_panel database if it doesn't exist
CREATE DATABASE IF NOT EXISTS admin_panel;
USE admin_panel;

-- Container notes table
CREATE TABLE IF NOT EXISTS container_notes (
  id INT AUTO_INCREMENT PRIMARY KEY,
  container_id VARCHAR(255) NOT NULL UNIQUE,
  container_name VARCHAR(255) NOT NULL,
  notes TEXT,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  INDEX idx_container_id (container_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- Container secrets table
CREATE TABLE IF NOT EXISTS container_secrets (
  id INT AUTO_INCREMENT PRIMARY KEY,
  container_id VARCHAR(255) NOT NULL UNIQUE,
  container_name VARCHAR(255) NOT NULL,
  secrets JSON,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  INDEX idx_container_id (container_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
