-- Create Database
CREATE DATABASE IF NOT EXISTS rishta_db;
USE rishta_db;

-- Listings Table
CREATE TABLE IF NOT EXISTS listings (
    id INT AUTO_INCREMENT PRIMARY KEY,
    user_id INT NOT NULL,
    gender ENUM('male', 'female') NOT NULL,
    age INT NOT NULL,
    city VARCHAR(100) NOT NULL,
    marriage_status ENUM('1st', '2nd', '3rd', '4th', 'divorced') NOT NULL,
    description TEXT NOT NULL,
    photo VARCHAR(255),
    payment_slip VARCHAR(255) NOT NULL,
    contact_number VARCHAR(20) NOT NULL,
    status ENUM('pending', 'approved', 'rejected') DEFAULT 'pending',
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
);
