--
-- PostgreSQL database dump
--

-- Dumped from database version 17.5
-- Dumped by pg_dump version 17.5

-- Started on 2025-10-29 10:11:03

SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET transaction_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;

--
-- TOC entry 7 (class 2615 OID 181988)
-- Name: nrt_health; Type: SCHEMA; Schema: -; Owner: postgres
--

CREATE SCHEMA nrt_health;


ALTER SCHEMA nrt_health OWNER TO postgres;

--
-- TOC entry 8 (class 2615 OID 181989)
-- Name: nrt_id_register; Type: SCHEMA; Schema: -; Owner: postgres
--

CREATE SCHEMA nrt_id_register;


ALTER SCHEMA nrt_id_register OWNER TO postgres;

--
-- TOC entry 9 (class 2615 OID 181990)
-- Name: nrt_marriage; Type: SCHEMA; Schema: -; Owner: postgres
--

CREATE SCHEMA nrt_marriage;


ALTER SCHEMA nrt_marriage OWNER TO postgres;

--
-- TOC entry 10 (class 2615 OID 181991)
-- Name: nrt_skills; Type: SCHEMA; Schema: -; Owner: postgres
--

CREATE SCHEMA nrt_skills;


ALTER SCHEMA nrt_skills OWNER TO postgres;

--
-- TOC entry 11 (class 2615 OID 181992)
-- Name: nrtday; Type: SCHEMA; Schema: -; Owner: pg_database_owner
--

CREATE SCHEMA nrtday;


ALTER SCHEMA nrtday OWNER TO pg_database_owner;

--
-- TOC entry 5676 (class 0 OID 0)
-- Dependencies: 11
-- Name: SCHEMA nrtday; Type: COMMENT; Schema: -; Owner: pg_database_owner
--

COMMENT ON SCHEMA nrtday IS 'standard public schema';


--
-- TOC entry 2 (class 3079 OID 181993)
-- Name: pgcrypto; Type: EXTENSION; Schema: -; Owner: -
--

CREATE EXTENSION IF NOT EXISTS pgcrypto WITH SCHEMA nrtday;


--
-- TOC entry 5677 (class 0 OID 0)
-- Dependencies: 2
-- Name: EXTENSION pgcrypto; Type: COMMENT; Schema: -; Owner: 
--

COMMENT ON EXTENSION pgcrypto IS 'cryptographic functions';


--
-- TOC entry 3 (class 3079 OID 182030)
-- Name: uuid-ossp; Type: EXTENSION; Schema: -; Owner: -
--

CREATE EXTENSION IF NOT EXISTS "uuid-ossp" WITH SCHEMA nrtday;


--
-- TOC entry 5678 (class 0 OID 0)
-- Dependencies: 3
-- Name: EXTENSION "uuid-ossp"; Type: COMMENT; Schema: -; Owner: 
--

COMMENT ON EXTENSION "uuid-ossp" IS 'generate universally unique identifiers (UUIDs)';


--
-- TOC entry 1003 (class 1247 OID 182042)
-- Name: food_pref; Type: TYPE; Schema: nrtday; Owner: postgres
--

CREATE TYPE nrtday.food_pref AS ENUM (
    'vegetarian',
    'non_vegetarian'
);


ALTER TYPE nrtday.food_pref OWNER TO postgres;

--
-- TOC entry 1006 (class 1247 OID 182048)
-- Name: gender_type; Type: TYPE; Schema: nrtday; Owner: postgres
--

CREATE TYPE nrtday.gender_type AS ENUM (
    'male',
    'female',
    'other'
);


ALTER TYPE nrtday.gender_type OWNER TO postgres;

--
-- TOC entry 1009 (class 1247 OID 182056)
-- Name: hotel_pref; Type: TYPE; Schema: nrtday; Owner: postgres
--

CREATE TYPE nrtday.hotel_pref AS ENUM (
    'non_smoker',
    'smoker'
);


ALTER TYPE nrtday.hotel_pref OWNER TO postgres;

--
-- TOC entry 1012 (class 1247 OID 182062)
-- Name: participant_status; Type: TYPE; Schema: nrtday; Owner: postgres
--

CREATE TYPE nrtday.participant_status AS ENUM (
    'pending',
    'confirmed',
    'rejected'
);


ALTER TYPE nrtday.participant_status OWNER TO postgres;

--
-- TOC entry 1015 (class 1247 OID 182070)
-- Name: participant_type; Type: TYPE; Schema: nrtday; Owner: postgres
--

CREATE TYPE nrtday.participant_type AS ENUM (
    'individual',
    'association'
);


ALTER TYPE nrtday.participant_type OWNER TO postgres;

--
-- TOC entry 374 (class 1255 OID 182075)
-- Name: update_updated_at_column(); Type: FUNCTION; Schema: nrtday; Owner: postgres
--

CREATE FUNCTION nrtday.update_updated_at_column() RETURNS trigger
    LANGUAGE plpgsql
    AS $$
BEGIN
   NEW.updated_at = NOW();
   RETURN NEW;
END;
$$;


ALTER FUNCTION nrtday.update_updated_at_column() OWNER TO postgres;

SET default_tablespace = '';

SET default_table_access_method = heap;

--
-- TOC entry 225 (class 1259 OID 182076)
-- Name: declaration_consent; Type: TABLE; Schema: nrt_health; Owner: postgres
--

CREATE TABLE nrt_health.declaration_consent (
    declaration_id integer NOT NULL,
    person_id integer NOT NULL,
    application_date date NOT NULL,
    application_place character varying(255) NOT NULL,
    confirm_consent boolean DEFAULT false NOT NULL,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP
);


ALTER TABLE nrt_health.declaration_consent OWNER TO postgres;

--
-- TOC entry 226 (class 1259 OID 182081)
-- Name: declaration_consent_declaration_id_seq; Type: SEQUENCE; Schema: nrt_health; Owner: postgres
--

CREATE SEQUENCE nrt_health.declaration_consent_declaration_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE nrt_health.declaration_consent_declaration_id_seq OWNER TO postgres;

--
-- TOC entry 5679 (class 0 OID 0)
-- Dependencies: 226
-- Name: declaration_consent_declaration_id_seq; Type: SEQUENCE OWNED BY; Schema: nrt_health; Owner: postgres
--

ALTER SEQUENCE nrt_health.declaration_consent_declaration_id_seq OWNED BY nrt_health.declaration_consent.declaration_id;


--
-- TOC entry 227 (class 1259 OID 182082)
-- Name: documents_checklist; Type: TABLE; Schema: nrt_health; Owner: postgres
--

CREATE TABLE nrt_health.documents_checklist (
    id integer NOT NULL,
    person_id integer NOT NULL,
    passport_copy text NOT NULL,
    recent_photo text NOT NULL,
    proof_residence text NOT NULL,
    oci_card text,
    medical_reports text,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP
);


ALTER TABLE nrt_health.documents_checklist OWNER TO postgres;

--
-- TOC entry 228 (class 1259 OID 182088)
-- Name: documents_checklist_id_seq; Type: SEQUENCE; Schema: nrt_health; Owner: postgres
--

CREATE SEQUENCE nrt_health.documents_checklist_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE nrt_health.documents_checklist_id_seq OWNER TO postgres;

--
-- TOC entry 5680 (class 0 OID 0)
-- Dependencies: 228
-- Name: documents_checklist_id_seq; Type: SEQUENCE OWNED BY; Schema: nrt_health; Owner: postgres
--

ALTER SEQUENCE nrt_health.documents_checklist_id_seq OWNED BY nrt_health.documents_checklist.id;


--
-- TOC entry 229 (class 1259 OID 182089)
-- Name: hospital_bookings; Type: TABLE; Schema: nrt_health; Owner: postgres
--

CREATE TABLE nrt_health.hospital_bookings (
    booking_id integer NOT NULL,
    person_id integer NOT NULL,
    hospital_id integer NOT NULL,
    admission_date date NOT NULL,
    discharge_date date,
    room_type character varying(50),
    status character varying(20) DEFAULT 'Pending'::character varying,
    notes text,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    updated_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    start_time time without time zone,
    end_time time without time zone,
    assistance text[],
    treatment text[],
    CONSTRAINT hospital_bookings_status_check CHECK (((status)::text = ANY (ARRAY[('Pending'::character varying)::text, ('Confirmed'::character varying)::text, ('Cancelled'::character varying)::text])))
);


ALTER TABLE nrt_health.hospital_bookings OWNER TO postgres;

--
-- TOC entry 230 (class 1259 OID 182098)
-- Name: hospital_bookings_booking_id_seq; Type: SEQUENCE; Schema: nrt_health; Owner: postgres
--

CREATE SEQUENCE nrt_health.hospital_bookings_booking_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE nrt_health.hospital_bookings_booking_id_seq OWNER TO postgres;

--
-- TOC entry 5681 (class 0 OID 0)
-- Dependencies: 230
-- Name: hospital_bookings_booking_id_seq; Type: SEQUENCE OWNED BY; Schema: nrt_health; Owner: postgres
--

ALTER SEQUENCE nrt_health.hospital_bookings_booking_id_seq OWNED BY nrt_health.hospital_bookings.booking_id;


--
-- TOC entry 231 (class 1259 OID 182099)
-- Name: hospitals; Type: TABLE; Schema: nrt_health; Owner: postgres
--

CREATE TABLE nrt_health.hospitals (
    hospital_id integer NOT NULL,
    hospital_name character varying(200) NOT NULL,
    registration_number character varying(100),
    established_year integer,
    phone character varying(20),
    email character varying(150),
    website character varying(200),
    address text NOT NULL,
    city character varying(100) NOT NULL,
    state character varying(100),
    country character varying(100) NOT NULL,
    postal_code character varying(20),
    specializations text[],
    bed_capacity integer,
    icu_beds integer,
    emergency_available boolean DEFAULT false,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    updated_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    moi_certificate character varying(255)
);


ALTER TABLE nrt_health.hospitals OWNER TO postgres;

--
-- TOC entry 232 (class 1259 OID 182107)
-- Name: hospitals_hospital_id_seq; Type: SEQUENCE; Schema: nrt_health; Owner: postgres
--

CREATE SEQUENCE nrt_health.hospitals_hospital_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE nrt_health.hospitals_hospital_id_seq OWNER TO postgres;

--
-- TOC entry 5682 (class 0 OID 0)
-- Dependencies: 232
-- Name: hospitals_hospital_id_seq; Type: SEQUENCE OWNED BY; Schema: nrt_health; Owner: postgres
--

ALTER SEQUENCE nrt_health.hospitals_hospital_id_seq OWNED BY nrt_health.hospitals.hospital_id;


--
-- TOC entry 233 (class 1259 OID 182108)
-- Name: logistical_details; Type: TABLE; Schema: nrt_health; Owner: postgres
--

CREATE TABLE nrt_health.logistical_details (
    id integer NOT NULL,
    person_id integer NOT NULL,
    stay_from date NOT NULL,
    stay_to date NOT NULL,
    medical_visa character varying(50) NOT NULL,
    assistance text[],
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    CONSTRAINT logistical_details_medical_visa_check CHECK (((medical_visa)::text = ANY (ARRAY[('yes'::character varying)::text, ('no'::character varying)::text, ('applied'::character varying)::text, ('require_facilitation'::character varying)::text])))
);


ALTER TABLE nrt_health.logistical_details OWNER TO postgres;

--
-- TOC entry 234 (class 1259 OID 182115)
-- Name: logistical_details_id_seq; Type: SEQUENCE; Schema: nrt_health; Owner: postgres
--

CREATE SEQUENCE nrt_health.logistical_details_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE nrt_health.logistical_details_id_seq OWNER TO postgres;

--
-- TOC entry 5683 (class 0 OID 0)
-- Dependencies: 234
-- Name: logistical_details_id_seq; Type: SEQUENCE OWNED BY; Schema: nrt_health; Owner: postgres
--

ALTER SEQUENCE nrt_health.logistical_details_id_seq OWNED BY nrt_health.logistical_details.id;


--
-- TOC entry 235 (class 1259 OID 182116)
-- Name: medical_requirements; Type: TABLE; Schema: nrt_health; Owner: postgres
--

CREATE TABLE nrt_health.medical_requirements (
    id integer NOT NULL,
    person_id integer NOT NULL,
    treatment text[],
    treatment_other text,
    condition text NOT NULL,
    under_treatment character varying(5) NOT NULL,
    treatment_details text,
    reports character varying(5) NOT NULL,
    report_file character varying(255),
    preferred_city text[],
    preferred_hospital character varying(255),
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP
);


ALTER TABLE nrt_health.medical_requirements OWNER TO postgres;

--
-- TOC entry 236 (class 1259 OID 182122)
-- Name: medical_requirements_id_seq; Type: SEQUENCE; Schema: nrt_health; Owner: postgres
--

CREATE SEQUENCE nrt_health.medical_requirements_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE nrt_health.medical_requirements_id_seq OWNER TO postgres;

--
-- TOC entry 5684 (class 0 OID 0)
-- Dependencies: 236
-- Name: medical_requirements_id_seq; Type: SEQUENCE OWNED BY; Schema: nrt_health; Owner: postgres
--

ALTER SEQUENCE nrt_health.medical_requirements_id_seq OWNED BY nrt_health.medical_requirements.id;


--
-- TOC entry 237 (class 1259 OID 182123)
-- Name: personal_information; Type: TABLE; Schema: nrt_health; Owner: postgres
--

CREATE TABLE nrt_health.personal_information (
    person_id integer NOT NULL,
    full_name character varying(150) NOT NULL,
    gender character varying(20) NOT NULL,
    date_of_birth date NOT NULL,
    nationality character varying(100) NOT NULL,
    passport_number character varying(50) NOT NULL,
    oci_pio_number character varying(50),
    country_of_residence character varying(100) NOT NULL,
    email character varying(150) NOT NULL,
    isd_code character varying(10) NOT NULL,
    mobile_number character varying(20) NOT NULL,
    emergency_contact_name character varying(100),
    emergency_contact_phone character varying(20),
    emergency_contact_relationship character varying(50),
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    updated_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    user_id integer,
    status character varying(20) DEFAULT 'Pending'::character varying,
    CONSTRAINT personal_information_gender_check CHECK (((gender)::text = ANY (ARRAY[('Male'::character varying)::text, ('Female'::character varying)::text, ('Other'::character varying)::text])))
);


ALTER TABLE nrt_health.personal_information OWNER TO postgres;

--
-- TOC entry 238 (class 1259 OID 182132)
-- Name: personal_information_person_id_seq; Type: SEQUENCE; Schema: nrt_health; Owner: postgres
--

CREATE SEQUENCE nrt_health.personal_information_person_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE nrt_health.personal_information_person_id_seq OWNER TO postgres;

--
-- TOC entry 5685 (class 0 OID 0)
-- Dependencies: 238
-- Name: personal_information_person_id_seq; Type: SEQUENCE OWNED BY; Schema: nrt_health; Owner: postgres
--

ALTER SEQUENCE nrt_health.personal_information_person_id_seq OWNED BY nrt_health.personal_information.person_id;


--
-- TOC entry 239 (class 1259 OID 182133)
-- Name: nrt_id_communication; Type: TABLE; Schema: nrt_id_register; Owner: postgres
--

CREATE TABLE nrt_id_register.nrt_id_communication (
    id integer NOT NULL,
    registration_id character varying(50) NOT NULL,
    phone_country_code character varying(10),
    phone_no character varying(15),
    is_same_as_whatsapp_number boolean DEFAULT false,
    whatsapp_country_code character varying(10),
    whatsapp_number character varying(15),
    emergency_contact_name character varying(150),
    emergency_contact_relationship character varying(100),
    emergency_phone_country_code character varying(10),
    emergency_phone_no character varying(15),
    current_door_no character varying(50),
    current_street_name character varying(255),
    current_country character varying(100),
    current_state character varying(100),
    current_district character varying(100),
    current_pincode character varying(15),
    local_door_no character varying(50),
    local_street_name character varying(255),
    local_district character varying(100),
    local_state character varying(100),
    local_pincode character varying(15),
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP
);


ALTER TABLE nrt_id_register.nrt_id_communication OWNER TO postgres;

--
-- TOC entry 240 (class 1259 OID 182140)
-- Name: nrt_id_communication_id_seq; Type: SEQUENCE; Schema: nrt_id_register; Owner: postgres
--

