--
--


SET transaction_timeout = 0;

--
-- Name: public; Type: SCHEMA; Schema: -; Owner: postgres
--

-- *not* creating schema, since initdb creates it


ALTER SCHEMA public OWNER TO postgres;

--
-- Name: topology; Type: SCHEMA; Schema: -; Owner: postgres
--

CREATE SCHEMA topology;


ALTER SCHEMA topology OWNER TO postgres;

--
-- Name: SCHEMA topology; Type: COMMENT; Schema: -; Owner: postgres
--

COMMENT ON SCHEMA topology IS 'PostGIS Topology schema';


--
-- Name: postgis; Type: EXTENSION; Schema: -; Owner: -
--

CREATE EXTENSION IF NOT EXISTS postgis WITH SCHEMA public;


--
-- Name: EXTENSION postgis; Type: COMMENT; Schema: -; Owner: 
--

COMMENT ON EXTENSION postgis IS 'PostGIS geometry and geography spatial types and functions';


--
-- Name: postgis_topology; Type: EXTENSION; Schema: -; Owner: -
--

CREATE EXTENSION IF NOT EXISTS postgis_topology WITH SCHEMA topology;


--
-- Name: EXTENSION postgis_topology; Type: COMMENT; Schema: -; Owner: 
--

COMMENT ON EXTENSION postgis_topology IS 'PostGIS topology spatial types and functions';


--
-- Name: enum_dashboard_visibility_card_type; Type: TYPE; Schema: public; Owner: postgres
--

CREATE TYPE public.enum_dashboard_visibility_card_type AS ENUM (
    'card',
    'chart'
);


ALTER TYPE public.enum_dashboard_visibility_card_type OWNER TO postgres;



--
-- Name: active_user; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.active_user (
    id bigint NOT NULL,
    user_id integer,
    date date,
    "time" time without time zone,
    latitude character varying(20),
    longitude character varying(20)
);


ALTER TABLE public.active_user OWNER TO postgres;

--
-- Name: active_user_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.active_user_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.active_user_id_seq OWNER TO postgres;

--
-- Name: active_user_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.active_user_id_seq OWNED BY public.active_user.id;


--
-- Name: amc_ward_boundry; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.amc_ward_boundry (
    gid integer NOT NULL,
    ward_name character varying(100),
    zone_name character varying(100),
    ward_no integer,
    zone_no integer,
    area_sq_km numeric,
    area_ha numeric,
    ward character varying(100),
    shape_leng numeric,
    shape_area numeric,
    geom public.geometry(MultiPolygon,32643)
);


ALTER TABLE public.amc_ward_boundry OWNER TO postgres;

--
-- Name: amc_ward_boundry_gid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.amc_ward_boundry_gid_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.amc_ward_boundry_gid_seq OWNER TO postgres;

--
-- Name: amc_ward_boundry_gid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.amc_ward_boundry_gid_seq OWNED BY public.amc_ward_boundry.gid;


--
-- Name: bird_nest; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.bird_nest (
    bird_nest_id integer NOT NULL,
    nest_value character varying(100)
);


ALTER TABLE public.bird_nest OWNER TO postgres;

--
-- Name: buildings; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.buildings (
    gid integer NOT NULL,
    objectid integer,
    unique_id character varying(254),
    locality1 character varying(254),
    name1 character varying(254),
    remarks1 character varying(254),
    name9 character varying(254),
    name10 character varying(254),
    shape_leng numeric,
    shape_area numeric,
    geom public.geometry(MultiPolygonZM,32643),
    ward_name text,
    ward_id integer
);


ALTER TABLE public.buildings OWNER TO postgres;

--
-- Name: buildings_gid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.buildings_gid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.buildings_gid_seq OWNER TO postgres;

--
-- Name: buildings_gid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.buildings_gid_seq OWNED BY public.buildings.gid;


--
-- Name: client; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.client (
    id integer NOT NULL,
    client_name character varying(100) NOT NULL,
    mobile character varying(15) NOT NULL,
    landline character varying(15) NOT NULL,
    email character varying(100) DEFAULT ''::character varying NOT NULL,
    address character varying(250) NOT NULL,
    details character varying(500) NOT NULL,
    created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
    status smallint DEFAULT 1 NOT NULL
);


ALTER TABLE public.client OWNER TO postgres;

--
-- Name: client_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.client_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.client_id_seq OWNER TO postgres;

--
-- Name: client_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.client_id_seq OWNED BY public.client.id;


--
-- Name: clientwise_features; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.clientwise_features (
    id integer NOT NULL,
    client_id integer NOT NULL,
    feature_export_module boolean DEFAULT false NOT NULL,
    feature_sms_module boolean DEFAULT false NOT NULL
);


ALTER TABLE public.clientwise_features OWNER TO postgres;

--
-- Name: clientwise_features_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.clientwise_features_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.clientwise_features_id_seq OWNER TO postgres;

--
-- Name: clientwise_features_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.clientwise_features_id_seq OWNED BY public.clientwise_features.id;


--
-- Name: condition; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.condition (
    id integer NOT NULL,
    condition_name character varying(200)
);


ALTER TABLE public.condition OWNER TO postgres;

--
-- Name: dashboard_visibility; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.dashboard_visibility (
    id integer NOT NULL,
    treelogy_id integer NOT NULL,
    card_id character varying(100) NOT NULL,
    card_name character varying(200) NOT NULL,
    card_type public.enum_dashboard_visibility_card_type DEFAULT 'card'::public.enum_dashboard_visibility_card_type NOT NULL,
    is_visible boolean DEFAULT true NOT NULL,
    display_order integer DEFAULT 0 NOT NULL,
    created_at timestamp with time zone NOT NULL,
    updated_at timestamp with time zone NOT NULL
);


ALTER TABLE public.dashboard_visibility OWNER TO postgres;

--
-- Name: COLUMN dashboard_visibility.card_id; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.dashboard_visibility.card_id IS 'Unique identifier for dashboard card/chart (e.g., total_trees, species_count)';


--
-- Name: COLUMN dashboard_visibility.card_name; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.dashboard_visibility.card_name IS 'Display name for the card/chart';


--
-- Name: COLUMN dashboard_visibility.is_visible; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.dashboard_visibility.is_visible IS 'Whether this card/chart is visible to the client';


--
-- Name: COLUMN dashboard_visibility.display_order; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.dashboard_visibility.display_order IS 'Order in which cards/charts appear on dashboard';


--
-- Name: dashboard_visibility_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.dashboard_visibility_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.dashboard_visibility_id_seq OWNER TO postgres;

--
-- Name: dashboard_visibility_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.dashboard_visibility_id_seq OWNED BY public.dashboard_visibility.id;


--
-- Name: dbname; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.dbname (
    id integer NOT NULL,
    treelogy_id integer NOT NULL,
    dbname character varying(100) NOT NULL,
    locked character varying(50) NOT NULL,
    status smallint DEFAULT 0 NOT NULL
);


ALTER TABLE public.dbname OWNER TO postgres;

--
-- Name: dbname_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.dbname_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.dbname_id_seq OWNER TO postgres;

--
-- Name: dbname_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.dbname_id_seq OWNED BY public.dbname.id;


--
-- Name: forms; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.forms (
    form_id integer NOT NULL,
    form_data jsonb NOT NULL,
    created_by integer NOT NULL,
    created_date timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
    updated_date timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
    treelogy_id integer
);


ALTER TABLE public.forms OWNER TO postgres;

--
-- Name: COLUMN forms.form_id; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.forms.form_id IS 'Primary key for form table';


--
-- Name: COLUMN forms.form_data; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.forms.form_data IS 'JSON object containing form definition and structure';


--
-- Name: COLUMN forms.created_by; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.forms.created_by IS 'Foreign key reference to Client table';


--
-- Name: COLUMN forms.created_date; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.forms.created_date IS 'Timestamp when form was created';


--
-- Name: COLUMN forms.updated_date; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.forms.updated_date IS 'Timestamp when form was last updated';


--
-- Name: COLUMN forms.treelogy_id; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.forms.treelogy_id IS 'Project/Treelogy ID this form belongs to';


--
-- Name: forms_form_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.forms_form_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.forms_form_id_seq OWNER TO postgres;

--
-- Name: forms_form_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.forms_form_id_seq OWNED BY public.forms.form_id;

--
-- Name: login_login_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.login_login_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.login_login_id_seq OWNER TO postgres;

--
-- Name: login_login_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.login_login_id_seq OWNED BY public.login.login_id;


