-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Jan 27, 2026 at 03:12 AM
-- Server version: 10.4.32-MariaDB
-- PHP Version: 8.0.30

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `dating_app_db`
--

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

--
-- Table structure for table `admin_activity_log`
--

CREATE TABLE `admin_activity_log` (
  `id` int(11) NOT NULL,
  `admin_id` int(11) NOT NULL,
  `action` varchar(100) NOT NULL,
  `description` text DEFAULT NULL,
  `ip_address` varchar(45) DEFAULT NULL,
  `created_at` datetime DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `admin_users`
--

CREATE TABLE `admin_users` (
  `id` int(10) UNSIGNED NOT NULL,
  `username` varchar(100) NOT NULL,
  `email` varchar(255) NOT NULL,
  `password` varchar(255) NOT NULL,
  `role` enum('super_admin','admin','moderator') DEFAULT 'admin',
  `last_login` datetime DEFAULT NULL,
  `created_at` datetime DEFAULT current_timestamp(),
  `full_name` varchar(255) DEFAULT NULL,
  `is_active` tinyint(1) DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `admin_users`
--

INSERT INTO `admin_users` (`id`, `username`, `email`, `password`, `role`, `last_login`, `created_at`, `full_name`, `is_active`) VALUES
(1, 'admin', 'admin@datingapp.com', '$2y$10$4mhnb7ITt9DJSgu8GHNgAOnLGVLiarcBaSa4K17ga5r5Jucvd4WU6', 'super_admin', NULL, '2026-01-13 01:37:56', NULL, 1);

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

--
-- Table structure for table `app_settings`
--

CREATE TABLE `app_settings` (
  `id` int(10) UNSIGNED NOT NULL,
  `key` varchar(100) NOT NULL,
  `value` text DEFAULT NULL,
  `updated_at` datetime DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `app_settings`
--

INSERT INTO `app_settings` (`id`, `key`, `value`, `updated_at`) VALUES
(1, 'app_name', 'DatingApp', '2026-01-13 01:37:56'),
(2, 'logo_url', '', '2026-01-13 01:37:56'),
(3, 'primary_color', '#FF6B6B', '2026-01-13 01:37:56'),
(4, 'splash_image_url', '', '2026-01-13 01:37:56'),
(5, 'contact_email', 'support@datingapp.com', '2026-01-13 01:37:56'),
(6, 'free_swipe_limit', '50', '2026-01-13 01:37:56'),
(7, 'premium_price', '9.99', '2026-01-13 01:37:56'),
(8, 'firebase_server_key', '', '2026-01-13 01:37:56'),
(9, 'firebase_project_id', '', '2026-01-13 01:37:56'),
(10, 'b2_key_id', '', '2026-01-13 01:37:56'),
(11, 'b2_application_key', '', '2026-01-13 01:37:56'),
(12, 'b2_bucket_name', '', '2026-01-13 01:37:56'),
(14, 'app_version', '1.0.0', '2026-01-13 02:45:29'),
(15, 'maintenance_mode', '0', '2026-01-13 02:45:29'),
(16, 'min_age', '18', '2026-01-13 02:45:29'),
(17, 'max_distance', '100', '2026-01-13 02:45:29'),
(18, 'free_swipes_per_day', '50', '2026-01-13 02:45:29'),
(19, 'free_superlikes_per_day', '3', '2026-01-13 02:45:29'),
(20, 'photo_limit', '6', '2026-01-13 02:45:29'),
(21, 'premium_monthly_price', '9.99', '2026-01-13 02:45:29'),
(22, 'premium_yearly_price', '59.99', '2026-01-13 02:45:29');

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

--
-- Table structure for table `blocks`
--

CREATE TABLE `blocks` (
  `id` int(10) UNSIGNED NOT NULL,
  `user_id` int(10) UNSIGNED NOT NULL,
  `blocked_user_id` int(10) UNSIGNED NOT NULL,
  `created_at` datetime DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `likes`
--

CREATE TABLE `likes` (
  `id` int(10) UNSIGNED NOT NULL,
  `user_id` int(10) UNSIGNED NOT NULL,
  `target_user_id` int(10) UNSIGNED NOT NULL,
  `action` enum('like','dislike','superlike') NOT NULL,
  `created_at` datetime DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `likes`
--

INSERT INTO `likes` (`id`, `user_id`, `target_user_id`, `action`, `created_at`) VALUES
(1, 2, 3, 'like', '2026-01-13 02:36:25'),
(2, 3, 2, 'like', '2026-01-13 02:36:25'),
(3, 4, 5, 'like', '2026-01-13 02:36:25'),
(4, 5, 4, 'superlike', '2026-01-13 02:36:25'),
(5, 2, 5, 'like', '2026-01-13 02:36:25'),
(6, 6, 3, 'like', '2026-01-13 02:36:25');

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

--
-- Table structure for table `matches`
--

CREATE TABLE `matches` (
  `id` int(10) UNSIGNED NOT NULL,
  `user_1` int(10) UNSIGNED NOT NULL,
  `user_2` int(10) UNSIGNED NOT NULL,
  `created_at` datetime DEFAULT current_timestamp(),
  `last_message` varchar(500) DEFAULT NULL,
  `last_message_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `matches`
--

INSERT INTO `matches` (`id`, `user_1`, `user_2`, `created_at`, `last_message`, `last_message_at`) VALUES
(1, 2, 3, '2026-01-13 02:36:19', NULL, NULL),
(2, 4, 5, '2026-01-13 02:36:19', NULL, NULL);

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

--
-- Table structure for table `messages`
--

CREATE TABLE `messages` (
  `id` int(11) NOT NULL,
  `match_id` int(10) UNSIGNED NOT NULL,
  `sender_id` int(10) UNSIGNED NOT NULL,
  `message` text NOT NULL,
  `message_type` enum('text','image','gif','voice') DEFAULT 'text',
  `is_read` tinyint(1) DEFAULT 0,
  `read_at` datetime DEFAULT NULL,
  `is_deleted` tinyint(1) DEFAULT 0,
  `created_at` datetime DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `messages`
--

INSERT INTO `messages` (`id`, `match_id`, `sender_id`, `message`, `message_type`, `is_read`, `read_at`, `is_deleted`, `created_at`) VALUES
(1, 1, 2, 'Hey! How are you?', 'text', 0, NULL, 0, '2026-01-13 02:36:19'),
(2, 1, 3, 'Hi! Im good, thanks!', 'text', 1, '2026-01-12 21:49:01', 0, '2026-01-13 02:36:19'),
(3, 1, 2, 'Would you like to grab coffee sometime?', 'text', 0, NULL, 0, '2026-01-13 02:36:19'),
(4, 2, 4, 'Hello there!', 'text', 0, NULL, 0, '2026-01-13 02:36:19'),
(5, 2, 5, 'Hey! Nice to meet you', 'text', 0, NULL, 0, '2026-01-13 02:36:19');

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

--
-- Table structure for table `notifications`
--

CREATE TABLE `notifications` (
  `id` int(11) NOT NULL,
  `user_id` int(10) UNSIGNED NOT NULL,
  `from_user_id` int(10) UNSIGNED DEFAULT NULL,
  `type` varchar(50) NOT NULL,
  `message` varchar(255) NOT NULL,
  `data` text DEFAULT NULL,
  `is_read` tinyint(1) DEFAULT 0,
  `created_at` datetime DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `push_tokens`
--

CREATE TABLE `push_tokens` (
  `id` int(11) NOT NULL,
  `user_id` int(10) UNSIGNED NOT NULL,
  `token` varchar(500) NOT NULL,
  `platform` enum('ios','android','web') NOT NULL,
  `created_at` datetime DEFAULT current_timestamp(),
  `updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

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

--
-- Table structure for table `reports`
--

CREATE TABLE `reports` (
  `id` int(10) UNSIGNED NOT NULL,
  `reporter_id` int(10) UNSIGNED NOT NULL,
  `reported_user_id` int(10) UNSIGNED NOT NULL,
  `reason` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `status` enum('pending','reviewed','resolved') DEFAULT 'pending',
  `created_at` datetime DEFAULT current_timestamp(),
  `admin_notes` text DEFAULT NULL,
  `resolved_by` int(11) DEFAULT NULL,
  `resolved_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `reports`
--

INSERT INTO `reports` (`id`, `reporter_id`, `reported_user_id`, `reason`, `description`, `status`, `created_at`, `admin_notes`, `resolved_by`, `resolved_at`) VALUES
(1, 3, 6, 'harassment', 'Sending inappropriate messages', 'pending', '2026-01-13 02:36:32', NULL, NULL, NULL),
(2, 5, 6, 'spam', 'Spamming the chat', 'pending', '2026-01-13 02:36:32', NULL, NULL, NULL);

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

--
-- Table structure for table `subscriptions`
--

CREATE TABLE `subscriptions` (
  `id` int(10) UNSIGNED NOT NULL,
  `user_id` int(10) UNSIGNED NOT NULL,
  `plan_name` varchar(100) NOT NULL,
  `price` decimal(10,2) NOT NULL,
  `currency` varchar(3) DEFAULT 'USD',
  `starts_at` datetime NOT NULL,
  `expires_at` datetime NOT NULL,
  `is_active` tinyint(1) DEFAULT 1,
  `payment_method` varchar(50) DEFAULT NULL,
  `transaction_id` varchar(255) DEFAULT NULL,
  `created_at` datetime DEFAULT current_timestamp(),
  `ends_at` datetime GENERATED ALWAYS AS (`expires_at`) STORED
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

--
-- Table structure for table `users`
--

CREATE TABLE `users` (
  `id` int(10) UNSIGNED NOT NULL,
  `email` varchar(255) NOT NULL,
  `password` varchar(255) NOT NULL,
  `full_name` varchar(255) DEFAULT '',
  `phone` varchar(20) DEFAULT NULL,
  `status` enum('active','banned','pending') DEFAULT 'active',
  `is_verified` tinyint(1) DEFAULT 0,
  `is_premium` tinyint(1) DEFAULT 0,
  `last_active` datetime DEFAULT NULL,
  `created_at` datetime DEFAULT current_timestamp(),
  `updated_at` datetime DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `is_active` tinyint(1) DEFAULT 1,
  `premium_until` datetime DEFAULT NULL,
  `deleted_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `users`
--

INSERT INTO `users` (`id`, `email`, `password`, `full_name`, `phone`, `status`, `is_verified`, `is_premium`, `last_active`, `created_at`, `updated_at`, `is_active`, `premium_until`, `deleted_at`) VALUES
(1, 'test@example.com', '$2y$10$oHVc6jRYGILHj94hfTBm3OHd/AZmAKLb5LP3cvzmHBnRNUrKrageq', 'Test User', NULL, 'active', 0, 0, NULL, '2026-01-12 20:49:40', '2026-01-13 01:49:40', 1, NULL, NULL),
(2, 'john@example.com', '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', 'John Smith', NULL, 'active', 1, 0, NULL, '2026-01-13 02:35:57', '2026-01-13 02:41:02', 1, NULL, NULL),
(3, 'jane@example.com', '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', 'Jane Doe', NULL, 'active', 1, 0, NULL, '2026-01-13 02:35:57', '2026-01-13 02:41:02', 1, NULL, NULL),
(4, 'mike@example.com', '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', 'Mike Johnson', NULL, 'active', 0, 0, NULL, '2026-01-13 02:35:57', '2026-01-13 02:41:02', 1, NULL, NULL),
(5, 'sarah@example.com', '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', 'Sarah Williams', NULL, 'active', 1, 0, NULL, '2026-01-13 02:35:57', '2026-01-13 02:41:02', 1, NULL, NULL),
(6, 'alex@example.com', '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', 'Alex Brown', NULL, 'banned', 0, 0, NULL, '2026-01-13 02:35:57', '2026-01-13 02:41:02', 0, NULL, NULL),
(7, 'a@a.a', '$2y$10$l0XBn1/x4BVay1Q1N0pwzeLRH0R53ZiIR4x4etW6ON98yMMuUQmX2', 'gh', NULL, 'active', 0, 0, NULL, '2026-01-12 22:41:58', '2026-01-13 03:41:58', 1, NULL, NULL),
(8, 'b@b.b', '$2y$10$Q6WcMpHOO2qHbx714WFLceq/T9m19QnJz3GbYDqBcuDfrbBqk5TYm', 'yx', NULL, 'active', 0, 0, NULL, '2026-01-12 22:43:31', '2026-01-13 03:43:31', 1, NULL, NULL),
(9, 'test@test.com', '$2y$10$WWuOLkxSIv0KIetH2hgCpuPfl0aet2wCsE6RKLNhNjTZ49rvzSPlK', 'Test User', NULL, 'active', 0, 0, NULL, '2026-01-12 22:52:17', '2026-01-13 03:52:17', 1, NULL, NULL),
(10, 'newuser@test.com', '$2y$10$7qUK8i7Yrby0gSX3eB6XM.7WgwjMO5cl1Z3b4wA6DLb3k9gbpKXD6', 'New User', NULL, 'active', 0, 0, NULL, '2026-01-12 22:53:17', '2026-01-13 03:53:17', 1, NULL, NULL),
(11, 'testlogin@test.com', '$2y$10$hqbrqvSbkDsHBFwKpo7BBeVUvJeYzn.hXi9fKf79kAkAuh80h3neK', 'Test Login', NULL, 'active', 0, 0, NULL, '2026-01-12 23:02:06', '2026-01-13 04:02:06', 1, NULL, NULL),
(12, 'testlogin2@test.com', '$2y$10$6mIeQGHsifRxSXdGbnjfVulxMZHjFDsjMIvA0yAucT8qCu0n7TXyq', 'Test Login', NULL, 'active', 0, 0, NULL, '2026-01-12 23:02:14', '2026-01-13 04:02:14', 1, NULL, NULL);

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

--
-- Table structure for table `user_photos`
--

CREATE TABLE `user_photos` (
  `id` int(10) UNSIGNED NOT NULL,
  `user_id` int(10) UNSIGNED NOT NULL,
  `photo_url` varchar(500) NOT NULL,
  `is_primary` tinyint(1) DEFAULT 0,
  `is_approved` tinyint(1) DEFAULT 1,
  `created_at` datetime DEFAULT current_timestamp(),
  `status` enum('pending','approved','rejected') DEFAULT 'pending'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `user_photos`
--

INSERT INTO `user_photos` (`id`, `user_id`, `photo_url`, `is_primary`, `is_approved`, `created_at`, `status`) VALUES
(1, 2, 'https://randomuser.me/api/portraits/men/1.jpg', 1, 1, '2026-01-13 02:36:49', 'approved'),
(2, 3, 'https://randomuser.me/api/portraits/women/1.jpg', 1, 1, '2026-01-13 02:36:49', 'approved'),
(3, 4, 'https://randomuser.me/api/portraits/men/2.jpg', 1, 1, '2026-01-13 02:36:49', 'approved'),
(4, 5, 'https://randomuser.me/api/portraits/women/2.jpg', 1, 1, '2026-01-13 02:36:49', 'approved'),
(5, 6, 'https://randomuser.me/api/portraits/men/3.jpg', 1, 1, '2026-01-13 02:36:49', 'pending');

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

--
-- Table structure for table `user_profiles`
--

CREATE TABLE `user_profiles` (
  `id` int(10) UNSIGNED NOT NULL,
  `user_id` int(10) UNSIGNED NOT NULL,
  `bio` text DEFAULT NULL,
  `interests` text DEFAULT NULL,
  `gender` enum('male','female','other') DEFAULT NULL,
  `looking_for` enum('male','female','both') DEFAULT 'both',
  `age` int(11) DEFAULT NULL,
  `dob` date DEFAULT NULL,
  `location` varchar(255) DEFAULT NULL,
  `latitude` decimal(10,8) DEFAULT NULL,
  `longitude` decimal(11,8) DEFAULT NULL,
  `created_at` datetime DEFAULT current_timestamp(),
  `updated_at` datetime DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `pref_min_age` int(11) DEFAULT 18,
  `pref_max_age` int(11) DEFAULT 50,
  `pref_distance` int(11) DEFAULT 50,
  `pref_gender` enum('male','female','both') DEFAULT 'both',
  `city` varchar(255) DEFAULT NULL,
  `country` varchar(255) DEFAULT NULL,
  `job_title` varchar(255) DEFAULT NULL,
  `company` varchar(255) DEFAULT NULL,
  `education` varchar(255) DEFAULT NULL,
  `height` int(11) DEFAULT NULL,
  `relationship_type` varchar(100) DEFAULT NULL,
  `drinking` varchar(50) DEFAULT NULL,
  `smoking` varchar(50) DEFAULT NULL,
  `children` varchar(50) DEFAULT NULL,
  `religion` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `user_profiles`
--

INSERT INTO `user_profiles` (`id`, `user_id`, `bio`, `interests`, `gender`, `looking_for`, `age`, `dob`, `location`, `latitude`, `longitude`, `created_at`, `updated_at`, `pref_min_age`, `pref_max_age`, `pref_distance`, `pref_gender`, `city`, `country`, `job_title`, `company`, `education`, `height`, `relationship_type`, `drinking`, `smoking`, `children`, `religion`) VALUES
(1, 2, 'Love hiking and photography', NULL, 'male', 'both', 28, NULL, NULL, NULL, NULL, '2026-01-13 02:36:11', '2026-01-13 02:36:11', 18, 50, 50, 'female', 'New York', 'USA', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(2, 3, 'Coffee lover and bookworm', NULL, 'female', 'both', 25, NULL, NULL, NULL, NULL, '2026-01-13 02:36:11', '2026-01-13 02:36:11', 18, 50, 50, 'male', 'Los Angeles', 'USA', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(3, 4, 'Sports enthusiast and traveler', NULL, 'male', 'both', 32, NULL, NULL, NULL, NULL, '2026-01-13 02:36:11', '2026-01-13 02:36:11', 18, 50, 50, 'female', 'Chicago', 'USA', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(4, 5, 'Music lover and foodie', NULL, 'female', 'both', 27, NULL, NULL, NULL, NULL, '2026-01-13 02:36:11', '2026-01-13 02:36:11', 18, 50, 50, 'male', 'Miami', 'USA', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(5, 6, 'Tech geek and gamer', NULL, 'male', 'both', 30, NULL, NULL, NULL, NULL, '2026-01-13 02:36:11', '2026-01-13 02:36:11', 18, 50, 50, 'both', 'Seattle', 'USA', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

--
-- Indexes for dumped tables
--

--
-- Indexes for table `admin_activity_log`
--
ALTER TABLE `admin_activity_log`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `admin_users`
--
ALTER TABLE `admin_users`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `username` (`username`),
  ADD UNIQUE KEY `email` (`email`);

--
-- Indexes for table `app_settings`
--
ALTER TABLE `app_settings`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `key` (`key`);

--
-- Indexes for table `blocks`
--
ALTER TABLE `blocks`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_block` (`user_id`,`blocked_user_id`),
  ADD KEY `blocked_user_id` (`blocked_user_id`);

--
-- Indexes for table `likes`
--
ALTER TABLE `likes`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_like` (`user_id`,`target_user_id`),
  ADD KEY `idx_likes_user` (`user_id`),
  ADD KEY `idx_likes_target` (`target_user_id`);

--
-- Indexes for table `matches`
--
ALTER TABLE `matches`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_match` (`user_1`,`user_2`),
  ADD KEY `idx_matches_user1` (`user_1`),
  ADD KEY `idx_matches_user2` (`user_2`);

--
-- Indexes for table `messages`
--
ALTER TABLE `messages`
  ADD PRIMARY KEY (`id`),
  ADD KEY `match_id` (`match_id`),
  ADD KEY `sender_id` (`sender_id`);

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

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

--
-- Indexes for table `reports`
--
ALTER TABLE `reports`
  ADD PRIMARY KEY (`id`),
  ADD KEY `reporter_id` (`reporter_id`),
  ADD KEY `reported_user_id` (`reported_user_id`);

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

--
-- Indexes for table `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `email` (`email`),
  ADD KEY `idx_users_email` (`email`),
  ADD KEY `idx_users_status` (`status`);

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

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

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `admin_activity_log`
--
ALTER TABLE `admin_activity_log`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `admin_users`
--
ALTER TABLE `admin_users`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `app_settings`
--
ALTER TABLE `app_settings`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=23;

--
-- AUTO_INCREMENT for table `blocks`
--
ALTER TABLE `blocks`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `likes`
--
ALTER TABLE `likes`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT for table `matches`
--
ALTER TABLE `matches`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

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

--
-- AUTO_INCREMENT for table `notifications`
--
ALTER TABLE `notifications`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `push_tokens`
--
ALTER TABLE `push_tokens`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `reports`
--
ALTER TABLE `reports`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `subscriptions`
--
ALTER TABLE `subscriptions`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;

--
-- AUTO_INCREMENT for table `user_photos`
--
ALTER TABLE `user_photos`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `user_profiles`
--
ALTER TABLE `user_profiles`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `blocks`
--
ALTER TABLE `blocks`
  ADD CONSTRAINT `blocks_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `blocks_ibfk_2` FOREIGN KEY (`blocked_user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `likes`
--
ALTER TABLE `likes`
  ADD CONSTRAINT `likes_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `likes_ibfk_2` FOREIGN KEY (`target_user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `matches`
--
ALTER TABLE `matches`
  ADD CONSTRAINT `matches_ibfk_1` FOREIGN KEY (`user_1`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `matches_ibfk_2` FOREIGN KEY (`user_2`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `reports`
--
ALTER TABLE `reports`
  ADD CONSTRAINT `reports_ibfk_1` FOREIGN KEY (`reporter_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `reports_ibfk_2` FOREIGN KEY (`reported_user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `subscriptions`
--
ALTER TABLE `subscriptions`
  ADD CONSTRAINT `subscriptions_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `user_photos`
--
ALTER TABLE `user_photos`
  ADD CONSTRAINT `user_photos_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `user_profiles`
--
ALTER TABLE `user_profiles`
  ADD CONSTRAINT `user_profiles_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