CREATE SEQUENCE nrt_id_register.nrt_id_communication_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE nrt_id_register.nrt_id_communication_id_seq OWNER TO postgres;

--
-- TOC entry 5686 (class 0 OID 0)
-- Dependencies: 240
-- Name: nrt_id_communication_id_seq; Type: SEQUENCE OWNED BY; Schema: nrt_id_register; Owner: postgres
--

ALTER SEQUENCE nrt_id_register.nrt_id_communication_id_seq OWNED BY nrt_id_register.nrt_id_communication.id;


--
-- TOC entry 241 (class 1259 OID 182141)
-- Name: nrt_id_declaration; Type: TABLE; Schema: nrt_id_register; Owner: postgres
--

CREATE TABLE nrt_id_register.nrt_id_declaration (
    id integer NOT NULL,
    registration_id character varying(50) NOT NULL,
    declaration_agreed boolean DEFAULT false,
    terms_accepted boolean DEFAULT false,
    draft_status boolean DEFAULT true,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP
);


ALTER TABLE nrt_id_register.nrt_id_declaration OWNER TO postgres;

--
-- TOC entry 242 (class 1259 OID 182148)
-- Name: nrt_id_declaration_id_seq; Type: SEQUENCE; Schema: nrt_id_register; Owner: postgres
--

CREATE SEQUENCE nrt_id_register.nrt_id_declaration_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE nrt_id_register.nrt_id_declaration_id_seq OWNER TO postgres;

--
-- TOC entry 5687 (class 0 OID 0)
-- Dependencies: 242
-- Name: nrt_id_declaration_id_seq; Type: SEQUENCE OWNED BY; Schema: nrt_id_register; Owner: postgres
--

ALTER SEQUENCE nrt_id_register.nrt_id_declaration_id_seq OWNED BY nrt_id_register.nrt_id_declaration.id;


--
-- TOC entry 243 (class 1259 OID 182149)
-- Name: nrt_id_documents; Type: TABLE; Schema: nrt_id_register; Owner: postgres
--

CREATE TABLE nrt_id_register.nrt_id_documents (
    id integer NOT NULL,
    registration_id character varying(50) NOT NULL,
    nrt_type character varying(50),
    passport_no character varying(50),
    passport_expiry_date date,
    passport_image text,
    visa_type character varying(50),
    visa_image text,
    visa_expiry_date date,
    work_permit_copy text,
    employer_name character varying(255),
    university_id_card text,
    other_visa_type character varying(100),
    india_proof_document text,
    draft_status boolean DEFAULT true,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    updated_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP
);


ALTER TABLE nrt_id_register.nrt_id_documents OWNER TO postgres;

--
-- TOC entry 244 (class 1259 OID 182157)
-- Name: nrt_id_documents_id_seq; Type: SEQUENCE; Schema: nrt_id_register; Owner: postgres
--

CREATE SEQUENCE nrt_id_register.nrt_id_documents_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE nrt_id_register.nrt_id_documents_id_seq OWNER TO postgres;

--
-- TOC entry 5688 (class 0 OID 0)
-- Dependencies: 244
-- Name: nrt_id_documents_id_seq; Type: SEQUENCE OWNED BY; Schema: nrt_id_register; Owner: postgres
--

ALTER SEQUENCE nrt_id_register.nrt_id_documents_id_seq OWNED BY nrt_id_register.nrt_id_documents.id;


--
-- TOC entry 245 (class 1259 OID 182158)
-- Name: nrt_id_registration; Type: TABLE; Schema: nrt_id_register; Owner: postgres
--

CREATE TABLE nrt_id_register.nrt_id_registration (
    id integer NOT NULL,
    title character varying(10) NOT NULL,
    first_name character varying(100) NOT NULL,
    last_name character varying(100) NOT NULL,
    gender character varying(10) NOT NULL,
    dob date NOT NULL,
    age integer NOT NULL,
    occupational_status character varying(50),
    marital_status character varying(50),
    qualification character varying(50),
    country_residence character varying(80) NOT NULL,
    residing_state character varying(80),
    attach_photo text,
    gov_proof character varying(50) NOT NULL,
    proof_number character varying(50) NOT NULL,
    proof_document text,
    draft_status boolean DEFAULT true,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    updated_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    registration_id character varying(50) NOT NULL,
    user_id bigint DEFAULT 0,
    approval_status character varying(20) DEFAULT 'pending'::character varying,
    idcard_path text
);


ALTER TABLE nrt_id_register.nrt_id_registration OWNER TO postgres;

--
-- TOC entry 246 (class 1259 OID 182168)
-- Name: nrt_id_registration_id_seq; Type: SEQUENCE; Schema: nrt_id_register; Owner: postgres
--

CREATE SEQUENCE nrt_id_register.nrt_id_registration_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE nrt_id_register.nrt_id_registration_id_seq OWNER TO postgres;

--
-- TOC entry 5689 (class 0 OID 0)
-- Dependencies: 246
-- Name: nrt_id_registration_id_seq; Type: SEQUENCE OWNED BY; Schema: nrt_id_register; Owner: postgres
--

ALTER SEQUENCE nrt_id_register.nrt_id_registration_id_seq OWNED BY nrt_id_register.nrt_id_registration.id;


--
-- TOC entry 247 (class 1259 OID 182169)
-- Name: Marriage_Assistance_Form; Type: TABLE; Schema: nrt_marriage; Owner: postgres
--

CREATE TABLE nrt_marriage."Marriage_Assistance_Form" (
    id integer NOT NULL,
    full_name text,
    gender text,
    dob date,
    aadhaar text,
    relationship text,
    address text,
    pin text,
    district text,
    taluk text,
    mobile text,
    email text,
    bride_name text,
    bride_dob date,
    groom_name text,
    groom_dob date,
    marriage_date date,
    marriage_location text,
    deceased_name text,
    membership_id text,
    death_date date,
    employment_country text,
    education_certificate text,
    income_certificate text,
    aadhaar_bride text,
    aadhaar_groom text,
    marriage_certificate text,
    legal_heir_certificate text,
    death_certificate text,
    membership_proof text,
    bank_passbook text,
    status character varying(10) DEFAULT 'draft'::character varying,
    user_id character varying(50)
);


ALTER TABLE nrt_marriage."Marriage_Assistance_Form" OWNER TO postgres;

--
-- TOC entry 248 (class 1259 OID 182175)
-- Name: Marriage_Assistance_Form_id_seq; Type: SEQUENCE; Schema: nrt_marriage; Owner: postgres
--

CREATE SEQUENCE nrt_marriage."Marriage_Assistance_Form_id_seq"
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE nrt_marriage."Marriage_Assistance_Form_id_seq" OWNER TO postgres;

--
-- TOC entry 5690 (class 0 OID 0)
-- Dependencies: 248
-- Name: Marriage_Assistance_Form_id_seq; Type: SEQUENCE OWNED BY; Schema: nrt_marriage; Owner: postgres
--

ALTER SEQUENCE nrt_marriage."Marriage_Assistance_Form_id_seq" OWNED BY nrt_marriage."Marriage_Assistance_Form".id;


--
-- TOC entry 249 (class 1259 OID 182176)
-- Name: admin_users; Type: TABLE; Schema: nrt_marriage; Owner: postgres
--

CREATE TABLE nrt_marriage.admin_users (
    id integer NOT NULL,
    username character varying(50) NOT NULL,
    password text NOT NULL,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP
);


ALTER TABLE nrt_marriage.admin_users OWNER TO postgres;

--
-- TOC entry 250 (class 1259 OID 182182)
-- Name: admin_users_id_seq; Type: SEQUENCE; Schema: nrt_marriage; Owner: postgres
--

CREATE SEQUENCE nrt_marriage.admin_users_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE nrt_marriage.admin_users_id_seq OWNER TO postgres;

--
-- TOC entry 5691 (class 0 OID 0)
-- Dependencies: 250
-- Name: admin_users_id_seq; Type: SEQUENCE OWNED BY; Schema: nrt_marriage; Owner: postgres
--

ALTER SEQUENCE nrt_marriage.admin_users_id_seq OWNED BY nrt_marriage.admin_users.id;


--
-- TOC entry 251 (class 1259 OID 182183)
-- Name: users; Type: TABLE; Schema: nrt_marriage; Owner: postgres
--

CREATE TABLE nrt_marriage.users (
    id integer NOT NULL,
    name character varying(100) NOT NULL,
    email character varying(150) NOT NULL,
    password character varying(255) NOT NULL,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP
);


ALTER TABLE nrt_marriage.users OWNER TO postgres;

--
-- TOC entry 252 (class 1259 OID 182189)
-- Name: users_id_seq; Type: SEQUENCE; Schema: nrt_marriage; Owner: postgres
--

CREATE SEQUENCE nrt_marriage.users_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE nrt_marriage.users_id_seq OWNER TO postgres;

--
-- TOC entry 5692 (class 0 OID 0)
-- Dependencies: 252
-- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: nrt_marriage; Owner: postgres
--

ALTER SEQUENCE nrt_marriage.users_id_seq OWNED BY nrt_marriage.users.id;


--
-- TOC entry 253 (class 1259 OID 182190)
-- Name: application_documents; Type: TABLE; Schema: nrt_skills; Owner: postgres
--

CREATE TABLE nrt_skills.application_documents (
    doc_id integer NOT NULL,
    application_id character varying(50) NOT NULL,
    document_type character varying(100) NOT NULL,
    file_path text NOT NULL,
    uploaded_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP
);


ALTER TABLE nrt_skills.application_documents OWNER TO postgres;

--
-- TOC entry 254 (class 1259 OID 182196)
-- Name: application_documents_doc_id_seq; Type: SEQUENCE; Schema: nrt_skills; Owner: postgres
--

CREATE SEQUENCE nrt_skills.application_documents_doc_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE nrt_skills.application_documents_doc_id_seq OWNER TO postgres;

--
-- TOC entry 5693 (class 0 OID 0)
-- Dependencies: 254
-- Name: application_documents_doc_id_seq; Type: SEQUENCE OWNED BY; Schema: nrt_skills; Owner: postgres
--

ALTER SEQUENCE nrt_skills.application_documents_doc_id_seq OWNED BY nrt_skills.application_documents.doc_id;


--
-- TOC entry 255 (class 1259 OID 182197)
-- Name: education_qualifications; Type: TABLE; Schema: nrt_skills; Owner: postgres
--

CREATE TABLE nrt_skills.education_qualifications (
    edu_id integer NOT NULL,
    application_id character varying(50) NOT NULL,
    qualification character varying(150),
    institution character varying(255),
    board character varying(150),
    year character varying(10),
    grade character varying(50)
);


ALTER TABLE nrt_skills.education_qualifications OWNER TO postgres;

--
-- TOC entry 256 (class 1259 OID 182202)
-- Name: education_qualifications_edu_id_seq; Type: SEQUENCE; Schema: nrt_skills; Owner: postgres
--

CREATE SEQUENCE nrt_skills.education_qualifications_edu_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE nrt_skills.education_qualifications_edu_id_seq OWNER TO postgres;

--
-- TOC entry 5694 (class 0 OID 0)
-- Dependencies: 256
-- Name: education_qualifications_edu_id_seq; Type: SEQUENCE OWNED BY; Schema: nrt_skills; Owner: postgres
--

ALTER SEQUENCE nrt_skills.education_qualifications_edu_id_seq OWNED BY nrt_skills.education_qualifications.edu_id;


--
-- TOC entry 257 (class 1259 OID 182203)
-- Name: employers; Type: TABLE; Schema: nrt_skills; Owner: postgres
--

CREATE TABLE nrt_skills.employers (
    employer_id integer NOT NULL,
    company_name character varying(255) NOT NULL,
    contact_person character varying(150),
    email character varying(150) NOT NULL,
    phone character varying(20),
    address text,
    country character varying(100),
    state character varying(100),
    city character varying(100),
    industry_type character varying(100),
    registration_date timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    status character varying(20) DEFAULT 'Active'::character varying
);


ALTER TABLE nrt_skills.employers OWNER TO postgres;

--
-- TOC entry 258 (class 1259 OID 182210)
-- Name: employers_employer_id_seq; Type: SEQUENCE; Schema: nrt_skills; Owner: postgres
--

CREATE SEQUENCE nrt_skills.employers_employer_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE nrt_skills.employers_employer_id_seq OWNER TO postgres;

--
-- TOC entry 5695 (class 0 OID 0)
-- Dependencies: 258
-- Name: employers_employer_id_seq; Type: SEQUENCE OWNED BY; Schema: nrt_skills; Owner: postgres
--

ALTER SEQUENCE nrt_skills.employers_employer_id_seq OWNED BY nrt_skills.employers.employer_id;


--
-- TOC entry 259 (class 1259 OID 182211)
-- Name: job_applications; Type: TABLE; Schema: nrt_skills; Owner: postgres
--

CREATE TABLE nrt_skills.job_applications (
    application_id character varying(50) NOT NULL,
    user_id integer NOT NULL,
    job_id integer NOT NULL,
    full_name character varying(255) NOT NULL,
    nrt_membership_id character varying(100),
    dob date NOT NULL,
    guardian_name character varying(255) NOT NULL,
    gender character varying(20) NOT NULL,
    mobile character varying(20) NOT NULL,
    email character varying(150) NOT NULL,
    address text,
    residence_country character varying(50) NOT NULL,
    abroad_country character varying(100),
    district character varying(100),
    state character varying(100),
    pincode character varying(20),
    beneficiary_category character(1) NOT NULL,
    has_skill boolean DEFAULT false NOT NULL,
    skill_experience text,
    declaration_accepted boolean DEFAULT false,
    status character varying(50) DEFAULT 'Pending'::character varying,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    updated_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    draft_status boolean DEFAULT false
);


ALTER TABLE nrt_skills.job_applications OWNER TO postgres;

--
-- TOC entry 260 (class 1259 OID 182222)
-- Name: jobs; Type: TABLE; Schema: nrt_skills; Owner: postgres
--

CREATE TABLE nrt_skills.jobs (
    job_id integer NOT NULL,
    employer_id integer,
    job_category character varying(50),
    job_title character varying(255) NOT NULL,
    job_description text NOT NULL,
    job_type character varying(50),
    min_salary numeric(12,2),
    max_salary numeric(12,2),
    currency character varying(10) DEFAULT 'INR'::character varying,
    skills_required text,
    experience_required character varying(100),
    education_required character varying(150),
    vacancies integer DEFAULT 1,
    location_type character varying(50),
    country character varying(100),
    state character varying(100),
    city character varying(100),
    posting_date timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    last_date timestamp without time zone,
    status character varying(20) DEFAULT 'Open'::character varying,
    mandatory_skill text,
    updated_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    CONSTRAINT jobs_job_category_check CHECK (((job_category)::text = ANY (ARRAY[('Blue Collar'::character varying)::text, ('White Collar'::character varying)::text]))),
    CONSTRAINT jobs_location_type_check CHECK (((location_type)::text = ANY (ARRAY[('Abroad'::character varying)::text, ('India'::character varying)::text])))
);


ALTER TABLE nrt_skills.jobs OWNER TO postgres;

--
-- TOC entry 261 (class 1259 OID 182234)
-- Name: jobs_job_id_seq; Type: SEQUENCE; Schema: nrt_skills; Owner: postgres
--

CREATE SEQUENCE nrt_skills.jobs_job_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE nrt_skills.jobs_job_id_seq OWNER TO postgres;

--
-- TOC entry 5696 (class 0 OID 0)
-- Dependencies: 261
-- Name: jobs_job_id_seq; Type: SEQUENCE OWNED BY; Schema: nrt_skills; Owner: postgres
--

ALTER SEQUENCE nrt_skills.jobs_job_id_seq OWNED BY nrt_skills.jobs.job_id;


--
-- TOC entry 262 (class 1259 OID 182235)
-- Name: language_proficiency; Type: TABLE; Schema: nrt_skills; Owner: postgres
--

CREATE TABLE nrt_skills.language_proficiency (
    lang_id integer NOT NULL,
    application_id character varying(50) NOT NULL,
    language_name character varying(100) NOT NULL,
    can_read boolean DEFAULT false,
    can_write boolean DEFAULT false,
    can_speak boolean DEFAULT false
);


ALTER TABLE nrt_skills.language_proficiency OWNER TO postgres;