--
-- Name: mapping; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.mapping (
    id integer NOT NULL,
    login_id integer NOT NULL,
    treelogy_id integer NOT NULL,
    description character varying(50) NOT NULL,
    code character varying(50) NOT NULL,
    role character varying(50) NOT NULL,
    view_permission character varying(50) NOT NULL,
    profile integer DEFAULT 0,
    status smallint DEFAULT 1 NOT NULL,
    created_by integer DEFAULT 0 NOT NULL,
    created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
    sort_order integer DEFAULT 0 NOT NULL,
    current_map_year integer DEFAULT 0 NOT NULL
);


ALTER TABLE public.mapping OWNER TO postgres;

--
-- Name: mapping_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.mapping_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.mapping_id_seq OWNER TO postgres;

--
-- Name: mapping_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.mapping_id_seq OWNED BY public.mapping.id;


--
-- Name: no_permission; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.no_permission (
    id bigint NOT NULL,
    uid character varying(50),
    entered_date date,
    entered_time time without time zone,
    lat1 character varying(100),
    lon1 character varying(100),
    lat2 character varying(100),
    lon2 character varying(100),
    lat3 character varying(100),
    lon3 character varying(100),
    lat4 character varying(100),
    lon4 character varying(100),
    lat5 character varying(100),
    lon5 character varying(100),
    name character varying(100),
    reason character varying(200),
    email character varying(100),
    geom public.geometry(Polygon,4326),
    approxnooftreesinpremise character varying(100)
);


ALTER TABLE public.no_permission OWNER TO postgres;

--
-- Name: no_permission_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.no_permission_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.no_permission_id_seq OWNER TO postgres;

--
-- Name: no_permission_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.no_permission_id_seq OWNED BY public.no_permission.id;


--
-- Name: ownership; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.ownership (
    id integer NOT NULL,
    ownership_name character varying(200)
);


ALTER TABLE public.ownership OWNER TO postgres;

--
-- Name: path_details; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.path_details (
    id bigint NOT NULL,
    user_id integer,
    latitude character varying(20),
    longitude character varying(20),
    date date,
    "time" time without time zone
);


ALTER TABLE public.path_details OWNER TO postgres;

--
-- Name: path_details_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.path_details_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.path_details_id_seq OWNER TO postgres;

--
-- Name: path_details_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.path_details_id_seq OWNED BY public.path_details.id;


--
-- Name: random_count; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.random_count (
    id bigint NOT NULL,
    dates date,
    random_count integer
);


ALTER TABLE public.random_count OWNER TO postgres;

--
-- Name: random_count_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.random_count_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.random_count_id_seq OWNER TO postgres;

--
-- Name: random_count_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.random_count_id_seq OWNED BY public.random_count.id;


--
-- Name: remarks; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.remarks (
    id integer NOT NULL,
    remark_name character varying(200)
);


ALTER TABLE public.remarks OWNER TO postgres;

--
-- Name: remarks_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.remarks_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.remarks_id_seq OWNER TO postgres;

--
-- Name: remarks_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.remarks_id_seq OWNED BY public.remarks.id;


--
-- Name: scope_of_plantation; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.scope_of_plantation (
    id bigint NOT NULL,
    latitude double precision,
    longitude double precision,
    entered_date date,
    entered_time time without time zone,
    google_address text,
    user_id integer
);


ALTER TABLE public.scope_of_plantation OWNER TO postgres;

--
-- Name: scope_of_plantation_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.scope_of_plantation_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.scope_of_plantation_id_seq OWNER TO postgres;

--
-- Name: scope_of_plantation_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.scope_of_plantation_id_seq OWNED BY public.scope_of_plantation.id;


--
-- Name: spacial_comment; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.spacial_comment (
    special_comment_id integer NOT NULL,
    special_comment character varying(100)
);


ALTER TABLE public.spacial_comment OWNER TO postgres;

--
-- Name: treedetailsentered; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.treedetailsentered (
    user_id integer NOT NULL,
    tree_id integer NOT NULL,
    latitude double precision,
    longitude double precision,
    grith_cm double precision NOT NULL,
    height_mtr integer NOT NULL,
    condition_id integer DEFAULT 5 NOT NULL,
    ownership_id integer NOT NULL,
    societyname character varying(200) NOT NULL,
    roadname character varying(200) NOT NULL,
    entered_date date,
    entered_time time without time zone,
    tree_details_id bigint NOT NULL,
    googleaddress character varying(400) NOT NULL,
    updated_date date,
    qc_updated_time time without time zone,
    updated_by integer,
    qc_done integer DEFAULT 0,
    qc_status character(3),
    qc_final_submitted integer DEFAULT 0,
    qc_updated_date date,
    geom public.geometry(Point,4326),
    version2 character varying(20),
    user_seq_id character varying(20),
    old_latitude double precision,
    old_longitude double precision,
    drag_distance character varying(50),
    qc_old_latitude double precision,
    qc_old_longitude double precision,
    qc_drag_distance character varying(50) DEFAULT '0'::character varying,
    allocated_ward character varying(10) DEFAULT '0'::character varying,
    within_boundary character varying(10) DEFAULT '0'::character varying,
    new_or_old character varying(20) DEFAULT 'old'::character varying,
    grid character varying(50) DEFAULT 'na'::character varying,
    lat2 double precision,
    lon2 double precision,
    geom_line public.geometry(LineString,4326),
    geom2 public.geometry(Point,4326),
    dist double precision,
    other_name character varying(200),
    bla_imbal_id integer,
    canopy_diameter double precision,
    other_remarks character varying(200),
    remarks_id integer,
    dist_from_prev_tree integer,
    special_comment_id integer,
    bird_nest integer,
    resurvey_done integer DEFAULT 0,
    un_submit_date date,
    un_submit_time time without time zone,
    un_updated_by bigint,
    comment_un text,
    bo_qc_submit_date date,
    bo_qc_submit_time time without time zone,
    bo_qc_done_by integer,
    comment_bo_qc text,
    bo_rare_qc_date date,
    bo_rare_qc_time time without time zone,
    bo_rare_qc_doneby integer,
    bo_rare_qc_comment text,
    age double precision,
    date_of_plantation character varying(10),
    client_name text,
    contractor_name text,
    treename character varying(100),
    ownership_name character varying,
    ownership_contact_no character varying,
    manual_tree_details_id bigint DEFAULT 0,
    is_verified integer DEFAULT 0
);


ALTER TABLE public.treedetailsentered OWNER TO postgres;

--
-- Name: trees; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.trees (
    id integer NOT NULL,
    geom public.geometry(Point,32643),
    oid integer,
    sr_no text,
    gps_no text,
    user_name text,
    local_name text,
    other_name text,
    girth_cm numeric(15,5),
    height_m numeric(15,5),
    canopy_dia_m numeric(15,5),
    condition text,
    other_remarks text,
    dist_frm_p numeric(15,5),
    ownership text,
    society_name text,
    road_name text,
    existing_t text,
    bird_nest boolean,
    date_time timestamp without time zone,
    feat_name text,
    datafile text,
    data_dictionary text,
    gnss_height double precision,
    northing double precision,
    easting double precision,
    point_id integer,
    balanced boolean,
    remarks text,
    special_collar text,
    ward_name text,
    ward_id integer,
    qc_comment text,
    client_comment text,
    qc_2 text,
    botanical_name text,
    common_name text,
    saar_uid text,
    phenology text,
    economic_i text,
    family_g text,
    colour_of text,
    flowering text,
    canopy_typ text,
    carbon_seq text,
    is_rare boolean DEFAULT false,
    age double precision,
    is_heritage integer DEFAULT 0,
    entered_date text,
    entered_time text,
    origin text,
    host_plant text
);


ALTER TABLE public.trees OWNER TO postgres;

--
-- Name: wards; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.wards (
    id bigint NOT NULL,
    geom public.geometry(MultiPolygon,32643),
    objectid integer DEFAULT 0,
    name text,
    name_mr text,
    remarks text,
    zones integer DEFAULT 0,
    status character varying(50)
);


ALTER TABLE public.wards OWNER TO postgres;


ALTER VIEW public.total_trees OWNER TO postgres;

--
-- Name: treebal_imbalance; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.treebal_imbalance (
    balance_id integer NOT NULL,
    isbalance character varying(50) NOT NULL
);


ALTER TABLE public.treebal_imbalance OWNER TO postgres;

