-- https://www.phpmyadmin.net/
--

START TRANSACTION;



--
-- Database: `easepayn_sql`
--

-- --------------------------------------------------------

--
-- Table structure for table `spin_conversions`
--

CREATE TABLE `spin_conversions` (
  `id` int(11) NOT NULL,
  `user_id` varchar(100) NOT NULL,
  `mb_amount` int(11) NOT NULL,
  `naira_amount` decimal(10,2) NOT NULL,
  `conversion_date` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `spin_conversions`
--

INSERT INTO `spin_conversions` (`id`, `user_id`, `mb_amount`, `naira_amount`, `conversion_date`) VALUES
(1, '3U6XAH1M4J', 300, 150.00, '2026-02-11 15:44:52'),
(2, 'MA6W1KDT0Q', 71000, 35500.00, '2026-02-20 11:27:38');

-- --------------------------------------------------------

--
-- Table structure for table `spin_streaks`
--

CREATE TABLE `spin_streaks` (
  `id` int(11) NOT NULL,
  `user_id` varchar(255) NOT NULL,
  `start_date` date NOT NULL,
  `current_streak` int(11) NOT NULL DEFAULT 0,
  `last_spin_date` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `spin_streaks`
--

INSERT INTO `spin_streaks` (`id`, `user_id`, `start_date`, `current_streak`, `last_spin_date`) VALUES
(1, 'MA54HC6APQ', '2026-01-23', 1, '2026-01-23 00:00:00');

-- --------------------------------------------------------

--
-- Table structure for table `spin_winnings`
--

CREATE TABLE `spin_winnings` (
  `id` int(11) NOT NULL,
  `user_id` varchar(50) NOT NULL,
  `amount_won` int(11) NOT NULL,
  `spin_date` datetime DEFAULT current_timestamp(),
  `converted` tinyint(1) DEFAULT 0,
  `conversion_date` datetime DEFAULT NULL,
  `naira_amount` decimal(10,2) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `spin_winnings`
--

INSERT INTO `spin_winnings` (`id`, `user_id`, `amount_won`, `spin_date`, `converted`, `conversion_date`, `naira_amount`) VALUES
(1, '3U6XAH1M4J', 500, '2026-01-23 10:52:00', 0, NULL, NULL),
(2, '3U6XAH1M4J', 3, '2026-01-23 10:54:25', 0, NULL, NULL);

--
-- Indexes for dumped tables
--

--
-- Indexes for table `spin_conversions`
--
ALTER TABLE `spin_conversions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_user_date` (`user_id`,`conversion_date`);

--
-- Indexes for table `spin_streaks`
--
ALTER TABLE `spin_streaks`
  ADD PRIMARY KEY (`id`),
  ADD KEY `user_id` (`user_id`);

--
-- Indexes for table `spin_winnings`
--
ALTER TABLE `spin_winnings`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_spin_winnings_user` (`user_id`,`converted`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `spin_conversions`
--
ALTER TABLE `spin_conversions`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `spin_streaks`
--
ALTER TABLE `spin_streaks`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `spin_winnings`
--
ALTER TABLE `spin_winnings`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;
COMMIT;