--
-- TOC entry 263 (class 1259 OID 182241)
-- Name: language_proficiency_lang_id_seq; Type: SEQUENCE; Schema: nrt_skills; Owner: postgres
--

CREATE SEQUENCE nrt_skills.language_proficiency_lang_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE nrt_skills.language_proficiency_lang_id_seq OWNER TO postgres;

--
-- TOC entry 5697 (class 0 OID 0)
-- Dependencies: 263
-- Name: language_proficiency_lang_id_seq; Type: SEQUENCE OWNED BY; Schema: nrt_skills; Owner: postgres
--

ALTER SEQUENCE nrt_skills.language_proficiency_lang_id_seq OWNED BY nrt_skills.language_proficiency.lang_id;


--
-- TOC entry 264 (class 1259 OID 182242)
-- Name: passport_details; Type: TABLE; Schema: nrt_skills; Owner: postgres
--

CREATE TABLE nrt_skills.passport_details (
    passport_id integer NOT NULL,
    application_id character varying(50) NOT NULL,
    passport_number character varying(50) NOT NULL,
    passport_issue date NOT NULL,
    passport_expiry date NOT NULL,
    issuing_authority character varying(150)
);


ALTER TABLE nrt_skills.passport_details OWNER TO postgres;

--
-- TOC entry 265 (class 1259 OID 182245)
-- Name: passport_details_passport_id_seq; Type: SEQUENCE; Schema: nrt_skills; Owner: postgres
--

CREATE SEQUENCE nrt_skills.passport_details_passport_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE nrt_skills.passport_details_passport_id_seq OWNER TO postgres;

--
-- TOC entry 5698 (class 0 OID 0)
-- Dependencies: 265
-- Name: passport_details_passport_id_seq; Type: SEQUENCE OWNED BY; Schema: nrt_skills; Owner: postgres
--

ALTER SEQUENCE nrt_skills.passport_details_passport_id_seq OWNED BY nrt_skills.passport_details.passport_id;


--
-- TOC entry 266 (class 1259 OID 182246)
-- Name: preferred_countries; Type: TABLE; Schema: nrt_skills; Owner: postgres
--

CREATE TABLE nrt_skills.preferred_countries (
    pref_country_id integer NOT NULL,
    application_id character varying(50) NOT NULL,
    country_name character varying(150) NOT NULL
);


ALTER TABLE nrt_skills.preferred_countries OWNER TO postgres;

--
-- TOC entry 267 (class 1259 OID 182249)
-- Name: preferred_countries_pref_country_id_seq; Type: SEQUENCE; Schema: nrt_skills; Owner: postgres
--

CREATE SEQUENCE nrt_skills.preferred_countries_pref_country_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE nrt_skills.preferred_countries_pref_country_id_seq OWNER TO postgres;

--
-- TOC entry 5699 (class 0 OID 0)
-- Dependencies: 267
-- Name: preferred_countries_pref_country_id_seq; Type: SEQUENCE OWNED BY; Schema: nrt_skills; Owner: postgres
--

ALTER SEQUENCE nrt_skills.preferred_countries_pref_country_id_seq OWNED BY nrt_skills.preferred_countries.pref_country_id;


--
-- TOC entry 268 (class 1259 OID 182250)
-- Name: preferred_sectors; Type: TABLE; Schema: nrt_skills; Owner: postgres
--

CREATE TABLE nrt_skills.preferred_sectors (
    pref_sector_id integer NOT NULL,
    application_id character varying(50) NOT NULL,
    sector_name character varying(150) NOT NULL
);


ALTER TABLE nrt_skills.preferred_sectors OWNER TO postgres;

--
-- TOC entry 269 (class 1259 OID 182253)
-- Name: preferred_sectors_pref_sector_id_seq; Type: SEQUENCE; Schema: nrt_skills; Owner: postgres
--

CREATE SEQUENCE nrt_skills.preferred_sectors_pref_sector_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE nrt_skills.preferred_sectors_pref_sector_id_seq OWNER TO postgres;

--
-- TOC entry 5700 (class 0 OID 0)
-- Dependencies: 269
-- Name: preferred_sectors_pref_sector_id_seq; Type: SEQUENCE OWNED BY; Schema: nrt_skills; Owner: postgres
--

ALTER SEQUENCE nrt_skills.preferred_sectors_pref_sector_id_seq OWNED BY nrt_skills.preferred_sectors.pref_sector_id;


--
-- TOC entry 270 (class 1259 OID 182254)
-- Name: technical_qualifications; Type: TABLE; Schema: nrt_skills; Owner: postgres
--

CREATE TABLE nrt_skills.technical_qualifications (
    tech_id integer NOT NULL,
    application_id character varying(50) NOT NULL,
    course_name character varying(255),
    institution_name character varying(255),
    certification_authority character varying(255),
    duration character varying(100),
    completed_on date
);


ALTER TABLE nrt_skills.technical_qualifications OWNER TO postgres;

--
-- TOC entry 271 (class 1259 OID 182259)
-- Name: technical_qualifications_tech_id_seq; Type: SEQUENCE; Schema: nrt_skills; Owner: postgres
--

CREATE SEQUENCE nrt_skills.technical_qualifications_tech_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE nrt_skills.technical_qualifications_tech_id_seq OWNER TO postgres;

--
-- TOC entry 5701 (class 0 OID 0)
-- Dependencies: 271
-- Name: technical_qualifications_tech_id_seq; Type: SEQUENCE OWNED BY; Schema: nrt_skills; Owner: postgres
--

ALTER SEQUENCE nrt_skills.technical_qualifications_tech_id_seq OWNED BY nrt_skills.technical_qualifications.tech_id;


--
-- TOC entry 272 (class 1259 OID 182260)
-- Name: work_experience; Type: TABLE; Schema: nrt_skills; Owner: postgres
--

CREATE TABLE nrt_skills.work_experience (
    work_id integer NOT NULL,
    application_id character varying(50) NOT NULL,
    organization character varying(255),
    designation character varying(150),
    duration character varying(100),
    nature_of_work character varying(255),
    country character varying(150)
);


ALTER TABLE nrt_skills.work_experience OWNER TO postgres;

--
-- TOC entry 273 (class 1259 OID 182265)
-- Name: work_experience_work_id_seq; Type: SEQUENCE; Schema: nrt_skills; Owner: postgres
--

CREATE SEQUENCE nrt_skills.work_experience_work_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE nrt_skills.work_experience_work_id_seq OWNER TO postgres;

--
-- TOC entry 5702 (class 0 OID 0)
-- Dependencies: 273
-- Name: work_experience_work_id_seq; Type: SEQUENCE OWNED BY; Schema: nrt_skills; Owner: postgres
--

ALTER SEQUENCE nrt_skills.work_experience_work_id_seq OWNED BY nrt_skills.work_experience.work_id;


--
-- TOC entry 274 (class 1259 OID 182266)
-- Name: admins; Type: TABLE; Schema: nrtday; Owner: postgres
--

CREATE TABLE nrtday.admins (
    username character varying(50) NOT NULL,
    password character varying(255) NOT NULL,
    created_at timestamp without time zone DEFAULT now(),
    email character varying(255),
    admin_id uuid DEFAULT gen_random_uuid() NOT NULL
);


ALTER TABLE nrtday.admins OWNER TO postgres;

--
-- TOC entry 275 (class 1259 OID 182273)
-- Name: association_delegates; Type: TABLE; Schema: nrtday; Owner: postgres
--

CREATE TABLE nrtday.association_delegates (
    name character varying(150),
    contact_number character varying(30),
    passport_number character varying(50),
    oci_number character varying(50),
    email character varying(255),
    delegate_id uuid DEFAULT gen_random_uuid() NOT NULL,
    association_id uuid DEFAULT gen_random_uuid(),
    status character varying(255) DEFAULT 'pending'::character varying,
    rejection_reason text,
    is_representative boolean DEFAULT false
);


ALTER TABLE nrtday.association_delegates OWNER TO postgres;

--
-- TOC entry 276 (class 1259 OID 182279)
-- Name: association_participants; Type: TABLE; Schema: nrtday; Owner: postgres
--

CREATE TABLE nrtday.association_participants (
    association_name character varying(200) NOT NULL,
    country character varying(100),
    city character varying(100),
    registration_number character varying(100),
    representative_name character varying(150),
    representative_contact character varying(20),
    representative_email character varying(150),
    proof_tamil_origin text,
    roommate_preference character varying(150),
    profile_image text,
    state character varying(150),
    boarding_type text,
    boarding_date date,
    drop_point text,
    arrival_time timestamp without time zone,
    association_id uuid DEFAULT gen_random_uuid() NOT NULL,
    participant_id uuid,
    representative_position character varying(150),
    representative_isd_code character varying(10)
);


ALTER TABLE nrtday.association_participants OWNER TO postgres;

--
-- TOC entry 327 (class 1259 OID 208568)
-- Name: b2b_meetings; Type: TABLE; Schema: nrtday; Owner: postgres
--

CREATE TABLE nrtday.b2b_meetings (
    user_id uuid NOT NULL,
    participant_id uuid NOT NULL,
    gov_department character varying(150),
    mou_interest character varying(10),
    employment_interest character varying(10),
    investment_interest character varying(10),
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    id uuid DEFAULT gen_random_uuid() NOT NULL
);


ALTER TABLE nrtday.b2b_meetings OWNER TO postgres;

--
-- TOC entry 326 (class 1259 OID 208564)
-- Name: b2b_meetings_backup; Type: TABLE; Schema: nrtday; Owner: postgres
--

CREATE TABLE nrtday.b2b_meetings_backup (
    id integer,
    user_id uuid,
    participant_id uuid,
    gov_department character varying(150),
    mou_interest character varying(10),
    employment_interest character varying(10),
    investment_interest character varying(10),
    created_at timestamp without time zone
);


ALTER TABLE nrtday.b2b_meetings_backup OWNER TO postgres;

--
-- TOC entry 322 (class 1259 OID 183839)
-- Name: cities; Type: TABLE; Schema: nrtday; Owner: postgres
--

CREATE TABLE nrtday.cities (
    id bigint NOT NULL,
    name character varying(255) NOT NULL,
    state_id bigint NOT NULL,
    state_code character varying(255) NOT NULL,
    country_id bigint NOT NULL,
    country_code character(2) NOT NULL,
    latitude numeric(10,8) NOT NULL,
    longitude numeric(11,8) NOT NULL,
    timezone character varying(255),
    created_at timestamp without time zone DEFAULT '2014-01-01 12:01:01'::timestamp without time zone NOT NULL,
    updated_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
    flag smallint DEFAULT 1 NOT NULL,
    "wikiDataId" character varying(255)
);


ALTER TABLE nrtday.cities OWNER TO postgres;

--
-- TOC entry 5703 (class 0 OID 0)
-- Dependencies: 322
-- Name: COLUMN cities.timezone; Type: COMMENT; Schema: nrtday; Owner: postgres
--

COMMENT ON COLUMN nrtday.cities.timezone IS 'IANA timezone identifier (e.g., America/New_York)';


--
-- TOC entry 5704 (class 0 OID 0)
-- Dependencies: 322
-- Name: COLUMN cities."wikiDataId"; Type: COMMENT; Schema: nrtday; Owner: postgres
--

COMMENT ON COLUMN nrtday.cities."wikiDataId" IS 'Rapid API GeoDB Cities';


--
-- TOC entry 323 (class 1259 OID 183847)
-- Name: cities_id_seq; Type: SEQUENCE; Schema: nrtday; Owner: postgres
--

ALTER TABLE nrtday.cities ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME nrtday.cities_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


--
-- TOC entry 277 (class 1259 OID 182294)
-- Name: communication_preferences; Type: TABLE; Schema: nrtday; Owner: postgres
--

CREATE TABLE nrtday.communication_preferences (
    email_notifications boolean DEFAULT false,
    whatsapp_alerts boolean DEFAULT true,
    event_reminders boolean DEFAULT false,
    comm_id uuid DEFAULT gen_random_uuid() NOT NULL,
    participant_id uuid
);


ALTER TABLE nrtday.communication_preferences OWNER TO postgres;

--
-- TOC entry 318 (class 1259 OID 183799)
-- Name: countries; Type: TABLE; Schema: nrtday; Owner: postgres
--

CREATE TABLE nrtday.countries (
    id bigint NOT NULL,
    name character varying(100) NOT NULL,
    iso3 character(3),
    numeric_code character(3),
    iso2 character(2),
    phonecode character varying(255),
    capital character varying(255),
    currency character varying(255),
    currency_name character varying(255),
    currency_symbol character varying(255),
    tld character varying(255),
    native character varying(255),
    region character varying(255),
    region_id bigint,
    subregion character varying(255),
    subregion_id bigint,
    nationality character varying(255),
    timezones text,
    translations text,
    latitude numeric(10,8),
    longitude numeric(11,8),
    emoji character varying(191),
    "emojiU" character varying(191),
    created_at timestamp without time zone,
    updated_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
    flag smallint DEFAULT 1 NOT NULL,
    "wikiDataId" character varying(255)
);


ALTER TABLE nrtday.countries OWNER TO postgres;

--
-- TOC entry 5705 (class 0 OID 0)
-- Dependencies: 318
-- Name: COLUMN countries."wikiDataId"; Type: COMMENT; Schema: nrtday; Owner: postgres
--

COMMENT ON COLUMN nrtday.countries."wikiDataId" IS 'Rapid API GeoDB Cities';


--
-- TOC entry 319 (class 1259 OID 183806)
-- Name: countries_id_seq; Type: SEQUENCE; Schema: nrtday; Owner: postgres
--

ALTER TABLE nrtday.countries ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME nrtday.countries_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


--
-- TOC entry 278 (class 1259 OID 182309)
-- Name: country; Type: TABLE; Schema: nrtday; Owner: postgres
--

CREATE TABLE nrtday.country (
    id integer NOT NULL,
    iso character(2) NOT NULL,
    name character varying(80) NOT NULL,
    nicename character varying(80) NOT NULL,
    iso3 character(3),
    numcode smallint,
    phonecode integer NOT NULL
);


ALTER TABLE nrtday.country OWNER TO postgres;

--
-- TOC entry 279 (class 1259 OID 182312)
-- Name: country_id_seq; Type: SEQUENCE; Schema: nrtday; Owner: postgres
--

CREATE SEQUENCE nrtday.country_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE nrtday.country_id_seq OWNER TO postgres;

--
-- TOC entry 5706 (class 0 OID 0)
-- Dependencies: 279
-- Name: country_id_seq; Type: SEQUENCE OWNED BY; Schema: nrtday; Owner: postgres
--

ALTER SEQUENCE nrtday.country_id_seq OWNED BY nrtday.country.id;


--
-- TOC entry 280 (class 1259 OID 182313)
-- Name: dashboard_users; Type: TABLE; Schema: nrtday; Owner: postgres
--

CREATE TABLE nrtday.dashboard_users (
    full_name character varying(150) NOT NULL,
    email character varying(150) NOT NULL,
    password text NOT NULL,
    staff_type character varying(50) NOT NULL,
    status character varying(20) DEFAULT 'active'::character varying,
    created_by integer,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    updated_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    user_id uuid DEFAULT gen_random_uuid() NOT NULL,
    CONSTRAINT dashboard_users_staff_type_check CHECK (((staff_type)::text = ANY (ARRAY[('Admin'::character varying)::text, ('Staff'::character varying)::text, ('Viewer'::character varying)::text]))),
    CONSTRAINT dashboard_users_status_check CHECK (((status)::text = ANY (ARRAY[('active'::character varying)::text, ('inactive'::character varying)::text, ('suspended'::character varying)::text])))
);


ALTER TABLE nrtday.dashboard_users OWNER TO postgres;

--
-- TOC entry 281 (class 1259 OID 182324)
-- Name: declarations; Type: TABLE; Schema: nrtday; Owner: postgres
--

CREATE TABLE nrtday.declarations (
    agreed_terms boolean DEFAULT false,
    place character varying(100),
    signature text,
    signed_at date,
    declaration_id uuid DEFAULT gen_random_uuid() NOT NULL,
    participant_id uuid
);


ALTER TABLE nrtday.declarations OWNER TO postgres;

--
-- TOC entry 324 (class 1259 OID 183980)
-- Name: delegate_attendance; Type: TABLE; Schema: nrtday; Owner: postgres
--