--
-- Name: treedetailsentered_bkp_26102025; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.treedetailsentered_bkp_26102025 (
    user_id integer,
    tree_id integer,
    latitude double precision,
    longitude double precision,
    grith_cm double precision,
    height_mtr integer,
    condition_id integer,
    ownership_id integer,
    societyname character varying(200),
    roadname character varying(200),
    entered_date date,
    entered_time time without time zone,
    tree_details_id bigint,
    googleaddress character varying(400),
    updated_date date,
    qc_updated_time time without time zone,
    updated_by integer,
    qc_done integer,
    qc_status character(3),
    qc_final_submitted integer,
    qc_updated_date date,
    geom public.geometry(Point,4326),
    version2 character varying(20),
    user_seq_id character varying(20),
    old_latitude double precision,
    old_longitude double precision,
    drag_distance character varying(50),
    qc_old_latitude double precision,
    qc_old_longitude double precision,
    qc_drag_distance character varying(50),
    allocated_ward character varying(10),
    within_boundary character varying(10),
    new_or_old character varying(20),
    grid character varying(50),
    lat2 double precision,
    lon2 double precision,
    geom_line public.geometry(LineString,4326),
    geom2 public.geometry(Point,4326),
    dist double precision,
    other_name character varying(200),
    bla_imbal_id integer,
    canopy_diameter double precision,
    other_remarks character varying(200),
    remarks_id integer,
    dist_from_prev_tree integer,
    special_comment_id integer,
    bird_nest integer,
    resurvey_done integer,
    un_submit_date date,
    un_submit_time time without time zone,
    un_updated_by bigint,
    comment_un text,
    bo_qc_submit_date date,
    bo_qc_submit_time time without time zone,
    bo_qc_done_by integer,
    comment_bo_qc text,
    bo_rare_qc_date date,
    bo_rare_qc_time time without time zone,
    bo_rare_qc_doneby integer,
    bo_rare_qc_comment text,
    age double precision,
    date_of_plantation character varying(10),
    client_name text,
    contractor_name text,
    treename character varying(100),
    ownership_name character varying,
    ownership_contact_no character varying,
    manual_tree_details_id bigint,
    is_verified integer
);


ALTER TABLE public.treedetailsentered_bkp_26102025 OWNER TO postgres;

--
-- Name: treedetailsentered_tree_details_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.treedetailsentered_tree_details_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.treedetailsentered_tree_details_id_seq OWNER TO postgres;

--
-- Name: treedetailsentered_tree_details_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.treedetailsentered_tree_details_id_seq OWNED BY public.treedetailsentered.tree_details_id;


--
-- Name: treelist; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.treelist (
    tree_name character varying(30),
    comman_name character varying(50),
    family character varying(30),
    phenology character varying(100),
    economic character varying(20),
    flowering character varying(20),
    color character varying(20),
    botanical character varying(200),
    tree_id integer NOT NULL,
    is_rare integer DEFAULT 0,
    priority integer,
    wood_density character varying(200),
    growth_factor double precision,
    gujarati_name character varying(200)
);


ALTER TABLE public.treelist OWNER TO postgres;

--
-- Name: treelist_tree_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.treelist_tree_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.treelist_tree_id_seq OWNER TO postgres;

--
-- Name: treelist_tree_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.treelist_tree_id_seq OWNED BY public.treelist.tree_id;


--
-- Name: treelogy; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.treelogy (
    treelogy_id integer NOT NULL,
    treelogy_code character varying(100) NOT NULL,
    treelogy_name character varying(100) NOT NULL,
    landmark character varying(100) NOT NULL,
    dbname character varying(100) NOT NULL,
    client_id integer NOT NULL,
    updated_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
    status character varying(100) DEFAULT 'Y'::character varying NOT NULL
);


ALTER TABLE public.treelogy OWNER TO postgres;

--
-- Name: treelogy_treelogy_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.treelogy_treelogy_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.treelogy_treelogy_id_seq OWNER TO postgres;

--
-- Name: treelogy_treelogy_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.treelogy_treelogy_id_seq OWNED BY public.treelogy.treelogy_id;


--
-- Name: trees_history; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.trees_history (
    id bigint NOT NULL,
    geom public.geometry(Point,32643),
    oid integer,
    sr_no text,
    gps_no text,
    user_name text,
    local_name text,
    other_name text,
    girth_cm numeric(15,5),
    height_m numeric(15,5),
    canopy_dia_m numeric(15,5),
    condition text,
    other_remarks text,
    dist_frm_p numeric(15,5),
    ownership text,
    society_name text,
    road_name text,
    existing_t text,
    bird_nest boolean,
    date_time timestamp without time zone,
    feat_name text,
    datafile text,
    data_dictionary text,
    gnss_height double precision,
    northing double precision,
    easting double precision,
    point_id integer,
    balanced boolean,
    remarks text,
    special_collar text,
    ward_name text,
    ward_id integer,
    qc_comment text,
    client_comment text,
    qc_2 text,
    botanical_name text,
    common_name text,
    saar_uid text,
    phenology text,
    economic_i text,
    family_g text,
    colour_of text,
    flowering text,
    canopy_typ text,
    carbon_seq text,
    is_rare boolean DEFAULT false,
    age double precision,
    is_heritage integer DEFAULT 0,
    entered_date text,
    entered_time text,
    origin text,
    host_plant text,
    del_stamp text,
    deleted_by text,
    delete_remarks text
);


ALTER TABLE public.trees_history OWNER TO postgres;

--
-- Name: trees_history_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.trees_history_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.trees_history_id_seq OWNER TO postgres;

--
-- Name: trees_history_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.trees_history_id_seq OWNED BY public.trees_history.id;


--
-- Name: trees_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.trees_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.trees_id_seq OWNER TO postgres;

--
-- Name: trees_id_seq1; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.trees_id_seq1
    START WITH 1
    INCREMENT BY 1
    MINVALUE 0
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.trees_id_seq1 OWNER TO postgres;

--
-- Name: trees_id_seq1; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.trees_id_seq1 OWNED BY public.trees.id;


--
-- Name: treeusers_uid_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.treeusers_uid_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.treeusers_uid_seq OWNER TO postgres;

--
-- Name: treeusers_uid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.treeusers_uid_seq OWNED BY public.treeusers.uid;


--
-- Name: user_feedback; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.user_feedback (
    uf_id integer NOT NULL,
    uf_name text,
    uf_email text,
    uf_mobile text,
    uf_comment text,
    uf_mail_sent boolean DEFAULT false,
    uf_feedback_date timestamp without time zone,
    uf_mailsent_userid integer,
    uf_mailsent_comment text,
    uf_mailsent_date timestamp without time zone,
    uf_feedback_delete boolean DEFAULT false,
    uf_tree_id integer,
    uf_saar_uid text,
    uf_comment_common_name text,
    uf_comment_girth text,
    uf_comment_canopy text,
    uf_comment_location text,
    uf_comment_splcomment text,
    uf_comment_height text,
    uf_comment_treecondition text,
    uf_comment_balanced text,
    uf_comment_botname text,
    uf_comment_localname text
);


ALTER TABLE public.user_feedback OWNER TO postgres;

--
-- Name: user_feedback_uf_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.user_feedback_uf_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.user_feedback_uf_id_seq OWNER TO postgres;

--
-- Name: user_feedback_uf_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.user_feedback_uf_id_seq OWNED BY public.user_feedback.uf_id;


--
-- Name: user_master; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.user_master (
    id integer NOT NULL,
    role_name character varying(50) NOT NULL,
    role_display_name character varying(100) NOT NULL,
    description text,
    permissions json,
    is_active boolean DEFAULT true NOT NULL,
    created_by integer,
    sort_order integer DEFAULT 0 NOT NULL,
    "createdAt" timestamp with time zone NOT NULL,
    "updatedAt" timestamp with time zone NOT NULL
);


ALTER TABLE public.user_master OWNER TO postgres;

--
-- Name: COLUMN user_master.role_name; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.user_master.role_name IS 'Role name like SUPER_ADMIN, CLIENT_ADMIN, etc.';


--
-- Name: COLUMN user_master.role_display_name; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.user_master.role_display_name IS 'Display name for the role like "Super Administrator"';


--
-- Name: COLUMN user_master.description; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.user_master.description IS 'Description of what this role can do';


--
-- Name: COLUMN user_master.permissions; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.user_master.permissions IS 'JSON object containing permissions for this role';


--
-- Name: COLUMN user_master.is_active; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.user_master.is_active IS 'Whether this role is active';


--
-- Name: COLUMN user_master.created_by; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.user_master.created_by IS 'User ID who created this role';


--
-- Name: COLUMN user_master.sort_order; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN public.user_master.sort_order IS 'Order in which roles appear in UI';


--
-- Name: user_master_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.user_master_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.user_master_id_seq OWNER TO postgres;

