--
-- Host: localhost    Database: etherair_app
-- ------------------------------------------------------


--
-- Table structure for table `checkouts`
--

CREATE TABLE `checkouts` (
  `id` varchar(191) NOT NULL,
  `internal_id` varchar(64) NOT NULL,
  `owner_user_id` varchar(64) NOT NULL,
  `owner_email` varchar(255) NOT NULL,
  `plan_code` varchar(32) NOT NULL,
  `amount_usd` decimal(10,2) NOT NULL,
  `provider` varchar(64) NOT NULL,
  `status` varchar(64) NOT NULL,
  `hosted_url` text DEFAULT NULL,
  `raw_json` longtext DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  KEY `idx_checkouts_owner_created` (`owner_user_id`,`created_at`),
  CONSTRAINT `fk_checkouts_owner` FOREIGN KEY (`owner_user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `checkouts`
--