CREATE TABLE nrtday.delegate_attendance (
    attendance_id uuid DEFAULT gen_random_uuid() NOT NULL,
    delegate_id uuid NOT NULL,
    name text NOT NULL,
    travel_number text,
    journey_date date,
    pnr_number text,
    created_at timestamp without time zone DEFAULT now(),
    status character varying(255)
);


ALTER TABLE nrtday.delegate_attendance OWNER TO postgres;

--
-- TOC entry 282 (class 1259 OID 182331)
-- Name: delegate_communication_preferences; Type: TABLE; Schema: nrtday; Owner: postgres
--

CREATE TABLE nrtday.delegate_communication_preferences (
    email_notifications boolean DEFAULT false,
    whatsapp_alerts boolean DEFAULT false,
    event_reminders boolean DEFAULT false,
    delegate_id uuid DEFAULT gen_random_uuid(),
    delegate_comm_id uuid DEFAULT gen_random_uuid() NOT NULL,
    individual_id uuid
);


ALTER TABLE nrtday.delegate_communication_preferences OWNER TO postgres;

--
-- TOC entry 283 (class 1259 OID 182338)
-- Name: delegate_documents; Type: TABLE; Schema: nrtday; Owner: postgres
--

CREATE TABLE nrtday.delegate_documents (
    doc_type character varying(50),
    file_path text NOT NULL,
    uploaded_at timestamp without time zone DEFAULT now(),
    delegate_id uuid DEFAULT gen_random_uuid(),
    delegate_doc_id uuid DEFAULT gen_random_uuid() NOT NULL,
    individual_id uuid
);


ALTER TABLE nrtday.delegate_documents OWNER TO postgres;

--
-- TOC entry 284 (class 1259 OID 182345)
-- Name: delegate_event_participation; Type: TABLE; Schema: nrtday; Owner: postgres
--

CREATE TABLE nrtday.delegate_event_participation (
    attending_all_days boolean,
    attendance_from date,
    attendance_to date,
    need_hotel boolean,
    food_preference character varying(20),
    hotel_preference character varying(20),
    created_at timestamp without time zone DEFAULT now(),
    delegate_id uuid DEFAULT gen_random_uuid(),
    delegate_event_id uuid DEFAULT gen_random_uuid() NOT NULL,
    individual_id uuid
);


ALTER TABLE nrtday.delegate_event_participation OWNER TO postgres;

--
-- TOC entry 285 (class 1259 OID 182350)
-- Name: delegate_passes; Type: TABLE; Schema: nrtday; Owner: postgres
--

CREATE TABLE nrtday.delegate_passes (
    qr_code_path text NOT NULL,
    id_card_path text NOT NULL,
    status character varying(20) DEFAULT 'confirmed'::character varying,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    delegate_id uuid DEFAULT gen_random_uuid(),
    pass_id uuid DEFAULT gen_random_uuid() NOT NULL,
    individual_id uuid
);


ALTER TABLE nrtday.delegate_passes OWNER TO postgres;

--
-- TOC entry 286 (class 1259 OID 182358)
-- Name: documents; Type: TABLE; Schema: nrtday; Owner: postgres
--

CREATE TABLE nrtday.documents (
    doc_type character varying(50),
    file_path text,
    uploaded_at timestamp without time zone DEFAULT now(),
    doc_id uuid DEFAULT gen_random_uuid() NOT NULL,
    participant_id uuid
);


ALTER TABLE nrtday.documents OWNER TO postgres;

--
-- TOC entry 287 (class 1259 OID 182365)
-- Name: event_participation; Type: TABLE; Schema: nrtday; Owner: postgres
--

CREATE TABLE nrtday.event_participation (
    attending_all_days boolean,
    attendance_from date,
    attendance_to date,
    need_hotel boolean,
    hotel_preference nrtday.hotel_pref,
    food_preference nrtday.food_pref,
    visit_sricorridor boolean,
    boarding_type text,
    boarding_date date,
    drop_point text,
    arrival_time timestamp without time zone,
    participation_id uuid DEFAULT gen_random_uuid() NOT NULL,
    participant_id uuid
);


ALTER TABLE nrtday.event_participation OWNER TO postgres;

--
-- TOC entry 288 (class 1259 OID 182371)
-- Name: hotel_availability; Type: TABLE; Schema: nrtday; Owner: postgres
--

CREATE TABLE nrtday.hotel_availability (
    start_date date NOT NULL,
    end_date date NOT NULL,
    is_available boolean DEFAULT true,
    availability_id uuid DEFAULT gen_random_uuid() NOT NULL,
    hotel_id uuid DEFAULT gen_random_uuid()
);


ALTER TABLE nrtday.hotel_availability OWNER TO postgres;

--
-- TOC entry 289 (class 1259 OID 182376)
-- Name: hotel_bookings; Type: TABLE; Schema: nrtday; Owner: postgres
--

CREATE TABLE nrtday.hotel_bookings (
    participant_type character varying(20) NOT NULL,
    start_date date NOT NULL,
    end_date date NOT NULL,
    created_at timestamp without time zone DEFAULT now(),
    booking_id uuid DEFAULT gen_random_uuid() NOT NULL,
    hotel_id uuid DEFAULT gen_random_uuid(),
    room_id uuid,
    sub_room_id uuid,
    participant_id uuid,
    association_id uuid,
    delegate_id uuid
);


ALTER TABLE nrtday.hotel_bookings OWNER TO postgres;

--
-- TOC entry 290 (class 1259 OID 182381)
-- Name: hotels; Type: TABLE; Schema: nrtday; Owner: postgres
--

CREATE TABLE nrtday.hotels (
    hotel_name character varying(150) NOT NULL,
    address text,
    city character varying(100),
    state character varying(100),
    country character varying(100),
    contact_number character varying(20),
    email character varying(100),
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    hotel_id uuid DEFAULT gen_random_uuid() NOT NULL
);


ALTER TABLE nrtday.hotels OWNER TO postgres;

--
-- TOC entry 291 (class 1259 OID 182388)
-- Name: individual_participants; Type: TABLE; Schema: nrtday; Owner: postgres
--

CREATE TABLE nrtday.individual_participants (
    full_name character varying(150) NOT NULL,
    gender nrtday.gender_type,
    date_of_birth date,
    nationality character varying(100),
    passport_oci_number character varying(100),
    proof_tamil_origin text,
    country_of_residence character varying(100),
    city_of_residence character varying(100),
    mobile_number character varying(20),
    whatsapp_number character varying(20),
    email character varying(150),
    company_name character varying(200),
    specific_details text,
    profile_image text,
    passport_number character varying(50),
    oci_number character varying(50),
    job_title text,
    department text,
    experience_years integer,
    work_location text,
    state_of_residence character varying(150),
    work_proof character varying(255),
    migration_year integer,
    individual_id uuid DEFAULT gen_random_uuid() NOT NULL,
    participant_id uuid,
    tamilnadu_address_line1 character varying(255),
    tamilnadu_address_line2 character varying(255),
    tamilnadu_taluk character varying(150),
    tamilnadu_district character varying(150),
    tamilnadu_pincode character varying(10)
);


ALTER TABLE nrtday.individual_participants OWNER TO postgres;

--
-- TOC entry 292 (class 1259 OID 182394)
-- Name: nominee_details; Type: TABLE; Schema: nrtday; Owner: postgres
--

CREATE TABLE nrtday.nominee_details (
    nominee_first_name character varying(100),
    nominee_middle_name character varying(100),
    nominee_last_name character varying(100),
    nominee_gender character varying(20),
    nominee_date_of_birth date,
    nominee_age integer,
    nominee_nationality character varying(100),
    nominee_country_of_residence character varying(100),
    nominee_state_if_in_india character varying(100),
    nominee_residing_city character varying(100),
    nominee_period_of_stay_outside_tamilnadu character varying(50),
    nominee_place_of_birth character varying(100),
    nominee_native_district_tamilnadu character varying(100),
    nominee_email character varying(150),
    nominee_country_code character varying(10),
    nominee_mobile_number character varying(20),
    nominee_whatsapp_number character varying(20),
    nominee_contact_number_in_india character varying(20),
    nominee_profession character varying(100),
    nominee_organization_name character varying(200),
    nominee_designation character varying(100),
    nominee_type_of_nrt character varying(100),
    nominee_id uuid DEFAULT gen_random_uuid() NOT NULL,
    nomination_id uuid
);


ALTER TABLE nrtday.nominee_details OWNER TO postgres;

--
-- TOC entry 293 (class 1259 OID 182400)
-- Name: nominee_justification; Type: TABLE; Schema: nrtday; Owner: postgres
--

CREATE TABLE nrtday.nominee_justification (
    justification_for_award text,
    justification_for_nomination text,
    summary_of_contributions text,
    contribution_to_diaspora text,
    justification_id uuid DEFAULT gen_random_uuid() NOT NULL,
    nomination_id uuid
);


ALTER TABLE nrtday.nominee_justification OWNER TO postgres;

--
-- TOC entry 294 (class 1259 OID 182406)
-- Name: nrt_award_nomination; Type: TABLE; Schema: nrtday; Owner: postgres
--

CREATE TABLE nrtday.nrt_award_nomination (
    award_category character varying(50) NOT NULL,
    nomination_category character varying(50) NOT NULL,
    nominator_first_name character varying(100),
    nominator_middle_name character varying(100),
    nominator_last_name character varying(100),
    nominator_occupation character varying(150),
    nominator_organization_name character varying(200),
    nominator_relationship_with_nominee character varying(150),
    nominator_email character varying(150),
    nominator_country_code character varying(10),
    nominator_mobile_number character varying(20),
    nominator_whatsapp_number character varying(20),
    photo_path text,
    supporting_document_path character varying(255),
    status character varying(20) DEFAULT 'Pending'::character varying NOT NULL,
    nomination_id uuid DEFAULT gen_random_uuid() NOT NULL,
    CONSTRAINT nrt_award_nomination_nomination_category_check CHECK (((nomination_category)::text = ANY (ARRAY[('Self'::character varying)::text, ('Nominating another person'::character varying)::text]))),
    CONSTRAINT nrt_award_nomination_status_check CHECK (((status)::text = ANY (ARRAY[('Pending'::character varying)::text, ('Approved'::character varying)::text, ('Rejected'::character varying)::text])))
);


ALTER TABLE nrtday.nrt_award_nomination OWNER TO postgres;

--
-- TOC entry 295 (class 1259 OID 182416)
-- Name: nrt_driver_details; Type: TABLE; Schema: nrtday; Owner: postgres
--

CREATE TABLE nrtday.nrt_driver_details (
    license_number character varying(50) NOT NULL,
    license_validity date,
    vehicle_type character varying(50),
    vehicle_number character varying(50),
    driver_experience integer,
    created_at timestamp without time zone DEFAULT now(),
    updated_at timestamp without time zone DEFAULT now(),
    driver_id uuid DEFAULT gen_random_uuid() NOT NULL,
    staff_id uuid,
    CONSTRAINT nrt_driver_details_driver_experience_check CHECK ((driver_experience >= 0))
);


ALTER TABLE nrtday.nrt_driver_details OWNER TO postgres;

--
-- TOC entry 296 (class 1259 OID 182423)
-- Name: nrt_event_feedback; Type: TABLE; Schema: nrtday; Owner: postgres
--

CREATE TABLE nrtday.nrt_event_feedback (
    event_name character varying(150) DEFAULT 'NRT Day Diaspora Event'::character varying,
    participant_name character varying(150) NOT NULL,
    participant_email character varying(150),
    participant_phone character varying(20),
    rating_overall integer,
    rating_organization integer,
    rating_content integer,
    rating_venue integer,
    rating_hospitality integer,
    liked_most text,
    improvement_suggestions text,
    future_topics text,
    willingness_to_recommend boolean DEFAULT false,
    proof_document character varying(255),
    created_at timestamp without time zone DEFAULT now(),
    nrt_id text,
    participant_type text,
    feedback_id uuid DEFAULT gen_random_uuid() NOT NULL,
    CONSTRAINT nrt_event_feedback_rating_content_check CHECK (((rating_content >= 1) AND (rating_content <= 5))),
    CONSTRAINT nrt_event_feedback_rating_hospitality_check CHECK (((rating_hospitality >= 1) AND (rating_hospitality <= 5))),
    CONSTRAINT nrt_event_feedback_rating_organization_check CHECK (((rating_organization >= 1) AND (rating_organization <= 5))),
    CONSTRAINT nrt_event_feedback_rating_overall_check CHECK (((rating_overall >= 1) AND (rating_overall <= 5))),
    CONSTRAINT nrt_event_feedback_rating_venue_check CHECK (((rating_venue >= 1) AND (rating_venue <= 5)))
);


ALTER TABLE nrtday.nrt_event_feedback OWNER TO postgres;

--
-- TOC entry 297 (class 1259 OID 182437)
-- Name: nrt_staffs; Type: TABLE; Schema: nrtday; Owner: postgres
--

CREATE TABLE nrtday.nrt_staffs (
    staff_code character varying(20) NOT NULL,
    full_name character varying(150) NOT NULL,
    gender character varying(10),
    dob date,
    phone character varying(20) NOT NULL,
    email character varying(100),
    address text,
    staff_type character varying(50) NOT NULL,
    photo character varying(255),
    id_card_qr character varying(255),
    status character varying(20) DEFAULT 'Active'::character varying,
    emergency_contact_name character varying(100),
    emergency_contact_phone character varying(20),
    created_at timestamp without time zone DEFAULT now(),
    updated_at timestamp without time zone DEFAULT now(),
    qr_code_path character varying(255),
    id_card_path character varying(255),
    staff_id uuid DEFAULT gen_random_uuid() NOT NULL,
    CONSTRAINT nrt_staffs_gender_check CHECK (((gender)::text = ANY (ARRAY[('Male'::character varying)::text, ('Female'::character varying)::text, ('Other'::character varying)::text]))),
    CONSTRAINT nrt_staffs_status_check CHECK (((status)::text = ANY (ARRAY[('Active'::character varying)::text, ('Inactive'::character varying)::text])))
);


ALTER TABLE nrtday.nrt_staffs OWNER TO postgres;

--
-- TOC entry 298 (class 1259 OID 182448)
-- Name: otps; Type: TABLE; Schema: nrtday; Owner: postgres
--

CREATE TABLE nrtday.otps (
    otp_code character varying(6) NOT NULL,
    expires_at timestamp without time zone NOT NULL,
    is_used boolean DEFAULT false,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    id uuid DEFAULT gen_random_uuid() NOT NULL,
    user_id uuid
);


ALTER TABLE nrtday.otps OWNER TO postgres;

--
-- TOC entry 299 (class 1259 OID 182454)
-- Name: participant_documents; Type: TABLE; Schema: nrtday; Owner: postgres
--

CREATE TABLE nrtday.participant_documents (
    unique_id character varying(100) NOT NULL,
    qr_code_path text,
    id_card_path text,
    generated_at timestamp without time zone DEFAULT now(),
    status character varying(20) NOT NULL,
    doc_id uuid DEFAULT gen_random_uuid() NOT NULL,
    participant_id uuid
);


ALTER TABLE nrtday.participant_documents OWNER TO postgres;

--
-- TOC entry 300 (class 1259 OID 182461)
-- Name: participants; Type: TABLE; Schema: nrtday; Owner: postgres
--

CREATE TABLE nrtday.participants (
    participant_type nrtday.participant_type NOT NULL,
    created_at timestamp without time zone DEFAULT now(),
    status nrtday.participant_status DEFAULT 'pending'::nrtday.participant_status,
    unique_id character varying(255),
    participant_id uuid DEFAULT gen_random_uuid() NOT NULL,
    user_id uuid,
    submit_status character varying(20) DEFAULT 'pending'::character varying,
    rejection_reason text
);


ALTER TABLE nrtday.participants OWNER TO postgres;

--
-- TOC entry 301 (class 1259 OID 182467)
-- Name: previous_awards; Type: TABLE; Schema: nrtday; Owner: postgres
--

CREATE TABLE nrtday.previous_awards (
    award_name character varying(255),
    year_granted integer,
    award_granting_organization character varying(255),
    award_work_reason character varying(255),
    nomination_id uuid,
    award_id uuid DEFAULT gen_random_uuid() NOT NULL
);


ALTER TABLE nrtday.previous_awards OWNER TO postgres;

--
-- TOC entry 302 (class 1259 OID 182473)
-- Name: recaptcha_logs; Type: TABLE; Schema: nrtday; Owner: postgres
--