--
-- Name: user_master_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.user_master_id_seq OWNED BY public.user_master.id;


--
-- Name: user_roles; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.user_roles (
    role_type character varying(20) NOT NULL,
    user_role character varying(50)
);


ALTER TABLE public.user_roles OWNER TO postgres;

--
-- Name: wards_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.wards_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.wards_id_seq OWNER TO postgres;

--
-- Name: wards_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.wards_id_seq OWNED BY public.wards.id;


--
-- Name: zones; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE public.zones (
    id bigint NOT NULL,
    name character varying,
    name_mr character varying
);


ALTER TABLE public.zones OWNER TO postgres;

--
-- Name: zones_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE public.zones_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.zones_id_seq OWNER TO postgres;

--
-- Name: zones_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE public.zones_id_seq OWNED BY public.zones.id;


--
-- Name: active_user id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.active_user ALTER COLUMN id SET DEFAULT nextval('public.active_user_id_seq'::regclass);


--
-- Name: amc_ward_boundry gid; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.amc_ward_boundry ALTER COLUMN gid SET DEFAULT nextval('public.amc_ward_boundry_gid_seq'::regclass);


--
-- Name: buildings gid; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.buildings ALTER COLUMN gid SET DEFAULT nextval('public.buildings_gid_seq'::regclass);


--
-- Name: client id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.client ALTER COLUMN id SET DEFAULT nextval('public.client_id_seq'::regclass);


--
-- Name: clientwise_features id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.clientwise_features ALTER COLUMN id SET DEFAULT nextval('public.clientwise_features_id_seq'::regclass);


--
-- Name: dashboard_visibility id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.dashboard_visibility ALTER COLUMN id SET DEFAULT nextval('public.dashboard_visibility_id_seq'::regclass);


--
-- Name: dbname id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.dbname ALTER COLUMN id SET DEFAULT nextval('public.dbname_id_seq'::regclass);


--
-- Name: forms form_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.forms ALTER COLUMN form_id SET DEFAULT nextval('public.forms_form_id_seq'::regclass);


--
-- Name: mapping id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.mapping ALTER COLUMN id SET DEFAULT nextval('public.mapping_id_seq'::regclass);


--
-- Name: no_permission id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.no_permission ALTER COLUMN id SET DEFAULT nextval('public.no_permission_id_seq'::regclass);


--
-- Name: path_details id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.path_details ALTER COLUMN id SET DEFAULT nextval('public.path_details_id_seq'::regclass);


--
-- Name: random_count id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.random_count ALTER COLUMN id SET DEFAULT nextval('public.random_count_id_seq'::regclass);


--
-- Name: remarks id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.remarks ALTER COLUMN id SET DEFAULT nextval('public.remarks_id_seq'::regclass);


--
-- Name: scope_of_plantation id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.scope_of_plantation ALTER COLUMN id SET DEFAULT nextval('public.scope_of_plantation_id_seq'::regclass);


--
-- Name: treedetailsentered tree_details_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.treedetailsentered ALTER COLUMN tree_details_id SET DEFAULT nextval('public.treedetailsentered_tree_details_id_seq'::regclass);


--
-- Name: treelist tree_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.treelist ALTER COLUMN tree_id SET DEFAULT nextval('public.treelist_tree_id_seq'::regclass);


--
-- Name: treelogy treelogy_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.treelogy ALTER COLUMN treelogy_id SET DEFAULT nextval('public.treelogy_treelogy_id_seq'::regclass);


--
-- Name: trees id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.trees ALTER COLUMN id SET DEFAULT nextval('public.trees_id_seq1'::regclass);


--
-- Name: trees_history id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.trees_history ALTER COLUMN id SET DEFAULT nextval('public.trees_history_id_seq'::regclass);


--
-- Name: user_feedback uf_id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.user_feedback ALTER COLUMN uf_id SET DEFAULT nextval('public.user_feedback_uf_id_seq'::regclass);


--
-- Name: user_master id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.user_master ALTER COLUMN id SET DEFAULT nextval('public.user_master_id_seq'::regclass);


--
-- Name: wards id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.wards ALTER COLUMN id SET DEFAULT nextval('public.wards_id_seq'::regclass);


--
-- Name: zones id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.zones ALTER COLUMN id SET DEFAULT nextval('public.zones_id_seq'::regclass);


--
-- Data for Name: active_user; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.active_user (id, user_id, date, "time", latitude, longitude) FROM stdin;
\.


--
-- Data for Name: amc_ward_boundry; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.amc_ward_boundry (gid, ward_name, zone_name, ward_no, zone_no, area_sq_km, area_ha, ward, shape_leng, shape_area, geom) FROM stdin;
\.


--
-- Data for Name: bird_nest; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.bird_nest (bird_nest_id, nest_value) FROM stdin;
\.


--
-- Data for Name: buildings; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.buildings (gid, objectid, unique_id, locality1, name1, remarks1, name9, name10, shape_leng, shape_area, geom, ward_name, ward_id) FROM stdin;
\.


--
-- Data for Name: client; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.client (id, client_name, mobile, landline, email, address, details, created_at, status) FROM stdin;
1	Acme	99999	022-11111		Mumbai	VIP	2025-09-22 11:36:40.163+05:30	1
2	abhi	6268644194	445524	developerabhi17@gmail.com	F-12, Safalya extension	fgd	2025-09-23 16:20:21.373+05:30	1
3	GreenHeights	9876543210	022-12345678	info@greenheights.com	123 Business Park, Mumbai	Real estate development company	2025-09-29 17:52:57.718+05:30	1
4	TechCorp Solutions	9876543211	022-12345679	contact@techcorp.com	456 Tech Hub, Bangalore	Technology consulting firm	2025-09-29 17:52:57.718+05:30	1
5	Urban Builders	9876543212	022-12345680	hello@urbanbuilders.com	789 Construction Zone, Delhi	Construction and infrastructure company	2025-09-29 17:52:57.719+05:30	1
27	test client	1111111111	111111111	test@gmail.com	sdfsdf	sdfsadfsdf	2025-10-26 16:39:06.531+05:30	1
28	Test Client	9876543210	9876543210	test@client.com	Test Address	Test Details	2025-10-26 16:51:44.958+05:30	1
29	test2	1111111111	1111111111	test@gmail.com	dslfkjsdfjl	jlsdjflsjkl	2025-10-26 16:52:13.507+05:30	0
30	Test Client 2	9999999999	9999999999	test2@client.com	Test Address 2	Test Details 2	2025-10-26 16:56:19.313+05:30	1
31	test3	1111111111	1111111111	test3@gmail.com	sdfsd	sdfsdf	2025-10-26 17:01:11.394+05:30	1
32	test4	2222222222	2222222222	test4@gmail.com	test address	test details	2025-10-26 17:05:29.291+05:30	1
33	test4	111111111	1111111111	test@gmail.com	sdfsdfj	djflsjdflj	2025-10-26 17:21:59.67+05:30	1
34	test5	3333333333	3333333333	test5@gmail.com	test address 5	test details 5	2025-10-26 17:26:20.513+05:30	1
35	test10	111111111	111111111	test10@gmail.com	sdflsdjf	sdlkfjlskdj	2025-10-26 17:58:47.872+05:30	1
\.


--
-- Data for Name: clientwise_features; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.clientwise_features (id, client_id, feature_export_module, feature_sms_module) FROM stdin;
1	1	t	f
\.


--
-- Data for Name: condition; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.condition (id, condition_name) FROM stdin;
\.


