-- =====================================
-- MIGRATION: Reset Admins & Clean Bookings
-- Created: 2026-01-23
-- =====================================
-- Run this SQL script in phpMyAdmin or MySQL CLI
-- to set up new admin accounts and clear test data
-- =====================================

-- 1. Clear all existing admin accounts
TRUNCATE TABLE admins;

-- 2. Insert new admin users
-- NOTE: Password hashes must be generated using PHP's password_hash() function
-- The hashes below are pre-generated for the specified passwords

-- User: roman_v7 | Password: Rvilhov2007
-- User: admin | Password: Admin_Ozero24

-- ВАЖЛИВО: Виконайте цей PHP код аби отримати хеші:
-- <?php
-- echo password_hash('Rvilhov2007', PASSWORD_DEFAULT);
-- echo password_hash('Admin_Ozero24', PASSWORD_DEFAULT);
-- ?>

-- Замініть 'HASH_HERE_1' та 'HASH_HERE_2' на результати виконання PHP вище

INSERT INTO admins (username, password_hash, role) VALUES 
('roman_v7', '$2y$10$YourGeneratedHashHere1ForRvilhov2007PLACEHOLDER', 'admin'),
('admin', '$2y$10$YourGeneratedHashHere2ForAdminOzero24PLACEHOLDER', 'admin');

-- 3. Clear ALL test bookings
TRUNCATE TABLE bookings;

-- 4. Reset auto-increment to start from 1
ALTER TABLE bookings AUTO_INCREMENT = 1;

-- =====================================
-- DONE! Admin panel is now clean and ready for production
-- =====================================