CREATE TABLE nrtday.recaptcha_logs (
    user_ip character varying(45),
    response_token text,
    is_valid boolean DEFAULT false,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    id uuid DEFAULT gen_random_uuid() NOT NULL
);


ALTER TABLE nrtday.recaptcha_logs OWNER TO postgres;

--
-- TOC entry 303 (class 1259 OID 182481)
-- Name: regions; Type: TABLE; Schema: nrtday; Owner: postgres
--

CREATE TABLE nrtday.regions (
    id bigint NOT NULL,
    name character varying(100) NOT NULL,
    translations text,
    created_at timestamp without time zone,
    updated_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
    flag smallint DEFAULT 1 NOT NULL,
    "wikiDataId" character varying(255)
);


ALTER TABLE nrtday.regions OWNER TO postgres;

--
-- TOC entry 5707 (class 0 OID 0)
-- Dependencies: 303
-- Name: COLUMN regions."wikiDataId"; Type: COMMENT; Schema: nrtday; Owner: postgres
--

COMMENT ON COLUMN nrtday.regions."wikiDataId" IS 'Rapid API GeoDB Cities';


--
-- TOC entry 304 (class 1259 OID 182488)
-- Name: regions_id_seq; Type: SEQUENCE; Schema: nrtday; Owner: postgres
--

ALTER TABLE nrtday.regions ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME nrtday.regions_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


--
-- TOC entry 305 (class 1259 OID 182489)
-- Name: roommate_preferences; Type: TABLE; Schema: nrtday; Owner: postgres
--

CREATE TABLE nrtday.roommate_preferences (
    room_a character varying(255) NOT NULL,
    room_b character varying(255) NOT NULL,
    created_at timestamp without time zone DEFAULT now(),
    association_id uuid DEFAULT gen_random_uuid(),
    id uuid DEFAULT gen_random_uuid() NOT NULL
);


ALTER TABLE nrtday.roommate_preferences OWNER TO postgres;

--
-- TOC entry 306 (class 1259 OID 182496)
-- Name: rooms; Type: TABLE; Schema: nrtday; Owner: postgres
--

CREATE TABLE nrtday.rooms (
    room_no character varying(10) NOT NULL,
    room_type character varying(20) NOT NULL,
    category character varying(50) NOT NULL,
    status character varying(20) DEFAULT 'available'::character varying,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    hotel_id uuid DEFAULT gen_random_uuid(),
    room_id uuid DEFAULT gen_random_uuid() NOT NULL,
    room_id_new uuid DEFAULT gen_random_uuid()
);


ALTER TABLE nrtday.rooms OWNER TO postgres;

--
-- TOC entry 307 (class 1259 OID 182502)
-- Name: sponsors; Type: TABLE; Schema: nrtday; Owner: postgres
--

CREATE TABLE nrtday.sponsors (
    organization_name character varying(255) NOT NULL,
    contact_person character varying(150),
    designation character varying(150),
    email character varying(150) NOT NULL,
    phone character varying(20),
    address text,
    category character varying(100) NOT NULL,
    amount numeric(12,2) NOT NULL,
    company_tagline character varying(255),
    logo character varying(255),
    has_acknowledged_benefits boolean DEFAULT false NOT NULL,
    has_declared boolean DEFAULT false NOT NULL,
    payment_status character varying(20) DEFAULT 'Pending'::character varying,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    id uuid DEFAULT gen_random_uuid() NOT NULL,
    CONSTRAINT sponsors_payment_status_check CHECK (((payment_status)::text = ANY (ARRAY[('Pending'::character varying)::text, ('Success'::character varying)::text, ('Failed'::character varying)::text, ('Cancelled'::character varying)::text, ('Refunded'::character varying)::text])))
);


ALTER TABLE nrtday.sponsors OWNER TO postgres;

--
-- TOC entry 308 (class 1259 OID 182513)
-- Name: sponsorship_declarations; Type: TABLE; Schema: nrtday; Owner: postgres
--

CREATE TABLE nrtday.sponsorship_declarations (
    has_declared boolean DEFAULT false,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    has_acknowledged_benefits boolean DEFAULT false,
    declaration_id uuid DEFAULT gen_random_uuid() NOT NULL,
    sponsorship_id uuid
);


ALTER TABLE nrtday.sponsorship_declarations OWNER TO postgres;

--
-- TOC entry 309 (class 1259 OID 182520)
-- Name: sponsorship_payments; Type: TABLE; Schema: nrtday; Owner: postgres
--

CREATE TABLE nrtday.sponsorship_payments (
    payment_method character varying(50),
    payment_reference character varying(100) NOT NULL,
    amount numeric(12,2) NOT NULL,
    currency character varying(10) DEFAULT 'INR'::character varying,
    status character varying(30) DEFAULT 'Pending'::character varying,
    paid_on timestamp without time zone,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    payment_id uuid DEFAULT gen_random_uuid() NOT NULL,
    sponsorship_id uuid,
    CONSTRAINT sponsorship_payments_payment_method_check CHECK (((payment_method)::text = ANY (ARRAY[('Razorpay'::character varying)::text, ('Bank Transfer'::character varying)::text, ('UPI/Wallet'::character varying)::text, ('Cheque'::character varying)::text, ('International Transfer'::character varying)::text])))
);


ALTER TABLE nrtday.sponsorship_payments OWNER TO postgres;

--
-- TOC entry 310 (class 1259 OID 182528)
-- Name: sponsorships; Type: TABLE; Schema: nrtday; Owner: postgres
--

CREATE TABLE nrtday.sponsorships (
    organization_name character varying(255) NOT NULL,
    contact_person character varying(150),
    designation character varying(150),
    email character varying(150),
    phone character varying(50),
    address text,
    category character varying(50),
    agreed_terms boolean DEFAULT false,
    company_tagline character varying(255),
    logo_path text,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    updated_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    sponsorship_id uuid DEFAULT gen_random_uuid() NOT NULL,
    sponsorship_amount numeric(12,2),
    logo text,
    has_acknowledged_benefits boolean DEFAULT false,
    has_declared boolean DEFAULT false,
    CONSTRAINT sponsorships_category_check CHECK (((category)::text = ANY (ARRAY[('Title Sponsor'::character varying)::text, ('Platinum Sponsor'::character varying)::text, ('Gold Sponsor'::character varying)::text, ('Silver Sponsor'::character varying)::text, ('Community Partner'::character varying)::text])))
);


ALTER TABLE nrtday.sponsorships OWNER TO postgres;

--
-- TOC entry 311 (class 1259 OID 182538)
-- Name: stall_bookings; Type: TABLE; Schema: nrtday; Owner: postgres
--

CREATE TABLE nrtday.stall_bookings (
    booth_number character varying(50) NOT NULL,
    booking_amount numeric(10,2) NOT NULL,
    organization character varying(255) NOT NULL,
    contact_person character varying(255) NOT NULL,
    address text NOT NULL,
    phone character varying(20) NOT NULL,
    email character varying(100) NOT NULL,
    stall_type character varying(100) NOT NULL,
    other_stall_type character varying(255),
    concept text NOT NULL,
    declaration boolean DEFAULT true NOT NULL,
    status character varying(20) DEFAULT 'Pending'::character varying NOT NULL,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    updated_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    id uuid DEFAULT gen_random_uuid() NOT NULL,
    stall_id uuid,
    CONSTRAINT stall_bookings_status_check CHECK (((status)::text = ANY (ARRAY[('Pending'::character varying)::text, ('Confirmed'::character varying)::text, ('Cancelled'::character varying)::text])))
);


ALTER TABLE nrtday.stall_bookings OWNER TO postgres;

--
-- TOC entry 325 (class 1259 OID 183996)
-- Name: stalls; Type: TABLE; Schema: nrtday; Owner: postgres
--

CREATE TABLE nrtday.stalls (
    id uuid DEFAULT gen_random_uuid() NOT NULL,
    booth_number character varying(10),
    size character varying(20),
    price numeric(10,2),
    status character varying(20)
);


ALTER TABLE nrtday.stalls OWNER TO postgres;

--
-- TOC entry 312 (class 1259 OID 182559)
-- Name: state_list; Type: TABLE; Schema: nrtday; Owner: postgres
--

CREATE TABLE nrtday.state_list (
    id integer NOT NULL,
    state character varying(50) NOT NULL
);


ALTER TABLE nrtday.state_list OWNER TO postgres;

--
-- TOC entry 313 (class 1259 OID 182562)
-- Name: state_list_id_seq; Type: SEQUENCE; Schema: nrtday; Owner: postgres
--

CREATE SEQUENCE nrtday.state_list_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE nrtday.state_list_id_seq OWNER TO postgres;

--
-- TOC entry 5708 (class 0 OID 0)
-- Dependencies: 313
-- Name: state_list_id_seq; Type: SEQUENCE OWNED BY; Schema: nrtday; Owner: postgres
--

ALTER SEQUENCE nrtday.state_list_id_seq OWNED BY nrtday.state_list.id;


--
-- TOC entry 320 (class 1259 OID 183823)
-- Name: states; Type: TABLE; Schema: nrtday; Owner: postgres
--

CREATE TABLE nrtday.states (
    id bigint NOT NULL,
    name character varying(255) NOT NULL,
    country_id bigint NOT NULL,
    country_code character(2) NOT NULL,
    fips_code character varying(255),
    iso2 character varying(255),
    iso3166_2 character varying(10),
    type character varying(191),
    level integer,
    parent_id bigint,
    native character varying(255),
    latitude numeric(10,8),
    longitude numeric(11,8),
    timezone character varying(255),
    created_at timestamp without time zone,
    updated_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
    flag smallint DEFAULT 1 NOT NULL,
    "wikiDataId" character varying(255)
);


ALTER TABLE nrtday.states OWNER TO postgres;

--
-- TOC entry 5709 (class 0 OID 0)
-- Dependencies: 320
-- Name: COLUMN states.timezone; Type: COMMENT; Schema: nrtday; Owner: postgres
--

COMMENT ON COLUMN nrtday.states.timezone IS 'IANA timezone identifier (e.g., America/New_York)';


--
-- TOC entry 5710 (class 0 OID 0)
-- Dependencies: 320
-- Name: COLUMN states."wikiDataId"; Type: COMMENT; Schema: nrtday; Owner: postgres
--

COMMENT ON COLUMN nrtday.states."wikiDataId" IS 'Rapid API GeoDB Cities';


--
-- TOC entry 321 (class 1259 OID 183830)
-- Name: states_id_seq; Type: SEQUENCE; Schema: nrtday; Owner: postgres
--

ALTER TABLE nrtday.states ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME nrtday.states_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


--
-- TOC entry 314 (class 1259 OID 182571)
-- Name: sub_rooms; Type: TABLE; Schema: nrtday; Owner: postgres
--

CREATE TABLE nrtday.sub_rooms (
    sub_room_no character varying(10) NOT NULL,
    status character varying(20) DEFAULT 'available'::character varying,
    room_id uuid,
    sub_room_id uuid DEFAULT gen_random_uuid() NOT NULL
);


ALTER TABLE nrtday.sub_rooms OWNER TO postgres;

--
-- TOC entry 315 (class 1259 OID 182576)
-- Name: subregions; Type: TABLE; Schema: nrtday; Owner: postgres
--

CREATE TABLE nrtday.subregions (
    id bigint NOT NULL,
    name character varying(100) NOT NULL,
    translations text,
    region_id bigint NOT NULL,
    created_at timestamp without time zone,
    updated_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
    flag smallint DEFAULT 1 NOT NULL,
    "wikiDataId" character varying(255)
);


ALTER TABLE nrtday.subregions OWNER TO postgres;

--
-- TOC entry 5711 (class 0 OID 0)
-- Dependencies: 315
-- Name: COLUMN subregions."wikiDataId"; Type: COMMENT; Schema: nrtday; Owner: postgres
--

COMMENT ON COLUMN nrtday.subregions."wikiDataId" IS 'Rapid API GeoDB Cities';


--
-- TOC entry 316 (class 1259 OID 182583)
-- Name: subregions_id_seq; Type: SEQUENCE; Schema: nrtday; Owner: postgres
--

ALTER TABLE nrtday.subregions ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY (
    SEQUENCE NAME nrtday.subregions_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1
);


--
-- TOC entry 317 (class 1259 OID 182584)
-- Name: users; Type: TABLE; Schema: nrtday; Owner: postgres
--

CREATE TABLE nrtday.users (
    name character varying(100),
    email character varying(150) NOT NULL,
    password_hash character varying(255),
    is_verified boolean DEFAULT false,
    created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
    participant_type character varying(20),
    country character varying(100),
    unique_code character varying(20),
    old_id integer,
    id uuid DEFAULT gen_random_uuid() NOT NULL
);


ALTER TABLE nrtday.users OWNER TO postgres;

--
-- TOC entry 5079 (class 2604 OID 182592)
-- Name: declaration_consent declaration_id; Type: DEFAULT; Schema: nrt_health; Owner: postgres
--

ALTER TABLE ONLY nrt_health.declaration_consent ALTER COLUMN declaration_id SET DEFAULT nextval('nrt_health.declaration_consent_declaration_id_seq'::regclass);


--
-- TOC entry 5082 (class 2604 OID 182593)
-- Name: documents_checklist id; Type: DEFAULT; Schema: nrt_health; Owner: postgres
--

ALTER TABLE ONLY nrt_health.documents_checklist ALTER COLUMN id SET DEFAULT nextval('nrt_health.documents_checklist_id_seq'::regclass);


--
-- TOC entry 5084 (class 2604 OID 182594)
-- Name: hospital_bookings booking_id; Type: DEFAULT; Schema: nrt_health; Owner: postgres
--

ALTER TABLE ONLY nrt_health.hospital_bookings ALTER COLUMN booking_id SET DEFAULT nextval('nrt_health.hospital_bookings_booking_id_seq'::regclass);


--
-- TOC entry 5088 (class 2604 OID 182595)
-- Name: hospitals hospital_id; Type: DEFAULT; Schema: nrt_health; Owner: postgres
--

ALTER TABLE ONLY nrt_health.hospitals ALTER COLUMN hospital_id SET DEFAULT nextval('nrt_health.hospitals_hospital_id_seq'::regclass);


--
-- TOC entry 5092 (class 2604 OID 182596)
-- Name: logistical_details id; Type: DEFAULT; Schema: nrt_health; Owner: postgres
--

ALTER TABLE ONLY nrt_health.logistical_details ALTER COLUMN id SET DEFAULT nextval('nrt_health.logistical_details_id_seq'::regclass);


--
-- TOC entry 5094 (class 2604 OID 182597)
-- Name: medical_requirements id; Type: DEFAULT; Schema: nrt_health; Owner: postgres
--

ALTER TABLE ONLY nrt_health.medical_requirements ALTER COLUMN id SET DEFAULT nextval('nrt_health.medical_requirements_id_seq'::regclass);


--
-- TOC entry 5096 (class 2604 OID 182598)
-- Name: personal_information person_id; Type: DEFAULT; Schema: nrt_health; Owner: postgres
--

ALTER TABLE ONLY nrt_health.personal_information ALTER COLUMN person_id SET DEFAULT nextval('nrt_health.personal_information_person_id_seq'::regclass);


--
-- TOC entry 5100 (class 2604 OID 182599)
-- Name: nrt_id_communication id; Type: DEFAULT; Schema: nrt_id_register; Owner: postgres
--

ALTER TABLE ONLY nrt_id_register.nrt_id_communication ALTER COLUMN id SET DEFAULT nextval('nrt_id_register.nrt_id_communication_id_seq'::regclass);


--
-- TOC entry 5103 (class 2604 OID 182600)
-- Name: nrt_id_declaration id; Type: DEFAULT; Schema: nrt_id_register; Owner: postgres
--

ALTER TABLE ONLY nrt_id_register.nrt_id_declaration ALTER COLUMN id SET DEFAULT nextval('nrt_id_register.nrt_id_declaration_id_seq'::regclass);


--
-- TOC entry 5108 (class 2604 OID 182601)
-- Name: nrt_id_documents id; Type: DEFAULT; Schema: nrt_id_register; Owner: postgres
--

ALTER TABLE ONLY nrt_id_register.nrt_id_documents ALTER COLUMN id SET DEFAULT nextval('nrt_id_register.nrt_id_documents_id_seq'::regclass);


