-- CloudVault Initial Schema - Pairing Codes Table
CREATE TABLE IF NOT EXISTS `pairing_codes` (
  `id` int AUTO_INCREMENT NOT NULL,
  `code` varchar(6) NOT NULL,
  `device_id` varchar(255),
  `expires_at` timestamp NOT NULL,
  `used` boolean DEFAULT false,
  `created_at` timestamp DEFAULT (now()),
  CONSTRAINT `pairing_codes_id` PRIMARY KEY(`id`),
  CONSTRAINT `pairing_codes_code_unique` UNIQUE(`code`)
);