--
-- Data for Name: dashboard_visibility; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.dashboard_visibility (id, treelogy_id, card_id, card_name, card_type, is_visible, display_order, created_at, updated_at) FROM stdin;
85	1	total_trees	Total Trees Surveyed	card	t	1	2025-10-04 12:53:14.645+05:30	2025-10-04 12:53:14.645+05:30
86	1	total_verified	Total Verified Trees	card	t	2	2025-10-04 12:53:14.646+05:30	2025-10-04 12:53:14.646+05:30
87	1	total_species	Total Species Count	card	t	3	2025-10-04 12:53:14.646+05:30	2025-10-04 12:53:14.646+05:30
88	1	condition_chart	Tree Condition Distribution	chart	t	4	2025-10-04 12:53:14.646+05:30	2025-10-04 12:53:14.646+05:30
89	1	species_chart	Top Species Distribution	chart	t	5	2025-10-04 12:53:14.646+05:30	2025-10-04 12:53:14.646+05:30
230	5	total_trees	Total Trees Surveyed	card	t	1	2025-10-10 18:53:04.305+05:30	2025-10-10 18:53:04.305+05:30
231	5	total_verified	Total Verified Trees	card	t	2	2025-10-10 18:53:04.306+05:30	2025-10-10 18:53:04.306+05:30
232	5	total_species	Total Species Count	card	t	3	2025-10-10 18:53:04.306+05:30	2025-10-10 18:53:04.306+05:30
233	5	condition_chart	Tree Condition Distribution	chart	t	4	2025-10-10 18:53:04.306+05:30	2025-10-10 18:53:04.306+05:30
234	5	species_chart	Top Species Distribution	chart	t	5	2025-10-10 18:53:04.306+05:30	2025-10-10 18:53:04.306+05:30
235	2	total_trees	Total Trees Surveyed	card	t	1	2025-10-10 18:53:11.767+05:30	2025-10-10 18:53:11.767+05:30
236	2	total_verified	Total Verified Trees	card	t	2	2025-10-10 18:53:11.767+05:30	2025-10-10 18:53:11.767+05:30
237	2	total_species	Total Species Count	card	t	3	2025-10-10 18:53:11.767+05:30	2025-10-10 18:53:11.767+05:30
238	2	condition_chart	Tree Condition Distribution	chart	t	4	2025-10-10 18:53:11.767+05:30	2025-10-10 18:53:11.767+05:30
239	2	species_chart	Top Species Distribution	chart	t	5	2025-10-10 18:53:11.767+05:30	2025-10-10 18:53:11.767+05:30
182	3	avg_girth	Average Girth	card	t	12	2025-10-06 15:12:49.51+05:30	2025-10-06 15:12:49.51+05:30
197	3	avg_tree_age	Average Tree Age	card	t	10	2025-10-06 15:12:51.889+05:30	2025-10-06 15:12:51.889+05:30
189	3	avg_tree_height	Average Tree Height	card	t	11	2025-10-06 15:12:50.036+05:30	2025-10-06 15:12:50.036+05:30
163	3	total_exotic	Exotic Trees	card	t	7	2025-10-04 15:37:45.759+05:30	2025-10-04 15:37:45.759+05:30
168	3	most_dominant	Most Dominant Species	card	t	8	2025-10-04 15:37:47.485+05:30	2025-10-04 15:37:47.485+05:30
156	3	total_rare	Rare Species	card	t	5	2025-10-04 14:58:28.452+05:30	2025-10-04 14:58:28.452+05:30
95	3	total_trees	Total Trees Surveyed	card	t	4	2025-10-04 14:32:12.109+05:30	2025-10-04 14:32:12.109+05:30
93	3	total_verified	Total Verified Trees	card	t	6	2025-10-04 14:32:11.221+05:30	2025-10-04 14:32:11.221+05:30
328	3	condition_chart	Tree Condition Distribution	chart	t	0	2025-10-11 11:57:45.658+05:30	2025-10-11 11:57:45.658+05:30
142	4	total_heritage	Heritage Trees	card	t	4	2025-10-04 14:38:22.859+05:30	2025-10-04 14:38:22.859+05:30
105	4	most_dominant	Most Dominant Species	card	t	8	2025-10-04 14:36:20.237+05:30	2025-10-04 14:36:20.237+05:30
101	4	total_species	Total Species Count	card	t	3	2025-10-04 14:36:03.195+05:30	2025-10-04 14:36:03.195+05:30
96	4	total_trees	Total Trees Surveyed	card	t	1	2025-10-04 14:32:18.074+05:30	2025-10-04 14:32:18.074+05:30
98	4	total_verified	Total Verified Trees	card	t	2	2025-10-04 14:36:02.556+05:30	2025-10-04 14:36:02.556+05:30
376	6	total_trees	Total Trees Surveyed	card	t	0	2025-10-25 12:09:10.012+05:30	2025-10-25 12:09:10.012+05:30
377	6	total_verified	Total Verified	card	t	0	2025-10-25 12:09:10.014+05:30	2025-10-25 12:09:10.014+05:30
378	6	total_species	No. of Species	card	t	0	2025-10-25 12:09:10.014+05:30	2025-10-25 12:09:10.015+05:30
379	6	condition_chart	Condition wise Donut Chart	chart	t	0	2025-10-25 12:09:10.015+05:30	2025-10-25 12:09:10.015+05:30
380	6	remark_chart	Remark wise Tree Count	chart	t	0	2025-10-25 12:09:10.015+05:30	2025-10-25 12:09:10.015+05:30
381	6	ownership_chart	Ownership wise Pie Chart	chart	t	0	2025-10-25 12:09:10.015+05:30	2025-10-25 12:09:10.015+05:30
382	6	species_chart	Species wise Tree Count (Top 15)	chart	t	0	2025-10-25 12:09:10.015+05:30	2025-10-25 12:09:10.015+05:30
383	6	economic_importance_chart	Economic Importance wise Tree Count	chart	t	0	2025-10-25 12:09:10.015+05:30	2025-10-25 12:09:10.015+05:30
437	67	total_trees	Total Trees Surveyed	card	t	0	2025-12-11 11:48:41.972+05:30	2025-12-11 11:48:41.972+05:30
438	67	qc_completed	QC Completed	card	t	0	2025-12-11 11:48:41.972+05:30	2025-12-11 11:48:41.972+05:30
439	67	qc_pending	QC Pending	card	t	0	2025-12-11 11:48:41.972+05:30	2025-12-11 11:48:41.972+05:30
440	67	today_entries	Today Entries	card	t	0	2025-12-11 11:48:41.972+05:30	2025-12-11 11:48:41.972+05:30
441	67	this_week_entries	This Week Entries	card	t	0	2025-12-11 11:48:41.972+05:30	2025-12-11 11:48:41.972+05:30
442	67	this_month_entries	This Month Entries	card	t	0	2025-12-11 11:48:41.972+05:30	2025-12-11 11:48:41.972+05:30
443	67	condition_chart	Condition wise Donut Chart	chart	t	0	2025-12-11 11:48:41.972+05:30	2025-12-11 11:48:41.972+05:30
444	67	remark_chart	Remark wise Tree Count	chart	t	0	2025-12-11 11:48:41.972+05:30	2025-12-11 11:48:41.972+05:30
445	67	ownership_chart	Ownership wise Pie Chart	chart	t	0	2025-12-11 11:48:41.972+05:30	2025-12-11 11:48:41.972+05:30
446	67	species_chart	Species wise Tree Count (Top 15)	chart	t	0	2025-12-11 11:48:41.973+05:30	2025-12-11 11:48:41.973+05:30
447	67	economic_importance_chart	Economic Importance wise Tree Count	chart	t	0	2025-12-11 11:48:41.973+05:30	2025-12-11 11:48:41.973+05:30
\.


--
-- Data for Name: dbname; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.dbname (id, treelogy_id, dbname, locked, status) FROM stdin;
1	1	tenant_greenheights	N	0
\.


--
-- Data for Name: forms; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.forms (form_id, form_data, created_by, created_date, updated_date, treelogy_id) FROM stdin;
1	{"title": "test", "fields": [{"name": "Name", "type": "text", "options": [], "required": false}, {"name": "Gender", "type": "select", "options": ["male", "female"], "required": false}], "description": "test", "is_required": false}	3	2025-10-14 07:54:36.274	2025-10-14 07:54:36.274	2
\.