--
-- TOC entry 5112 (class 2604 OID 182602)
-- Name: nrt_id_registration id; Type: DEFAULT; Schema: nrt_id_register; Owner: postgres
--

ALTER TABLE ONLY nrt_id_register.nrt_id_registration ALTER COLUMN id SET DEFAULT nextval('nrt_id_register.nrt_id_registration_id_seq'::regclass);


--
-- TOC entry 5118 (class 2604 OID 182603)
-- Name: Marriage_Assistance_Form id; Type: DEFAULT; Schema: nrt_marriage; Owner: postgres
--

ALTER TABLE ONLY nrt_marriage."Marriage_Assistance_Form" ALTER COLUMN id SET DEFAULT nextval('nrt_marriage."Marriage_Assistance_Form_id_seq"'::regclass);


--
-- TOC entry 5120 (class 2604 OID 182604)
-- Name: admin_users id; Type: DEFAULT; Schema: nrt_marriage; Owner: postgres
--

ALTER TABLE ONLY nrt_marriage.admin_users ALTER COLUMN id SET DEFAULT nextval('nrt_marriage.admin_users_id_seq'::regclass);


--
-- TOC entry 5122 (class 2604 OID 182605)
-- Name: users id; Type: DEFAULT; Schema: nrt_marriage; Owner: postgres
--

ALTER TABLE ONLY nrt_marriage.users ALTER COLUMN id SET DEFAULT nextval('nrt_marriage.users_id_seq'::regclass);


--
-- TOC entry 5124 (class 2604 OID 182606)
-- Name: application_documents doc_id; Type: DEFAULT; Schema: nrt_skills; Owner: postgres
--

ALTER TABLE ONLY nrt_skills.application_documents ALTER COLUMN doc_id SET DEFAULT nextval('nrt_skills.application_documents_doc_id_seq'::regclass);


--
-- TOC entry 5126 (class 2604 OID 182607)
-- Name: education_qualifications edu_id; Type: DEFAULT; Schema: nrt_skills; Owner: postgres
--

ALTER TABLE ONLY nrt_skills.education_qualifications ALTER COLUMN edu_id SET DEFAULT nextval('nrt_skills.education_qualifications_edu_id_seq'::regclass);


--
-- TOC entry 5127 (class 2604 OID 182608)
-- Name: employers employer_id; Type: DEFAULT; Schema: nrt_skills; Owner: postgres
--

ALTER TABLE ONLY nrt_skills.employers ALTER COLUMN employer_id SET DEFAULT nextval('nrt_skills.employers_employer_id_seq'::regclass);


--
-- TOC entry 5136 (class 2604 OID 182609)
-- Name: jobs job_id; Type: DEFAULT; Schema: nrt_skills; Owner: postgres
--

ALTER TABLE ONLY nrt_skills.jobs ALTER COLUMN job_id SET DEFAULT nextval('nrt_skills.jobs_job_id_seq'::regclass);


--
-- TOC entry 5142 (class 2604 OID 182610)
-- Name: language_proficiency lang_id; Type: DEFAULT; Schema: nrt_skills; Owner: postgres
--

ALTER TABLE ONLY nrt_skills.language_proficiency ALTER COLUMN lang_id SET DEFAULT nextval('nrt_skills.language_proficiency_lang_id_seq'::regclass);


--
-- TOC entry 5146 (class 2604 OID 182611)
-- Name: passport_details passport_id; Type: DEFAULT; Schema: nrt_skills; Owner: postgres
--

ALTER TABLE ONLY nrt_skills.passport_details ALTER COLUMN passport_id SET DEFAULT nextval('nrt_skills.passport_details_passport_id_seq'::regclass);


--
-- TOC entry 5147 (class 2604 OID 182612)
-- Name: preferred_countries pref_country_id; Type: DEFAULT; Schema: nrt_skills; Owner: postgres
--

ALTER TABLE ONLY nrt_skills.preferred_countries ALTER COLUMN pref_country_id SET DEFAULT nextval('nrt_skills.preferred_countries_pref_country_id_seq'::regclass);


--
-- TOC entry 5148 (class 2604 OID 182613)
-- Name: preferred_sectors pref_sector_id; Type: DEFAULT; Schema: nrt_skills; Owner: postgres
--

ALTER TABLE ONLY nrt_skills.preferred_sectors ALTER COLUMN pref_sector_id SET DEFAULT nextval('nrt_skills.preferred_sectors_pref_sector_id_seq'::regclass);


--
-- TOC entry 5149 (class 2604 OID 182614)
-- Name: technical_qualifications tech_id; Type: DEFAULT; Schema: nrt_skills; Owner: postgres
--

ALTER TABLE ONLY nrt_skills.technical_qualifications ALTER COLUMN tech_id SET DEFAULT nextval('nrt_skills.technical_qualifications_tech_id_seq'::regclass);


--
-- TOC entry 5150 (class 2604 OID 182615)
-- Name: work_experience work_id; Type: DEFAULT; Schema: nrt_skills; Owner: postgres
--

ALTER TABLE ONLY nrt_skills.work_experience ALTER COLUMN work_id SET DEFAULT nextval('nrt_skills.work_experience_work_id_seq'::regclass);


--
-- TOC entry 5162 (class 2604 OID 182620)
-- Name: country id; Type: DEFAULT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.country ALTER COLUMN id SET DEFAULT nextval('nrtday.country_id_seq'::regclass);


--
-- TOC entry 5258 (class 2604 OID 182651)
-- Name: state_list id; Type: DEFAULT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.state_list ALTER COLUMN id SET DEFAULT nextval('nrtday.state_list_id_seq'::regclass);


--
-- TOC entry 5300 (class 2606 OID 182654)
-- Name: declaration_consent declaration_consent_pkey; Type: CONSTRAINT; Schema: nrt_health; Owner: postgres
--

ALTER TABLE ONLY nrt_health.declaration_consent
    ADD CONSTRAINT declaration_consent_pkey PRIMARY KEY (declaration_id);


--
-- TOC entry 5302 (class 2606 OID 182656)
-- Name: documents_checklist documents_checklist_pkey; Type: CONSTRAINT; Schema: nrt_health; Owner: postgres
--

ALTER TABLE ONLY nrt_health.documents_checklist
    ADD CONSTRAINT documents_checklist_pkey PRIMARY KEY (id);


--
-- TOC entry 5304 (class 2606 OID 182658)
-- Name: hospital_bookings hospital_bookings_pkey; Type: CONSTRAINT; Schema: nrt_health; Owner: postgres
--

ALTER TABLE ONLY nrt_health.hospital_bookings
    ADD CONSTRAINT hospital_bookings_pkey PRIMARY KEY (booking_id);


--
-- TOC entry 5306 (class 2606 OID 182660)
-- Name: hospitals hospitals_pkey; Type: CONSTRAINT; Schema: nrt_health; Owner: postgres
--

ALTER TABLE ONLY nrt_health.hospitals
    ADD CONSTRAINT hospitals_pkey PRIMARY KEY (hospital_id);


--
-- TOC entry 5308 (class 2606 OID 182662)
-- Name: hospitals hospitals_registration_number_key; Type: CONSTRAINT; Schema: nrt_health; Owner: postgres
--

ALTER TABLE ONLY nrt_health.hospitals
    ADD CONSTRAINT hospitals_registration_number_key UNIQUE (registration_number);


--
-- TOC entry 5310 (class 2606 OID 182664)
-- Name: logistical_details logistical_details_pkey; Type: CONSTRAINT; Schema: nrt_health; Owner: postgres
--

ALTER TABLE ONLY nrt_health.logistical_details
    ADD CONSTRAINT logistical_details_pkey PRIMARY KEY (id);


--
-- TOC entry 5312 (class 2606 OID 182666)
-- Name: medical_requirements medical_requirements_pkey; Type: CONSTRAINT; Schema: nrt_health; Owner: postgres
--

ALTER TABLE ONLY nrt_health.medical_requirements
    ADD CONSTRAINT medical_requirements_pkey PRIMARY KEY (id);


--
-- TOC entry 5314 (class 2606 OID 182668)
-- Name: personal_information personal_information_email_key; Type: CONSTRAINT; Schema: nrt_health; Owner: postgres
--

ALTER TABLE ONLY nrt_health.personal_information
    ADD CONSTRAINT personal_information_email_key UNIQUE (email);


--
-- TOC entry 5316 (class 2606 OID 182670)
-- Name: personal_information personal_information_pkey; Type: CONSTRAINT; Schema: nrt_health; Owner: postgres
--

ALTER TABLE ONLY nrt_health.personal_information
    ADD CONSTRAINT personal_information_pkey PRIMARY KEY (person_id);


--
-- TOC entry 5318 (class 2606 OID 182672)
-- Name: nrt_id_communication nrt_id_communication_pkey; Type: CONSTRAINT; Schema: nrt_id_register; Owner: postgres
--

ALTER TABLE ONLY nrt_id_register.nrt_id_communication
    ADD CONSTRAINT nrt_id_communication_pkey PRIMARY KEY (id);


--
-- TOC entry 5322 (class 2606 OID 182674)
-- Name: nrt_id_declaration nrt_id_declaration_pkey; Type: CONSTRAINT; Schema: nrt_id_register; Owner: postgres
--

ALTER TABLE ONLY nrt_id_register.nrt_id_declaration
    ADD CONSTRAINT nrt_id_declaration_pkey PRIMARY KEY (id);


--
-- TOC entry 5324 (class 2606 OID 182676)
-- Name: nrt_id_documents nrt_id_documents_pkey; Type: CONSTRAINT; Schema: nrt_id_register; Owner: postgres
--

ALTER TABLE ONLY nrt_id_register.nrt_id_documents
    ADD CONSTRAINT nrt_id_documents_pkey PRIMARY KEY (id);


--
-- TOC entry 5326 (class 2606 OID 182678)
-- Name: nrt_id_registration nrt_id_registration_pkey; Type: CONSTRAINT; Schema: nrt_id_register; Owner: postgres
--

ALTER TABLE ONLY nrt_id_register.nrt_id_registration
    ADD CONSTRAINT nrt_id_registration_pkey PRIMARY KEY (id);


--
-- TOC entry 5328 (class 2606 OID 182680)
-- Name: nrt_id_registration nrt_id_registration_registration_id_key; Type: CONSTRAINT; Schema: nrt_id_register; Owner: postgres
--

ALTER TABLE ONLY nrt_id_register.nrt_id_registration
    ADD CONSTRAINT nrt_id_registration_registration_id_key UNIQUE (registration_id);


--
-- TOC entry 5320 (class 2606 OID 182682)
-- Name: nrt_id_communication unique_registration_id; Type: CONSTRAINT; Schema: nrt_id_register; Owner: postgres
--

ALTER TABLE ONLY nrt_id_register.nrt_id_communication
    ADD CONSTRAINT unique_registration_id UNIQUE (registration_id);


--
-- TOC entry 5330 (class 2606 OID 182684)
-- Name: nrt_id_registration unique_user_id; Type: CONSTRAINT; Schema: nrt_id_register; Owner: postgres
--

ALTER TABLE ONLY nrt_id_register.nrt_id_registration
    ADD CONSTRAINT unique_user_id UNIQUE (user_id);


--
-- TOC entry 5332 (class 2606 OID 182686)
-- Name: Marriage_Assistance_Form Marriage_Assistance_Form_pkey; Type: CONSTRAINT; Schema: nrt_marriage; Owner: postgres
--

ALTER TABLE ONLY nrt_marriage."Marriage_Assistance_Form"
    ADD CONSTRAINT "Marriage_Assistance_Form_pkey" PRIMARY KEY (id);


--
-- TOC entry 5334 (class 2606 OID 182688)
-- Name: admin_users admin_users_pkey; Type: CONSTRAINT; Schema: nrt_marriage; Owner: postgres
--

ALTER TABLE ONLY nrt_marriage.admin_users
    ADD CONSTRAINT admin_users_pkey PRIMARY KEY (id);


--
-- TOC entry 5336 (class 2606 OID 182690)
-- Name: admin_users admin_users_username_key; Type: CONSTRAINT; Schema: nrt_marriage; Owner: postgres
--

ALTER TABLE ONLY nrt_marriage.admin_users
    ADD CONSTRAINT admin_users_username_key UNIQUE (username);


--
-- TOC entry 5338 (class 2606 OID 182692)
-- Name: users users_email_key; Type: CONSTRAINT; Schema: nrt_marriage; Owner: postgres
--

ALTER TABLE ONLY nrt_marriage.users
    ADD CONSTRAINT users_email_key UNIQUE (email);


--
-- TOC entry 5340 (class 2606 OID 182694)
-- Name: users users_pkey; Type: CONSTRAINT; Schema: nrt_marriage; Owner: postgres
--

ALTER TABLE ONLY nrt_marriage.users
    ADD CONSTRAINT users_pkey PRIMARY KEY (id);


--
-- TOC entry 5342 (class 2606 OID 182696)
-- Name: application_documents application_documents_pkey; Type: CONSTRAINT; Schema: nrt_skills; Owner: postgres
--

ALTER TABLE ONLY nrt_skills.application_documents
    ADD CONSTRAINT application_documents_pkey PRIMARY KEY (doc_id);


--
-- TOC entry 5344 (class 2606 OID 182698)
-- Name: education_qualifications education_qualifications_pkey; Type: CONSTRAINT; Schema: nrt_skills; Owner: postgres
--

ALTER TABLE ONLY nrt_skills.education_qualifications
    ADD CONSTRAINT education_qualifications_pkey PRIMARY KEY (edu_id);


--
-- TOC entry 5346 (class 2606 OID 182700)
-- Name: employers employers_email_key; Type: CONSTRAINT; Schema: nrt_skills; Owner: postgres
--

ALTER TABLE ONLY nrt_skills.employers
    ADD CONSTRAINT employers_email_key UNIQUE (email);


--
-- TOC entry 5348 (class 2606 OID 182702)
-- Name: employers employers_pkey; Type: CONSTRAINT; Schema: nrt_skills; Owner: postgres
--

ALTER TABLE ONLY nrt_skills.employers
    ADD CONSTRAINT employers_pkey PRIMARY KEY (employer_id);


--
-- TOC entry 5350 (class 2606 OID 182704)
-- Name: job_applications job_applications_pkey; Type: CONSTRAINT; Schema: nrt_skills; Owner: postgres
--

ALTER TABLE ONLY nrt_skills.job_applications
    ADD CONSTRAINT job_applications_pkey PRIMARY KEY (application_id);


--
-- TOC entry 5352 (class 2606 OID 182706)
-- Name: jobs jobs_pkey; Type: CONSTRAINT; Schema: nrt_skills; Owner: postgres
--

ALTER TABLE ONLY nrt_skills.jobs
    ADD CONSTRAINT jobs_pkey PRIMARY KEY (job_id);


--
-- TOC entry 5354 (class 2606 OID 182708)
-- Name: language_proficiency language_proficiency_pkey; Type: CONSTRAINT; Schema: nrt_skills; Owner: postgres
--

ALTER TABLE ONLY nrt_skills.language_proficiency
    ADD CONSTRAINT language_proficiency_pkey PRIMARY KEY (lang_id);


--
-- TOC entry 5356 (class 2606 OID 182710)
-- Name: passport_details passport_details_pkey; Type: CONSTRAINT; Schema: nrt_skills; Owner: postgres
--

ALTER TABLE ONLY nrt_skills.passport_details
    ADD CONSTRAINT passport_details_pkey PRIMARY KEY (passport_id);


--
-- TOC entry 5358 (class 2606 OID 182712)
-- Name: preferred_countries preferred_countries_pkey; Type: CONSTRAINT; Schema: nrt_skills; Owner: postgres
--

ALTER TABLE ONLY nrt_skills.preferred_countries
    ADD CONSTRAINT preferred_countries_pkey PRIMARY KEY (pref_country_id);


--
-- TOC entry 5360 (class 2606 OID 182714)
-- Name: preferred_sectors preferred_sectors_pkey; Type: CONSTRAINT; Schema: nrt_skills; Owner: postgres
--

ALTER TABLE ONLY nrt_skills.preferred_sectors
    ADD CONSTRAINT preferred_sectors_pkey PRIMARY KEY (pref_sector_id);


--
-- TOC entry 5362 (class 2606 OID 182716)
-- Name: technical_qualifications technical_qualifications_pkey; Type: CONSTRAINT; Schema: nrt_skills; Owner: postgres
--

ALTER TABLE ONLY nrt_skills.technical_qualifications
    ADD CONSTRAINT technical_qualifications_pkey PRIMARY KEY (tech_id);


--
-- TOC entry 5364 (class 2606 OID 182718)
-- Name: work_experience work_experience_pkey; Type: CONSTRAINT; Schema: nrt_skills; Owner: postgres
--

ALTER TABLE ONLY nrt_skills.work_experience
    ADD CONSTRAINT work_experience_pkey PRIMARY KEY (work_id);


--
-- TOC entry 5366 (class 2606 OID 183089)
-- Name: admins admins_pkey; Type: CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.admins
    ADD CONSTRAINT admins_pkey PRIMARY KEY (admin_id);


--
-- TOC entry 5368 (class 2606 OID 182722)
-- Name: admins admins_username_key; Type: CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.admins
    ADD CONSTRAINT admins_username_key UNIQUE (username);


--
-- TOC entry 5370 (class 2606 OID 183122)
-- Name: association_delegates association_delegates_pkey; Type: CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.association_delegates
    ADD CONSTRAINT association_delegates_pkey PRIMARY KEY (delegate_id);


--
-- TOC entry 5372 (class 2606 OID 183203)
-- Name: association_participants association_participants_pkey; Type: CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.association_participants
    ADD CONSTRAINT association_participants_pkey PRIMARY KEY (association_id);


--
-- TOC entry 5474 (class 2606 OID 208583)
-- Name: b2b_meetings b2b_meetings_pkey; Type: CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.b2b_meetings
    ADD CONSTRAINT b2b_meetings_pkey PRIMARY KEY (id);


--
-- TOC entry 5465 (class 2606 OID 183849)
-- Name: cities cities_pkey; Type: CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.cities
    ADD CONSTRAINT cities_pkey PRIMARY KEY (id);


--
-- TOC entry 5374 (class 2606 OID 183220)
-- Name: communication_preferences communication_preferences_pkey; Type: CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.communication_preferences
    ADD CONSTRAINT communication_preferences_pkey PRIMARY KEY (comm_id);


--
-- TOC entry 5457 (class 2606 OID 183808)
-- Name: countries countries_pkey; Type: CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.countries
    ADD CONSTRAINT countries_pkey PRIMARY KEY (id);


--
-- TOC entry 5376 (class 2606 OID 182734)
-- Name: country country_pkey; Type: CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.country
    ADD CONSTRAINT country_pkey PRIMARY KEY (id);


--
-- TOC entry 5378 (class 2606 OID 182736)
-- Name: dashboard_users dashboard_users_email_key; Type: CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.dashboard_users
    ADD CONSTRAINT dashboard_users_email_key UNIQUE (email);


--
-- TOC entry 5380 (class 2606 OID 183238)
-- Name: dashboard_users dashboard_users_pkey; Type: CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.dashboard_users
    ADD CONSTRAINT dashboard_users_pkey PRIMARY KEY (user_id);


--
-- TOC entry 5382 (class 2606 OID 183248)
-- Name: declarations declarations_pkey; Type: CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.declarations
    ADD CONSTRAINT declarations_pkey PRIMARY KEY (declaration_id);


--
-- TOC entry 5468 (class 2606 OID 183988)
-- Name: delegate_attendance delegate_attendance_pkey; Type: CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.delegate_attendance
    ADD CONSTRAINT delegate_attendance_pkey PRIMARY KEY (attendance_id);


--
-- TOC entry 5384 (class 2606 OID 183255)
-- Name: delegate_communication_preferences delegate_communication_preferences_pkey; Type: CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.delegate_communication_preferences
    ADD CONSTRAINT delegate_communication_preferences_pkey PRIMARY KEY (delegate_comm_id);


--
-- TOC entry 5386 (class 2606 OID 183264)
-- Name: delegate_documents delegate_documents_pkey; Type: CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.delegate_documents
    ADD CONSTRAINT delegate_documents_pkey PRIMARY KEY (delegate_doc_id);


--
-- TOC entry 5388 (class 2606 OID 183278)
-- Name: delegate_event_participation delegate_event_participation_pkey; Type: CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.delegate_event_participation
    ADD CONSTRAINT delegate_event_participation_pkey PRIMARY KEY (delegate_event_id);


--
-- TOC entry 5390 (class 2606 OID 183287)
-- Name: delegate_passes delegate_passes_pkey; Type: CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.delegate_passes
    ADD CONSTRAINT delegate_passes_pkey PRIMARY KEY (pass_id);


--
-- TOC entry 5392 (class 2606 OID 183296)
-- Name: documents documents_pkey; Type: CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.documents
    ADD CONSTRAINT documents_pkey PRIMARY KEY (doc_id);


--
-- TOC entry 5394 (class 2606 OID 183305)
-- Name: event_participation event_participation_pkey; Type: CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.event_participation
    ADD CONSTRAINT event_participation_pkey PRIMARY KEY (participation_id);


--
-- TOC entry 5396 (class 2606 OID 183312)
-- Name: hotel_availability hotel_availability_pkey; Type: CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.hotel_availability
    ADD CONSTRAINT hotel_availability_pkey PRIMARY KEY (availability_id);


--
-- TOC entry 5398 (class 2606 OID 183319)
-- Name: hotel_bookings hotel_bookings_pkey; Type: CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.hotel_bookings
    ADD CONSTRAINT hotel_bookings_pkey PRIMARY KEY (booking_id);


--
-- TOC entry 5400 (class 2606 OID 183336)
-- Name: hotels hotels_pkey; Type: CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.hotels
    ADD CONSTRAINT hotels_pkey PRIMARY KEY (hotel_id);


--
-- TOC entry 5402 (class 2606 OID 183394)
-- Name: individual_participants individual_participants_pkey; Type: CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.individual_participants
    ADD CONSTRAINT individual_participants_pkey PRIMARY KEY (individual_id);


--
-- TOC entry 5404 (class 2606 OID 183403)
-- Name: nominee_details nominee_details_pkey; Type: CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.nominee_details
    ADD CONSTRAINT nominee_details_pkey PRIMARY KEY (nominee_id);


--
-- TOC entry 5406 (class 2606 OID 183412)
-- Name: nominee_justification nominee_justification_pkey; Type: CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.nominee_justification
    ADD CONSTRAINT nominee_justification_pkey PRIMARY KEY (justification_id);


--
-- TOC entry 5408 (class 2606 OID 183428)
-- Name: nrt_award_nomination nrt_award_nomination_pkey; Type: CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.nrt_award_nomination
    ADD CONSTRAINT nrt_award_nomination_pkey PRIMARY KEY (nomination_id);


--
-- TOC entry 5410 (class 2606 OID 183450)
-- Name: nrt_driver_details nrt_driver_details_pkey; Type: CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.nrt_driver_details
    ADD CONSTRAINT nrt_driver_details_pkey PRIMARY KEY (driver_id);


--
-- TOC entry 5412 (class 2606 OID 183459)
-- Name: nrt_event_feedback nrt_event_feedback_pkey; Type: CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.nrt_event_feedback
    ADD CONSTRAINT nrt_event_feedback_pkey PRIMARY KEY (feedback_id);


--
-- TOC entry 5414 (class 2606 OID 183478)
-- Name: nrt_staffs nrt_staffs_pkey; Type: CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.nrt_staffs
    ADD CONSTRAINT nrt_staffs_pkey PRIMARY KEY (staff_id);


--
-- TOC entry 5416 (class 2606 OID 182774)
-- Name: nrt_staffs nrt_staffs_staff_code_key; Type: CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.nrt_staffs
    ADD CONSTRAINT nrt_staffs_staff_code_key UNIQUE (staff_code);


--
-- TOC entry 5418 (class 2606 OID 183497)
-- Name: otps otps_pkey; Type: CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.otps
    ADD CONSTRAINT otps_pkey PRIMARY KEY (id);


--
-- TOC entry 5420 (class 2606 OID 183514)
-- Name: participant_documents participant_documents_pkey; Type: CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.participant_documents
    ADD CONSTRAINT participant_documents_pkey PRIMARY KEY (doc_id);


--
-- TOC entry 5422 (class 2606 OID 183526)
-- Name: participants participants_pkey; Type: CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.participants
    ADD CONSTRAINT participants_pkey PRIMARY KEY (participant_id);


--
-- TOC entry 5424 (class 2606 OID 183570)
-- Name: previous_awards previous_awards_pkey; Type: CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.previous_awards
    ADD CONSTRAINT previous_awards_pkey PRIMARY KEY (award_id);


--
-- TOC entry 5426 (class 2606 OID 183579)
-- Name: recaptcha_logs recaptcha_logs_pkey; Type: CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.recaptcha_logs
    ADD CONSTRAINT recaptcha_logs_pkey PRIMARY KEY (id);


--
-- TOC entry 5428 (class 2606 OID 182786)
-- Name: regions regions_pkey; Type: CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.regions
    ADD CONSTRAINT regions_pkey PRIMARY KEY (id);


--
-- TOC entry 5430 (class 2606 OID 183588)
-- Name: roommate_preferences roommate_preferences_pkey; Type: CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.roommate_preferences
    ADD CONSTRAINT roommate_preferences_pkey PRIMARY KEY (id);


--
-- TOC entry 5432 (class 2606 OID 183602)
-- Name: rooms rooms_pkey; Type: CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.rooms
    ADD CONSTRAINT rooms_pkey PRIMARY KEY (room_id);


--
-- TOC entry 5434 (class 2606 OID 183621)
-- Name: sponsors sponsors_pkey; Type: CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.sponsors
    ADD CONSTRAINT sponsors_pkey PRIMARY KEY (id);


--
-- TOC entry 5436 (class 2606 OID 183629)
-- Name: sponsorship_declarations sponsorship_declarations_pkey; Type: CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.sponsorship_declarations
    ADD CONSTRAINT sponsorship_declarations_pkey PRIMARY KEY (declaration_id);


--
-- TOC entry 5438 (class 2606 OID 183641)
-- Name: sponsorship_payments sponsorship_payments_pkey; Type: CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.sponsorship_payments
    ADD CONSTRAINT sponsorship_payments_pkey PRIMARY KEY (payment_id);


--
-- TOC entry 5440 (class 2606 OID 183657)
-- Name: sponsorships sponsorships_pkey; Type: CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.sponsorships
    ADD CONSTRAINT sponsorships_pkey PRIMARY KEY (sponsorship_id);


--
-- TOC entry 5442 (class 2606 OID 183676)
-- Name: stall_bookings stall_bookings_pkey; Type: CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.stall_bookings
    ADD CONSTRAINT stall_bookings_pkey PRIMARY KEY (id);


--
-- TOC entry 5472 (class 2606 OID 184001)
-- Name: stalls stalls_pkey; Type: CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.stalls
    ADD CONSTRAINT stalls_pkey PRIMARY KEY (id);


--
-- TOC entry 5444 (class 2606 OID 182806)
-- Name: state_list state_list_pkey; Type: CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.state_list
    ADD CONSTRAINT state_list_pkey PRIMARY KEY (id);


--
-- TOC entry 5462 (class 2606 OID 183832)
-- Name: states states_pkey; Type: CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.states
    ADD CONSTRAINT states_pkey PRIMARY KEY (id);


--
-- TOC entry 5446 (class 2606 OID 183709)
-- Name: sub_rooms sub_rooms_pkey; Type: CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.sub_rooms
    ADD CONSTRAINT sub_rooms_pkey PRIMARY KEY (sub_room_id);


--
-- TOC entry 5448 (class 2606 OID 182814)
-- Name: subregions subregions_pkey; Type: CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.subregions
    ADD CONSTRAINT subregions_pkey PRIMARY KEY (id);


--
-- TOC entry 5470 (class 2606 OID 183995)
-- Name: delegate_attendance unique_delegate; Type: CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.delegate_attendance
    ADD CONSTRAINT unique_delegate UNIQUE (delegate_id);


--
-- TOC entry 5451 (class 2606 OID 182816)
-- Name: users users_email_key; Type: CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.users
    ADD CONSTRAINT users_email_key UNIQUE (email);


--
-- TOC entry 5453 (class 2606 OID 183752)
-- Name: users users_pkey; Type: CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.users
    ADD CONSTRAINT users_pkey PRIMARY KEY (id);


--
-- TOC entry 5455 (class 2606 OID 182820)
-- Name: users users_unique_code_key; Type: CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.users
    ADD CONSTRAINT users_unique_code_key UNIQUE (unique_code);


--
-- TOC entry 5463 (class 1259 OID 183850)
-- Name: cities_country_id_idx; Type: INDEX; Schema: nrtday; Owner: postgres
--

CREATE INDEX cities_country_id_idx ON nrtday.cities USING btree (country_id);


--
-- TOC entry 5466 (class 1259 OID 183851)
-- Name: cities_state_id_idx; Type: INDEX; Schema: nrtday; Owner: postgres
--

CREATE INDEX cities_state_id_idx ON nrtday.cities USING btree (state_id);


--
-- TOC entry 5458 (class 1259 OID 183809)
-- Name: countries_region_id_idx; Type: INDEX; Schema: nrtday; Owner: postgres
--

CREATE INDEX countries_region_id_idx ON nrtday.countries USING btree (region_id);


--
-- TOC entry 5459 (class 1259 OID 183810)
-- Name: countries_subregion_id_idx; Type: INDEX; Schema: nrtday; Owner: postgres
--

CREATE INDEX countries_subregion_id_idx ON nrtday.countries USING btree (subregion_id);


--
-- TOC entry 5460 (class 1259 OID 183833)
-- Name: states_country_id_idx; Type: INDEX; Schema: nrtday; Owner: postgres
--

CREATE INDEX states_country_id_idx ON nrtday.states USING btree (country_id);


--
-- TOC entry 5449 (class 1259 OID 182826)
-- Name: subregions_region_id_idx; Type: INDEX; Schema: nrtday; Owner: postgres
--

CREATE INDEX subregions_region_id_idx ON nrtday.subregions USING btree (region_id);


--
-- TOC entry 5525 (class 2620 OID 182827)
-- Name: stall_bookings update_stall_bookings_updated_at; Type: TRIGGER; Schema: nrtday; Owner: postgres
--

CREATE TRIGGER update_stall_bookings_updated_at BEFORE UPDATE ON nrtday.stall_bookings FOR EACH ROW EXECUTE FUNCTION nrtday.update_updated_at_column();


--
-- TOC entry 5475 (class 2606 OID 182828)
-- Name: declaration_consent declaration_consent_person_id_fkey; Type: FK CONSTRAINT; Schema: nrt_health; Owner: postgres
--

ALTER TABLE ONLY nrt_health.declaration_consent
    ADD CONSTRAINT declaration_consent_person_id_fkey FOREIGN KEY (person_id) REFERENCES nrt_health.personal_information(person_id) ON DELETE CASCADE;


--
-- TOC entry 5476 (class 2606 OID 182833)
-- Name: documents_checklist documents_checklist_person_id_fkey; Type: FK CONSTRAINT; Schema: nrt_health; Owner: postgres
--

ALTER TABLE ONLY nrt_health.documents_checklist
    ADD CONSTRAINT documents_checklist_person_id_fkey FOREIGN KEY (person_id) REFERENCES nrt_health.personal_information(person_id) ON DELETE CASCADE;


--
-- TOC entry 5477 (class 2606 OID 182838)
-- Name: hospital_bookings hospital_bookings_hospital_id_fkey; Type: FK CONSTRAINT; Schema: nrt_health; Owner: postgres
--

ALTER TABLE ONLY nrt_health.hospital_bookings
    ADD CONSTRAINT hospital_bookings_hospital_id_fkey FOREIGN KEY (hospital_id) REFERENCES nrt_health.hospitals(hospital_id) ON DELETE CASCADE;


--
-- TOC entry 5478 (class 2606 OID 182843)
-- Name: hospital_bookings hospital_bookings_person_id_fkey; Type: FK CONSTRAINT; Schema: nrt_health; Owner: postgres
--

ALTER TABLE ONLY nrt_health.hospital_bookings
    ADD CONSTRAINT hospital_bookings_person_id_fkey FOREIGN KEY (person_id) REFERENCES nrt_health.personal_information(person_id) ON DELETE CASCADE;