--
-- Data for Name: mapping; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.mapping (id, login_id, treelogy_id, description, code, role, view_permission, profile, status, created_by, created_at, sort_order, current_map_year) FROM stdin;
3	1	1	Main	U-101	Manager	ALL	0	1	0	2025-09-22 11:49:23.412+05:30	0	0
16	12	16	GreenHeights Tower B - Unit 2	GHU002-002	RESIDENT	FULL	0	1	0	2025-09-29 18:38:33.443+05:30	0	0
18	13	15	GreenHeights Tower A - Unit 3	GHU003-003	RESIDENT	FULL	0	1	0	2025-09-29 18:38:33.63+05:30	0	0
31	7	4	Access to GreenHeights Tower B	GH002	USER	Y	1	1	1	2025-10-06 13:08:08.11+05:30	0	2025
32	7	3	Access to GreenHeights Tower A	GH001	USER	Y	1	1	1	2025-10-06 13:08:08.227+05:30	0	2025
17	7	15	GreenHeights Tower A - Unit 1	GHU001-001	RESIDENT	FULL	0	1	0	2025-09-29 18:38:33.63+05:30	0	0
4	7	11	GreenHeights Tower A - Unit 1	GHU001-001	RESIDENT	FULL	0	1	0	2025-09-29 18:36:44.682+05:30	0	0
10	7	15	GreenHeights Tower A - Unit 1	GHU001-001	RESIDENT	FULL	0	1	0	2025-09-29 18:37:54.521+05:30	0	0
19	7	19	GreenHeights Tower A - Unit 1	GHU001-001	RESIDENT	FULL	0	1	0	2025-10-04 12:51:22.74+05:30	0	0
25	7	23	GreenHeights Tower A - Unit 1	GHU001-001	RESIDENT	FULL	0	1	0	2025-10-04 12:51:42.185+05:30	0	0
5	12	12	GreenHeights Tower B - Unit 2	GHU002-002	RESIDENT	FULL	0	1	0	2025-09-29 18:36:44.682+05:30	0	0
11	12	16	GreenHeights Tower B - Unit 2	GHU002-002	RESIDENT	FULL	0	1	0	2025-09-29 18:37:54.521+05:30	0	0
20	12	20	GreenHeights Tower B - Unit 2	GHU002-002	RESIDENT	FULL	0	1	0	2025-10-04 12:51:22.74+05:30	0	0
26	12	24	GreenHeights Tower B - Unit 2	GHU002-002	RESIDENT	FULL	0	1	0	2025-10-04 12:51:42.185+05:30	0	0
6	13	11	GreenHeights Tower A - Unit 3	GHU003-003	RESIDENT	FULL	0	1	0	2025-09-29 18:36:44.682+05:30	0	0
12	13	15	GreenHeights Tower A - Unit 3	GHU003-003	RESIDENT	FULL	0	1	0	2025-09-29 18:37:54.521+05:30	0	0
21	13	19	GreenHeights Tower A - Unit 3	GHU003-003	RESIDENT	FULL	0	1	0	2025-10-04 12:51:22.74+05:30	0	0
27	13	23	GreenHeights Tower A - Unit 3	GHU003-003	RESIDENT	FULL	0	1	0	2025-10-04 12:51:42.185+05:30	0	0
7	14	13	TechCorp Office - Floor 1	TCU001-001	EMPLOYEE	FULL	0	1	0	2025-09-29 18:36:44.682+05:30	0	0
13	14	17	TechCorp Office - Floor 1	TCU001-001	EMPLOYEE	FULL	0	1	0	2025-09-29 18:37:54.521+05:30	0	0
22	14	21	TechCorp Office - Floor 1	TCU001-001	EMPLOYEE	FULL	0	1	0	2025-10-04 12:51:22.74+05:30	0	0
28	14	25	TechCorp Office - Floor 1	TCU001-001	EMPLOYEE	FULL	0	1	0	2025-10-04 12:51:42.185+05:30	0	0
8	15	14	Urban Mall - Shop 1	TCU002-001	MANAGER	FULL	0	1	0	2025-09-29 18:36:44.682+05:30	0	0
14	15	18	Urban Mall - Shop 1	TCU002-001	MANAGER	FULL	0	1	0	2025-09-29 18:37:54.521+05:30	0	0
23	15	22	Urban Mall - Shop 1	TCU002-001	MANAGER	FULL	0	1	0	2025-10-04 12:51:22.74+05:30	0	0
29	15	26	Urban Mall - Shop 1	TCU002-001	MANAGER	FULL	0	1	0	2025-10-04 12:51:42.185+05:30	0	0
9	16	13	TechCorp Office - Floor 2	TCU003-002	EMPLOYEE	FULL	0	1	0	2025-09-29 18:36:44.682+05:30	0	0
15	16	17	TechCorp Office - Floor 2	TCU003-002	EMPLOYEE	FULL	0	1	0	2025-09-29 18:37:54.521+05:30	0	0
24	16	21	TechCorp Office - Floor 2	TCU003-002	EMPLOYEE	FULL	0	1	0	2025-10-04 12:51:22.74+05:30	0	0
30	16	25	TechCorp Office - Floor 2	TCU003-002	EMPLOYEE	FULL	0	1	0	2025-10-04 12:51:42.186+05:30	0	0
33	55	3	Abhay - GHU004	GHU004-3	USER	FULL	0	1	0	2025-10-11 12:42:18.803+05:30	0	2025
35	58	1	Mobile user - M004	M004-1	USER	FULL	0	1	3	2025-10-25 17:21:23.48+05:30	0	2025
36	66	2	QC USER1 - QC001	QC001-2	USER	FULL	0	1	3	2025-11-03 13:44:20.26+05:30	0	2025
\.


--
-- Data for Name: no_permission; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.no_permission (id, uid, entered_date, entered_time, lat1, lon1, lat2, lon2, lat3, lon3, lat4, lon4, lat5, lon5, name, reason, email, geom, approxnooftreesinpremise) FROM stdin;
\.


--
-- Data for Name: ownership; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.ownership (id, ownership_name) FROM stdin;
\.


--
-- Data for Name: path_details; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.path_details (id, user_id, latitude, longitude, date, "time") FROM stdin;
\.


--
-- Data for Name: random_count; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.random_count (id, dates, random_count) FROM stdin;
\.


--
-- Data for Name: remarks; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.remarks (id, remark_name) FROM stdin;
\.


--
-- Data for Name: scope_of_plantation; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.scope_of_plantation (id, latitude, longitude, entered_date, entered_time, google_address, user_id) FROM stdin;
\.


--
-- Data for Name: spacial_comment; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.spacial_comment (special_comment_id, special_comment) FROM stdin;
\.


--
-- Data for Name: spatial_ref_sys; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.spatial_ref_sys (srid, auth_name, auth_srid, srtext, proj4text) FROM stdin;
\.


--
-- Data for Name: treebal_imbalance; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.treebal_imbalance (balance_id, isbalance) FROM stdin;
\.


--
-- Data for Name: treedetailsentered; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.treedetailsentered (user_id, tree_id, latitude, longitude, grith_cm, height_mtr, condition_id, ownership_id, societyname, roadname, entered_date, entered_time, tree_details_id, googleaddress, updated_date, qc_updated_time, updated_by, qc_done, qc_status, qc_final_submitted, qc_updated_date, geom, version2, user_seq_id, old_latitude, old_longitude, drag_distance, qc_old_latitude, qc_old_longitude, qc_drag_distance, allocated_ward, within_boundary, new_or_old, grid, lat2, lon2, geom_line, geom2, dist, other_name, bla_imbal_id, canopy_diameter, other_remarks, remarks_id, dist_from_prev_tree, special_comment_id, bird_nest, resurvey_done, un_submit_date, un_submit_time, un_updated_by, comment_un, bo_qc_submit_date, bo_qc_submit_time, bo_qc_done_by, comment_bo_qc, bo_rare_qc_date, bo_rare_qc_time, bo_rare_qc_doneby, bo_rare_qc_comment, age, date_of_plantation, client_name, contractor_name, treename, ownership_name, ownership_contact_no, manual_tree_details_id, is_verified) FROM stdin;
\.


--
-- Data for Name: treedetailsentered_bkp_26102025; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.treedetailsentered_bkp_26102025 (user_id, tree_id, latitude, longitude, grith_cm, height_mtr, condition_id, ownership_id, societyname, roadname, entered_date, entered_time, tree_details_id, googleaddress, updated_date, qc_updated_time, updated_by, qc_done, qc_status, qc_final_submitted, qc_updated_date, geom, version2, user_seq_id, old_latitude, old_longitude, drag_distance, qc_old_latitude, qc_old_longitude, qc_drag_distance, allocated_ward, within_boundary, new_or_old, grid, lat2, lon2, geom_line, geom2, dist, other_name, bla_imbal_id, canopy_diameter, other_remarks, remarks_id, dist_from_prev_tree, special_comment_id, bird_nest, resurvey_done, un_submit_date, un_submit_time, un_updated_by, comment_un, bo_qc_submit_date, bo_qc_submit_time, bo_qc_done_by, comment_bo_qc, bo_rare_qc_date, bo_rare_qc_time, bo_rare_qc_doneby, bo_rare_qc_comment, age, date_of_plantation, client_name, contractor_name, treename, ownership_name, ownership_contact_no, manual_tree_details_id, is_verified) FROM stdin;
\.


--
-- Data for Name: treelist; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.treelist (tree_name, comman_name, family, phenology, economic, flowering, color, botanical, tree_id, is_rare, priority, wood_density, growth_factor, gujarati_name) FROM stdin;
\.