--
-- TOC entry 5479 (class 2606 OID 182848)
-- Name: logistical_details logistical_details_person_id_fkey; Type: FK CONSTRAINT; Schema: nrt_health; Owner: postgres
--

ALTER TABLE ONLY nrt_health.logistical_details
    ADD CONSTRAINT logistical_details_person_id_fkey FOREIGN KEY (person_id) REFERENCES nrt_health.personal_information(person_id) ON DELETE CASCADE;


--
-- TOC entry 5480 (class 2606 OID 182853)
-- Name: medical_requirements medical_requirements_person_id_fkey; Type: FK CONSTRAINT; Schema: nrt_health; Owner: postgres
--

ALTER TABLE ONLY nrt_health.medical_requirements
    ADD CONSTRAINT medical_requirements_person_id_fkey FOREIGN KEY (person_id) REFERENCES nrt_health.personal_information(person_id) ON DELETE CASCADE;


--
-- TOC entry 5481 (class 2606 OID 182858)
-- Name: nrt_id_communication nrt_id_communication_registration_id_fkey; Type: FK CONSTRAINT; Schema: nrt_id_register; Owner: postgres
--

ALTER TABLE ONLY nrt_id_register.nrt_id_communication
    ADD CONSTRAINT nrt_id_communication_registration_id_fkey FOREIGN KEY (registration_id) REFERENCES nrt_id_register.nrt_id_registration(registration_id) ON DELETE CASCADE;


--
-- TOC entry 5482 (class 2606 OID 182863)
-- Name: nrt_id_declaration nrt_id_declaration_registration_id_fkey; Type: FK CONSTRAINT; Schema: nrt_id_register; Owner: postgres
--

ALTER TABLE ONLY nrt_id_register.nrt_id_declaration
    ADD CONSTRAINT nrt_id_declaration_registration_id_fkey FOREIGN KEY (registration_id) REFERENCES nrt_id_register.nrt_id_registration(registration_id) ON DELETE CASCADE;


--
-- TOC entry 5488 (class 2606 OID 182868)
-- Name: preferred_countries fk_country_app; Type: FK CONSTRAINT; Schema: nrt_skills; Owner: postgres
--

ALTER TABLE ONLY nrt_skills.preferred_countries
    ADD CONSTRAINT fk_country_app FOREIGN KEY (application_id) REFERENCES nrt_skills.job_applications(application_id) ON DELETE CASCADE;


--
-- TOC entry 5483 (class 2606 OID 182873)
-- Name: application_documents fk_doc_app; Type: FK CONSTRAINT; Schema: nrt_skills; Owner: postgres
--

ALTER TABLE ONLY nrt_skills.application_documents
    ADD CONSTRAINT fk_doc_app FOREIGN KEY (application_id) REFERENCES nrt_skills.job_applications(application_id) ON DELETE CASCADE;


--
-- TOC entry 5484 (class 2606 OID 182878)
-- Name: education_qualifications fk_edu_app; Type: FK CONSTRAINT; Schema: nrt_skills; Owner: postgres
--

ALTER TABLE ONLY nrt_skills.education_qualifications
    ADD CONSTRAINT fk_edu_app FOREIGN KEY (application_id) REFERENCES nrt_skills.job_applications(application_id) ON DELETE CASCADE;


--
-- TOC entry 5486 (class 2606 OID 182883)
-- Name: language_proficiency fk_lang_app; Type: FK CONSTRAINT; Schema: nrt_skills; Owner: postgres
--

ALTER TABLE ONLY nrt_skills.language_proficiency
    ADD CONSTRAINT fk_lang_app FOREIGN KEY (application_id) REFERENCES nrt_skills.job_applications(application_id) ON DELETE CASCADE;


--
-- TOC entry 5487 (class 2606 OID 182888)
-- Name: passport_details fk_passport_app; Type: FK CONSTRAINT; Schema: nrt_skills; Owner: postgres
--

ALTER TABLE ONLY nrt_skills.passport_details
    ADD CONSTRAINT fk_passport_app FOREIGN KEY (application_id) REFERENCES nrt_skills.job_applications(application_id) ON DELETE CASCADE;


--
-- TOC entry 5489 (class 2606 OID 182893)
-- Name: preferred_sectors fk_sector_app; Type: FK CONSTRAINT; Schema: nrt_skills; Owner: postgres
--

ALTER TABLE ONLY nrt_skills.preferred_sectors
    ADD CONSTRAINT fk_sector_app FOREIGN KEY (application_id) REFERENCES nrt_skills.job_applications(application_id) ON DELETE CASCADE;


--
-- TOC entry 5490 (class 2606 OID 182898)
-- Name: technical_qualifications fk_tech_app; Type: FK CONSTRAINT; Schema: nrt_skills; Owner: postgres
--

ALTER TABLE ONLY nrt_skills.technical_qualifications
    ADD CONSTRAINT fk_tech_app FOREIGN KEY (application_id) REFERENCES nrt_skills.job_applications(application_id) ON DELETE CASCADE;


--
-- TOC entry 5491 (class 2606 OID 182903)
-- Name: work_experience fk_work_app; Type: FK CONSTRAINT; Schema: nrt_skills; Owner: postgres
--

ALTER TABLE ONLY nrt_skills.work_experience
    ADD CONSTRAINT fk_work_app FOREIGN KEY (application_id) REFERENCES nrt_skills.job_applications(application_id) ON DELETE CASCADE;


--
-- TOC entry 5485 (class 2606 OID 182908)
-- Name: jobs jobs_employer_id_fkey; Type: FK CONSTRAINT; Schema: nrt_skills; Owner: postgres
--

ALTER TABLE ONLY nrt_skills.jobs
    ADD CONSTRAINT jobs_employer_id_fkey FOREIGN KEY (employer_id) REFERENCES nrt_skills.employers(employer_id) ON DELETE CASCADE;


--
-- TOC entry 5492 (class 2606 OID 183204)
-- Name: association_delegates association_delegates_association_id_fkey; Type: FK CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.association_delegates
    ADD CONSTRAINT association_delegates_association_id_fkey FOREIGN KEY (association_id) REFERENCES nrtday.association_participants(association_id);


--
-- TOC entry 5493 (class 2606 OID 183527)
-- Name: association_participants association_participants_participant_id_fkey; Type: FK CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.association_participants
    ADD CONSTRAINT association_participants_participant_id_fkey FOREIGN KEY (participant_id) REFERENCES nrtday.participants(participant_id);


--
-- TOC entry 5522 (class 2606 OID 183852)
-- Name: cities cities_country_id_fkey; Type: FK CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.cities
    ADD CONSTRAINT cities_country_id_fkey FOREIGN KEY (country_id) REFERENCES nrtday.countries(id);


--
-- TOC entry 5523 (class 2606 OID 183857)
-- Name: cities cities_state_id_fkey; Type: FK CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.cities
    ADD CONSTRAINT cities_state_id_fkey FOREIGN KEY (state_id) REFERENCES nrtday.states(id);


--
-- TOC entry 5494 (class 2606 OID 183532)
-- Name: communication_preferences communication_preferences_participant_id_fkey; Type: FK CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.communication_preferences
    ADD CONSTRAINT communication_preferences_participant_id_fkey FOREIGN KEY (participant_id) REFERENCES nrtday.participants(participant_id);


--
-- TOC entry 5495 (class 2606 OID 183537)
-- Name: declarations declarations_participant_id_fkey; Type: FK CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.declarations
    ADD CONSTRAINT declarations_participant_id_fkey FOREIGN KEY (participant_id) REFERENCES nrtday.participants(participant_id);


--
-- TOC entry 5524 (class 2606 OID 183989)
-- Name: delegate_attendance delegate_attendance_delegate_id_fkey; Type: FK CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.delegate_attendance
    ADD CONSTRAINT delegate_attendance_delegate_id_fkey FOREIGN KEY (delegate_id) REFERENCES nrtday.association_delegates(delegate_id) ON DELETE CASCADE;


--
-- TOC entry 5496 (class 2606 OID 183128)
-- Name: delegate_communication_preferences delegate_communication_preferences_delegate_id_fkey; Type: FK CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.delegate_communication_preferences
    ADD CONSTRAINT delegate_communication_preferences_delegate_id_fkey FOREIGN KEY (delegate_id) REFERENCES nrtday.association_delegates(delegate_id);


--
-- TOC entry 5497 (class 2606 OID 183133)
-- Name: delegate_documents delegate_documents_delegate_id_fkey; Type: FK CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.delegate_documents
    ADD CONSTRAINT delegate_documents_delegate_id_fkey FOREIGN KEY (delegate_id) REFERENCES nrtday.association_delegates(delegate_id);


--
-- TOC entry 5498 (class 2606 OID 183123)
-- Name: delegate_event_participation delegate_event_participation_delegate_id_fkey; Type: FK CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.delegate_event_participation
    ADD CONSTRAINT delegate_event_participation_delegate_id_fkey FOREIGN KEY (delegate_id) REFERENCES nrtday.association_delegates(delegate_id);


--
-- TOC entry 5499 (class 2606 OID 183138)
-- Name: delegate_passes delegate_passes_delegate_id_fkey; Type: FK CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.delegate_passes
    ADD CONSTRAINT delegate_passes_delegate_id_fkey FOREIGN KEY (delegate_id) REFERENCES nrtday.association_delegates(delegate_id);


--
-- TOC entry 5500 (class 2606 OID 183542)
-- Name: documents documents_participant_id_fkey; Type: FK CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.documents
    ADD CONSTRAINT documents_participant_id_fkey FOREIGN KEY (participant_id) REFERENCES nrtday.participants(participant_id);


--
-- TOC entry 5501 (class 2606 OID 183547)
-- Name: event_participation event_participation_participant_id_fkey; Type: FK CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.event_participation
    ADD CONSTRAINT event_participation_participant_id_fkey FOREIGN KEY (participant_id) REFERENCES nrtday.participants(participant_id);


--
-- TOC entry 5503 (class 2606 OID 183358)
-- Name: hotel_bookings hotel_bookings_hotel_id_fkey; Type: FK CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.hotel_bookings
    ADD CONSTRAINT hotel_bookings_hotel_id_fkey FOREIGN KEY (hotel_id) REFERENCES nrtday.hotels(hotel_id);


--
-- TOC entry 5504 (class 2606 OID 183779)
-- Name: hotel_bookings hotel_bookings_participant_id_fkey; Type: FK CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.hotel_bookings
    ADD CONSTRAINT hotel_bookings_participant_id_fkey FOREIGN KEY (participant_id) REFERENCES nrtday.participants(participant_id);


--
-- TOC entry 5505 (class 2606 OID 183603)
-- Name: hotel_bookings hotel_bookings_room_id_fkey; Type: FK CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.hotel_bookings
    ADD CONSTRAINT hotel_bookings_room_id_fkey FOREIGN KEY (room_id) REFERENCES nrtday.rooms(room_id);


--
-- TOC entry 5506 (class 2606 OID 183710)
-- Name: hotel_bookings hotel_bookings_sub_room_id_fkey; Type: FK CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.hotel_bookings
    ADD CONSTRAINT hotel_bookings_sub_room_id_fkey FOREIGN KEY (sub_room_id) REFERENCES nrtday.sub_rooms(sub_room_id);


--
-- TOC entry 5507 (class 2606 OID 183552)
-- Name: individual_participants individual_participants_participant_id_fkey; Type: FK CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.individual_participants
    ADD CONSTRAINT individual_participants_participant_id_fkey FOREIGN KEY (participant_id) REFERENCES nrtday.participants(participant_id);


--
-- TOC entry 5508 (class 2606 OID 183429)
-- Name: nominee_details nominee_details_nomination_id_fkey; Type: FK CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.nominee_details
    ADD CONSTRAINT nominee_details_nomination_id_fkey FOREIGN KEY (nomination_id) REFERENCES nrtday.nrt_award_nomination(nomination_id);


--
-- TOC entry 5509 (class 2606 OID 183434)
-- Name: nominee_justification nominee_justification_nomination_id_fkey; Type: FK CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.nominee_justification
    ADD CONSTRAINT nominee_justification_nomination_id_fkey FOREIGN KEY (nomination_id) REFERENCES nrtday.nrt_award_nomination(nomination_id);


--
-- TOC entry 5510 (class 2606 OID 183479)
-- Name: nrt_driver_details nrt_driver_details_staff_id_fkey; Type: FK CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.nrt_driver_details
    ADD CONSTRAINT nrt_driver_details_staff_id_fkey FOREIGN KEY (staff_id) REFERENCES nrtday.nrt_staffs(staff_id);


--
-- TOC entry 5511 (class 2606 OID 183753)
-- Name: otps otps_user_id_fkey; Type: FK CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.otps
    ADD CONSTRAINT otps_user_id_fkey FOREIGN KEY (user_id) REFERENCES nrtday.users(id);


--
-- TOC entry 5512 (class 2606 OID 183557)
-- Name: participant_documents participant_documents_participant_id_fkey; Type: FK CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.participant_documents
    ADD CONSTRAINT participant_documents_participant_id_fkey FOREIGN KEY (participant_id) REFERENCES nrtday.participants(participant_id);


--
-- TOC entry 5513 (class 2606 OID 183758)
-- Name: participants participants_user_id_fkey; Type: FK CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.participants
    ADD CONSTRAINT participants_user_id_fkey FOREIGN KEY (user_id) REFERENCES nrtday.users(id);


--
-- TOC entry 5514 (class 2606 OID 183439)
-- Name: previous_awards previous_awards_nomination_id_fkey; Type: FK CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.previous_awards
    ADD CONSTRAINT previous_awards_nomination_id_fkey FOREIGN KEY (nomination_id) REFERENCES nrtday.nrt_award_nomination(nomination_id);


--
-- TOC entry 5515 (class 2606 OID 183209)
-- Name: roommate_preferences roommate_preferences_association_id_fkey; Type: FK CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.roommate_preferences
    ADD CONSTRAINT roommate_preferences_association_id_fkey FOREIGN KEY (association_id) REFERENCES nrtday.association_participants(association_id);


--
-- TOC entry 5516 (class 2606 OID 183769)
-- Name: rooms rooms_hotel_id_fkey; Type: FK CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.rooms
    ADD CONSTRAINT rooms_hotel_id_fkey FOREIGN KEY (hotel_id) REFERENCES nrtday.hotels(hotel_id);


--
-- TOC entry 5502 (class 2606 OID 183774)
-- Name: hotel_availability rooms_hotel_id_fkey; Type: FK CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.hotel_availability
    ADD CONSTRAINT rooms_hotel_id_fkey FOREIGN KEY (hotel_id) REFERENCES nrtday.hotels(hotel_id);


--
-- TOC entry 5517 (class 2606 OID 183658)
-- Name: sponsorship_declarations sponsorship_declarations_sponsorship_id_fkey; Type: FK CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.sponsorship_declarations
    ADD CONSTRAINT sponsorship_declarations_sponsorship_id_fkey FOREIGN KEY (sponsorship_id) REFERENCES nrtday.sponsorships(sponsorship_id);


--
-- TOC entry 5518 (class 2606 OID 183663)
-- Name: sponsorship_payments sponsorship_payments_sponsorship_id_fkey; Type: FK CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.sponsorship_payments
    ADD CONSTRAINT sponsorship_payments_sponsorship_id_fkey FOREIGN KEY (sponsorship_id) REFERENCES nrtday.sponsorships(sponsorship_id);


--
-- TOC entry 5521 (class 2606 OID 183834)
-- Name: states states_country_id_fkey; Type: FK CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.states
    ADD CONSTRAINT states_country_id_fkey FOREIGN KEY (country_id) REFERENCES nrtday.countries(id);


--
-- TOC entry 5519 (class 2606 OID 183608)
-- Name: sub_rooms sub_rooms_room_id_fkey; Type: FK CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.sub_rooms
    ADD CONSTRAINT sub_rooms_room_id_fkey FOREIGN KEY (room_id) REFERENCES nrtday.rooms(room_id);


--
-- TOC entry 5520 (class 2606 OID 183073)
-- Name: subregions subregions_region_id_fkey; Type: FK CONSTRAINT; Schema: nrtday; Owner: postgres
--

ALTER TABLE ONLY nrtday.subregions
    ADD CONSTRAINT subregions_region_id_fkey FOREIGN KEY (region_id) REFERENCES nrtday.regions(id);


-- Completed on 2025-10-29 10:11:04

--
-- PostgreSQL database dump complete
--