--
-- Data for Name: treelogy; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.treelogy (treelogy_id, treelogy_code, treelogy_name, landmark, dbname, client_id, updated_at, status) FROM stdin;
1	T001	GreenHeights	Gate A	amc_new	1	2025-09-22 11:37:07.441+05:30	Y
3	GH001	GreenHeights Tower A	Bandra Kurla Complex	amc_new	3	2025-09-29 17:52:57.875+05:30	Y
4	GH002	GreenHeights Tower B	Andheri West	amc_new	3	2025-09-29 17:52:57.875+05:30	Y
5	TC001	TechCorp Office Complex	Electronic City	amc_new	4	2025-09-29 17:52:57.875+05:30	Y
6	UB001	Urban Builders Mall	Connaught Place	amc_new	5	2025-09-29 17:52:57.875+05:30	Y
67	test1	test1	test1	test1	2	2025-12-11 11:47:49.554+05:30	Y
2	2	treelogy	h kuchto	amc_new	1	2025-09-23 15:40:55.973+05:30	Y
\.


--
-- Data for Name: trees; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.trees (id, geom, oid, sr_no, gps_no, user_name, local_name, other_name, girth_cm, height_m, canopy_dia_m, condition, other_remarks, dist_frm_p, ownership, society_name, road_name, existing_t, bird_nest, date_time, feat_name, datafile, data_dictionary, gnss_height, northing, easting, point_id, balanced, remarks, special_collar, ward_name, ward_id, qc_comment, client_comment, qc_2, botanical_name, common_name, saar_uid, phenology, economic_i, family_g, colour_of, flowering, canopy_typ, carbon_seq, is_rare, age, is_heritage, entered_date, entered_time, origin, host_plant) FROM stdin;
\.


--
-- Data for Name: trees_history; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.trees_history (id, geom, oid, sr_no, gps_no, user_name, local_name, other_name, girth_cm, height_m, canopy_dia_m, condition, other_remarks, dist_frm_p, ownership, society_name, road_name, existing_t, bird_nest, date_time, feat_name, datafile, data_dictionary, gnss_height, northing, easting, point_id, balanced, remarks, special_collar, ward_name, ward_id, qc_comment, client_comment, qc_2, botanical_name, common_name, saar_uid, phenology, economic_i, family_g, colour_of, flowering, canopy_typ, carbon_seq, is_rare, age, is_heritage, entered_date, entered_time, origin, host_plant, del_stamp, deleted_by, delete_remarks) FROM stdin;
\.


--
-- Data for Name: user_feedback; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.user_feedback (uf_id, uf_name, uf_email, uf_mobile, uf_comment, uf_mail_sent, uf_feedback_date, uf_mailsent_userid, uf_mailsent_comment, uf_mailsent_date, uf_feedback_delete, uf_tree_id, uf_saar_uid, uf_comment_common_name, uf_comment_girth, uf_comment_canopy, uf_comment_location, uf_comment_splcomment, uf_comment_height, uf_comment_treecondition, uf_comment_balanced, uf_comment_botname, uf_comment_localname) FROM stdin;
\.


--
-- Data for Name: user_master; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.user_master (id, role_name, role_display_name, description, permissions, is_active, created_by, sort_order, "createdAt", "updatedAt") FROM stdin;
1	SUPER_ADMIN	Super Administrator	Full system access with all permissions	{"can_manage_users":true,"can_manage_clients":true,"can_manage_projects":true,"can_manage_dashboard":true,"can_view_all_data":true,"can_manage_roles":true,"can_manage_user_master":true}	t	\N	1	2025-10-06 11:28:36.954+05:30	2025-10-06 11:28:36.954+05:30
2	CLIENT_ADMIN	Client Administrator	Client-level access with project management permissions	{"can_manage_users":false,"can_manage_clients":false,"can_manage_projects":true,"can_manage_dashboard":true,"can_view_all_data":false,"can_manage_roles":false,"can_manage_user_master":false}	t	\N	2	2025-10-06 11:28:36.954+05:30	2025-10-06 11:28:36.954+05:30
3	PROJECT_USER	Project User	Basic project access with limited permissions	{"can_manage_users":false,"can_manage_clients":false,"can_manage_projects":false,"can_manage_dashboard":false,"can_view_all_data":false,"can_manage_roles":false,"can_manage_user_master":false}	t	\N	3	2025-10-06 11:28:36.954+05:30	2025-10-06 11:28:36.954+05:30
4	QC_USER	Quality Control User	Quality control access with data verification permissions	{"can_manage_users":false,"can_manage_clients":false,"can_manage_projects":false,"can_manage_dashboard":false,"can_view_all_data":true,"can_manage_roles":false,"can_manage_user_master":false,"can_verify_data":true}	t	\N	4	2025-10-06 11:28:36.954+05:30	2025-10-06 11:28:36.954+05:30
5	VIEWER	Viewer	Read-only access to view data and reports	{"can_manage_users":false,"can_manage_clients":false,"can_manage_projects":false,"can_manage_dashboard":false,"can_view_all_data":true,"can_manage_roles":false,"can_manage_user_master":false,"can_verify_data":false}	t	\N	5	2025-10-06 11:28:36.954+05:30	2025-10-06 11:28:36.954+05:30
6	SURVEYOR	Surveyor	Field surveyor with data collection and entry permissions	{"can_collect_data":true,"can_enter_tree_details":true,"can_view_assigned_projects":true}	t	\N	6	2025-10-25 12:13:49.713+05:30	2025-10-25 12:13:49.713+05:30
7	QC_USER_2	Quality Control User Level 2	Advanced quality control access with full QC status options including Level 2 Hold, Verified, and Rejected	{"can_view_all_data": true, "can_verify_data": true, "can_set_level_2_hold": true, "can_verify_final": true, "can_reject": true}	t	\N	7	2025-11-03 12:52:33.774808+05:30	2025-11-03 12:52:33.774808+05:30
8	QC_TL	QC_TL	QC_TL   survey delete and qcpredict request 	{"can_view_all_data": true, "can_verify_data": true, "can_set_level_2_hold": true, "can_verify_final": true, "can_reject": true}\n	t	\N	8	2025-11-25 12:52:33.774808+05:30	2025-11-25 12:52:33.774808+05:30
9	CLIENT	CLIENT	only view permission for verified and non-verified data	{"can_manage_users":false,"can_manage_clients":false,"can_manage_projects":false,"can_manage_dashboard":false,"can_view_all_data":false,"can_manage_roles":false,"can_manage_user_master":false}	t	\N	9	2025-11-25 12:52:33.774808+05:30	2025-11-25 12:52:33.774808+05:30
\.


--
-- Data for Name: user_roles; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.user_roles (role_type, user_role) FROM stdin;
\.


--
-- Data for Name: wards; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.wards (id, geom, objectid, name, name_mr, remarks, zones, status) FROM stdin;
\.


--
-- Data for Name: zones; Type: TABLE DATA; Schema: public; Owner: postgres
--

COPY public.zones (id, name, name_mr) FROM stdin;
\.


--
-- Data for Name: topology; Type: TABLE DATA; Schema: topology; Owner: postgres
--

COPY topology.topology (id, name, srid, "precision", hasz) FROM stdin;
\.


--
-- Data for Name: layer; Type: TABLE DATA; Schema: topology; Owner: postgres
--

COPY topology.layer (topology_id, layer_id, schema_name, table_name, feature_column, feature_type, level, child_id) FROM stdin;
\.



--
-- Name: active_user active_user_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.active_user
    ADD CONSTRAINT active_user_pkey PRIMARY KEY (id);


--
-- Name: amc_ward_boundry amc_ward_boundry_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.amc_ward_boundry
    ADD CONSTRAINT amc_ward_boundry_pkey PRIMARY KEY (gid);


--
-- Name: bird_nest bird_nest_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.bird_nest
    ADD CONSTRAINT bird_nest_pkey PRIMARY KEY (bird_nest_id);


--
-- Name: buildings buildings_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.buildings
    ADD CONSTRAINT buildings_pkey PRIMARY KEY (gid);


--
-- Name: client client_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.client
    ADD CONSTRAINT client_pkey PRIMARY KEY (id);


--
-- Name: clientwise_features clientwise_features_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.clientwise_features
    ADD CONSTRAINT clientwise_features_pkey PRIMARY KEY (id);


--
-- Name: condition condition_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.condition
    ADD CONSTRAINT condition_pkey PRIMARY KEY (id);


--
-- Name: dashboard_visibility dashboard_visibility_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.dashboard_visibility
    ADD CONSTRAINT dashboard_visibility_pkey PRIMARY KEY (id);


--
-- Name: dbname dbname_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.dbname
    ADD CONSTRAINT dbname_pkey PRIMARY KEY (id);


--
-- Name: forms forms_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.forms
    ADD CONSTRAINT forms_pkey PRIMARY KEY (form_id);


--
-- Name: mapping mapping_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.mapping
    ADD CONSTRAINT mapping_pkey PRIMARY KEY (id);


--
-- Name: no_permission no_permission_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.no_permission
    ADD CONSTRAINT no_permission_pkey PRIMARY KEY (id);


--
-- Name: ownership ownership_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.ownership
    ADD CONSTRAINT ownership_pkey PRIMARY KEY (id);


--
-- Name: path_details path_details_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.path_details
    ADD CONSTRAINT path_details_pkey PRIMARY KEY (id);


--
-- Name: random_count random_count_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.random_count
    ADD CONSTRAINT random_count_pkey PRIMARY KEY (id);


--
-- Name: remarks remarks_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.remarks
    ADD CONSTRAINT remarks_pkey PRIMARY KEY (id);


--
-- Name: scope_of_plantation scope_of_plantation_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.scope_of_plantation
    ADD CONSTRAINT scope_of_plantation_pkey PRIMARY KEY (id);


--
-- Name: spacial_comment spacial_comment_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.spacial_comment
    ADD CONSTRAINT spacial_comment_pkey PRIMARY KEY (special_comment_id);


--
-- Name: treedetailsentered treedetailsentered_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.treedetailsentered
    ADD CONSTRAINT treedetailsentered_pkey PRIMARY KEY (tree_details_id);


--
-- Name: treelist treelist_pkey1; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.treelist
    ADD CONSTRAINT treelist_pkey1 PRIMARY KEY (tree_id);


--
-- Name: treelogy treelogy_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.treelogy
    ADD CONSTRAINT treelogy_pkey PRIMARY KEY (treelogy_id);


--
-- Name: trees trees_pkey1; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.trees
    ADD CONSTRAINT trees_pkey1 PRIMARY KEY (id);


--
-- Name: trees_history trees_pkey2; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.trees_history
    ADD CONSTRAINT trees_pkey2 PRIMARY KEY (id);


--
-- Name: user_feedback user_feedback_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.user_feedback
    ADD CONSTRAINT user_feedback_pkey PRIMARY KEY (uf_id);


--
-- Name: user_master user_master_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.user_master
    ADD CONSTRAINT user_master_pkey PRIMARY KEY (id);


--
-- Name: user_master user_master_role_name_key; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.user_master
    ADD CONSTRAINT user_master_role_name_key UNIQUE (role_name);


--
-- Name: user_roles user_roles_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.user_roles
    ADD CONSTRAINT user_roles_pkey PRIMARY KEY (role_type);


--
-- Name: wards wards_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.wards
    ADD CONSTRAINT wards_pkey PRIMARY KEY (id);


--
-- Name: zones zones_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.zones
    ADD CONSTRAINT zones_pkey PRIMARY KEY (id);


--
-- Name: amc_ward_boundry_geom_idx; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX amc_ward_boundry_geom_idx ON public.amc_ward_boundry USING gist (geom);


--
-- Name: dashboard_visibility_treelogy_id_card_id; Type: INDEX; Schema: public; Owner: postgres
--

CREATE UNIQUE INDEX dashboard_visibility_treelogy_id_card_id ON public.dashboard_visibility USING btree (treelogy_id, card_id);


--
-- Name: forms_created_by_idx; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX forms_created_by_idx ON public.forms USING btree (created_by);


--
-- Name: forms_created_date_idx; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX forms_created_date_idx ON public.forms USING btree (created_date);


--
-- Name: forms_treelogy_id_idx; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX forms_treelogy_id_idx ON public.forms USING btree (treelogy_id);


--
-- Name: idx_client_id; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_client_id ON public.clientwise_features USING btree (client_id);


--
-- Name: idx_client_treelogy; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_client_treelogy ON public.treelogy USING btree (client_id);


--
-- Name: idx_socity_mapping; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_socity_mapping ON public.mapping USING btree (treelogy_id, login_id);


--
-- Name: idx_tree_girth_cm; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_tree_girth_cm ON public.trees USING btree (girth_cm);


--
-- Name: idx_tree_height_m; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_tree_height_m ON public.trees USING btree (height_m);


--
-- Name: idx_tree_local_name; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_tree_local_name ON public.trees USING btree (local_name);


--
-- Name: idx_tree_ownership_; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_tree_ownership_ ON public.trees USING btree (ownership);


--
-- Name: idx_tree_road_name; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_tree_road_name ON public.trees USING btree (road_name);


--
-- Name: idx_tree_society_na; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_tree_society_na ON public.trees USING btree (society_name);


--
-- Name: idx_tree_ward_name; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_tree_ward_name ON public.trees USING btree (ward_name);


--
-- Name: idx_trees_geom; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX idx_trees_geom ON public.trees USING gist (geom);

ALTER TABLE public.trees CLUSTER ON idx_trees_geom;


--
-- Name: ind_entered_date; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX ind_entered_date ON public.treedetailsentered USING btree (entered_date);


--
-- Name: ind_latitude; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX ind_latitude ON public.treedetailsentered USING btree (latitude);


--
-- Name: ind_longitude; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX ind_longitude ON public.treedetailsentered USING btree (longitude);


--
-- Name: ind_user_id; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX ind_user_id ON public.treedetailsentered USING btree (user_id);


--
-- Name: trees_canopy_dia_m_idx; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX trees_canopy_dia_m_idx ON public.trees USING btree (canopy_dia_m);


--
-- Name: trees_colour_of_idx; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX trees_colour_of_idx ON public.trees USING btree (colour_of);


--
-- Name: trees_common_name_idx; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX trees_common_name_idx ON public.trees USING btree (common_name);


--
-- Name: trees_condition_idx; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX trees_condition_idx ON public.trees USING btree (condition);


--
-- Name: trees_economic_i_idx; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX trees_economic_i_idx ON public.trees USING btree (economic_i);


--
-- Name: trees_family_g_idx; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX trees_family_g_idx ON public.trees USING btree (family_g);


--
-- Name: trees_flowering_idx; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX trees_flowering_idx ON public.trees USING btree (flowering);


--
-- Name: trees_phenology_idx; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX trees_phenology_idx ON public.trees USING btree (phenology);


--
-- Name: trees_remarks_idx; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX trees_remarks_idx ON public.trees USING btree (remarks);


--
-- Name: trees_special_collar_idx; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX trees_special_collar_idx ON public.trees USING btree (special_collar);


--
-- Name: trees_ward_id_idx; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX trees_ward_id_idx ON public.trees USING btree (ward_id);


--
-- Name: user_master_is_active; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX user_master_is_active ON public.user_master USING btree (is_active);


--
-- Name: user_master_role_name; Type: INDEX; Schema: public; Owner: postgres
--

CREATE UNIQUE INDEX user_master_role_name ON public.user_master USING btree (role_name);


--
-- Name: clientwise_features clientwise_features_client_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.clientwise_features
    ADD CONSTRAINT clientwise_features_client_id_fkey FOREIGN KEY (client_id) REFERENCES public.client(id);


--
-- Name: dashboard_visibility dashboard_visibility_treelogy_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.dashboard_visibility
    ADD CONSTRAINT dashboard_visibility_treelogy_id_fkey FOREIGN KEY (treelogy_id) REFERENCES public.treelogy(treelogy_id) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- Name: forms fk_forms_client; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.forms
    ADD CONSTRAINT fk_forms_client FOREIGN KEY (created_by) REFERENCES public.client(id) ON UPDATE CASCADE ON DELETE RESTRICT;


--
-- Name: forms fk_forms_treelogy; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.forms
    ADD CONSTRAINT fk_forms_treelogy FOREIGN KEY (treelogy_id) REFERENCES public.treelogy(treelogy_id) ON UPDATE CASCADE ON DELETE SET NULL;


--
-- Name: mapping mapping_login_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.mapping
    ADD CONSTRAINT mapping_login_id_fkey FOREIGN KEY (login_id) REFERENCES public.login(login_id);


--
-- Name: treedetailsentered treedetailsentered_updated_by_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.treedetailsentered
    ADD CONSTRAINT treedetailsentered_updated_by_fkey FOREIGN KEY (updated_by) REFERENCES public.treeusers(uid);


--
-- Name: treelogy treelogy_client_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.treelogy
    ADD CONSTRAINT treelogy_client_id_fkey FOREIGN KEY (client_id) REFERENCES public.client(id);


--
-- Name: SCHEMA public; Type: ACL; Schema: -; Owner: postgres
--

REVOKE USAGE ON SCHEMA public FROM PUBLIC;
GRANT ALL ON SCHEMA public TO PUBLIC;


--
--

