--
--


SELECT pg_catalog.set_config('search_path', '', false);



--
-- Name: activity_data; Type: TABLE; Schema: public; Owner: timesheet_user
--

CREATE TABLE public.activity_data (
    id integer NOT NULL,
    developer_id character varying(255) NOT NULL,
    application_name character varying(255),
    window_title text,
    duration integer,
    "timestamp" timestamp with time zone NOT NULL,
    url text,
    file_path text,
    project_name character varying(255),
    project_type character varying(255),
    category character varying(255)
);


ALTER TABLE public.activity_data OWNER TO timesheet_user;

--
-- Name: activity_data_id_seq; Type: SEQUENCE; Schema: public; Owner: timesheet_user
--

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


ALTER TABLE public.activity_data_id_seq OWNER TO timesheet_user;

--
-- Name: activity_data_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: timesheet_user
--

ALTER SEQUENCE public.activity_data_id_seq OWNED BY public.activity_data.id;


--
-- Name: activity_records; Type: TABLE; Schema: public; Owner: timesheet_user
--

CREATE TABLE public.activity_records (
    id integer NOT NULL,
    user_id integer,
    developer_id character varying,
    application_name character varying,
    window_title text,
    url text,
    file_path text,
    database_connection character varying,
    specific_process character varying,
    detailed_activity text,
    category character varying,
    duration double precision,
    "timestamp" timestamp with time zone,
    created_at timestamp with time zone DEFAULT now(),
    project_name character varying,
    project_type character varying,
    project_file character varying,
    activity_data jsonb,
    subcategory character varying(100),
    category_confidence double precision DEFAULT 0.0
);


ALTER TABLE public.activity_records OWNER TO timesheet_user;

--
-- Name: activity_records_id_seq; Type: SEQUENCE; Schema: public; Owner: timesheet_user
--

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


ALTER TABLE public.activity_records_id_seq OWNER TO timesheet_user;

--
-- Name: activity_records_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: timesheet_user
--

ALTER SEQUENCE public.activity_records_id_seq OWNED BY public.activity_records.id;


--
-- Name: activity_sessions; Type: TABLE; Schema: public; Owner: timesheet_user
--

CREATE TABLE public.activity_sessions (
    id integer NOT NULL,
    developer_id character varying NOT NULL,
    session_start timestamp with time zone NOT NULL,
    session_end timestamp with time zone,
    total_active_time integer DEFAULT 0,
    is_active boolean DEFAULT true,
    created_at timestamp with time zone DEFAULT now()
);


ALTER TABLE public.activity_sessions OWNER TO timesheet_user;

--
-- Name: activity_sessions_id_seq; Type: SEQUENCE; Schema: public; Owner: timesheet_user
--

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


ALTER TABLE public.activity_sessions_id_seq OWNER TO timesheet_user;

--
-- Name: activity_sessions_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: timesheet_user
--

ALTER SEQUENCE public.activity_sessions_id_seq OWNED BY public.activity_sessions.id;


--
-- Name: developer_api_tokens; Type: TABLE; Schema: public; Owner: timesheet_user
--

CREATE TABLE public.developer_api_tokens (
    id integer NOT NULL,
    developer_id character varying NOT NULL,
    api_token character varying NOT NULL,
    token_name character varying DEFAULT 'Default Token'::character varying,
    is_active boolean DEFAULT true,
    created_at timestamp with time zone DEFAULT now()
);


ALTER TABLE public.developer_api_tokens OWNER TO timesheet_user;

--
-- Name: developer_api_tokens_id_seq; Type: SEQUENCE; Schema: public; Owner: timesheet_user
--

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


ALTER TABLE public.developer_api_tokens_id_seq OWNER TO timesheet_user;

--
-- Name: developer_api_tokens_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: timesheet_user
--

ALTER SEQUENCE public.developer_api_tokens_id_seq OWNED BY public.developer_api_tokens.id;


--
-- Name: developers; Type: TABLE; Schema: public; Owner: timesheet_user
--

CREATE TABLE public.developers (
    id integer NOT NULL,
    developer_id character varying,
    name character varying,
    email character varying,
    active boolean,
    api_token character varying,
    created_at timestamp with time zone DEFAULT now(),
    last_sync timestamp with time zone
);


ALTER TABLE public.developers OWNER TO timesheet_user;

--
-- Name: developers_id_seq; Type: SEQUENCE; Schema: public; Owner: timesheet_user
--

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


ALTER TABLE public.developers_id_seq OWNER TO timesheet_user;

--
-- Name: developers_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: timesheet_user
--

ALTER SEQUENCE public.developers_id_seq OWNED BY public.developers.id;


--
-- Name: discovered_developers; Type: TABLE; Schema: public; Owner: timesheet_user
--

CREATE TABLE public.discovered_developers (
    id integer NOT NULL,
    developer_name character varying,
    developer_pattern character varying,
    confidence_score double precision,
    first_seen timestamp with time zone,
    last_seen timestamp with time zone,
    activity_count integer
);


ALTER TABLE public.discovered_developers OWNER TO timesheet_user;

--
-- Name: discovered_developers_enhanced; Type: TABLE; Schema: public; Owner: timesheet_user
--

CREATE TABLE public.discovered_developers_enhanced (
    id character varying(255) NOT NULL,
    name character varying(255),
    host character varying(255),
    port integer,
    hostname character varying(255),
    device_id character varying(255),
    description text,
    version character varying(50),
    bucket_count integer,
    activity_count integer,
    status character varying(50),
    last_seen timestamp with time zone,
    last_checked timestamp with time zone,
    source character varying(50),
    discovered_at timestamp with time zone DEFAULT now(),
    is_active boolean,
    created_at timestamp with time zone DEFAULT now(),
    updated_at timestamp with time zone DEFAULT now()
);


ALTER TABLE public.discovered_developers_enhanced OWNER TO timesheet_user;

--
-- Name: discovered_developers_id_seq; Type: SEQUENCE; Schema: public; Owner: timesheet_user
--

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


ALTER TABLE public.discovered_developers_id_seq OWNER TO timesheet_user;

--
-- Name: discovered_developers_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: timesheet_user
--

ALTER SEQUENCE public.discovered_developers_id_seq OWNED BY public.discovered_developers.id;


--
-- Name: projects; Type: TABLE; Schema: public; Owner: timesheet_user
--

CREATE TABLE public.projects (
    id integer NOT NULL,
    name character varying(255),
    description text,
    is_active boolean,
    created_at timestamp with time zone DEFAULT now()
);


ALTER TABLE public.projects OWNER TO timesheet_user;

--
-- Name: projects_id_seq; Type: SEQUENCE; Schema: public; Owner: timesheet_user
--

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


ALTER TABLE public.projects_id_seq OWNER TO timesheet_user;

--
-- Name: projects_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: timesheet_user
--

ALTER SEQUENCE public.projects_id_seq OWNED BY public.projects.id;


--
-- Name: users; Type: TABLE; Schema: public; Owner: timesheet_user
--

CREATE TABLE public.users (
    id integer NOT NULL,
    username character varying,
    email character varying,
    hashed_password character varying,
    created_at timestamp with time zone DEFAULT now()
);


ALTER TABLE public.users OWNER TO timesheet_user;

--
-- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: timesheet_user
--

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


ALTER TABLE public.users_id_seq OWNER TO timesheet_user;

--
-- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: timesheet_user
--

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


--
-- Name: activity_data id; Type: DEFAULT; Schema: public; Owner: timesheet_user
--

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


--
-- Name: activity_records id; Type: DEFAULT; Schema: public; Owner: timesheet_user
--

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


--
-- Name: activity_sessions id; Type: DEFAULT; Schema: public; Owner: timesheet_user
--

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


--
-- Name: developer_api_tokens id; Type: DEFAULT; Schema: public; Owner: timesheet_user
--

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


--
-- Name: developers id; Type: DEFAULT; Schema: public; Owner: timesheet_user
--

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


--
-- Name: discovered_developers id; Type: DEFAULT; Schema: public; Owner: timesheet_user
--

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


--
-- Name: projects id; Type: DEFAULT; Schema: public; Owner: timesheet_user
--

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


--
-- Name: users id; Type: DEFAULT; Schema: public; Owner: timesheet_user
--

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


--
-- Data for Name: activity_data; Type: TABLE DATA; Schema: public; Owner: timesheet_user
--

COPY public.activity_data (id, developer_id, application_name, window_title, duration, "timestamp", url, file_path, project_name, project_type, category) FROM stdin;
\.




--
-- Data for Name: activity_sessions; Type: TABLE DATA; Schema: public; Owner: timesheet_user
--

COPY public.activity_sessions (id, developer_id, session_start, session_end, total_active_time, is_active, created_at) FROM stdin;
\.


--
-- Data for Name: developer_api_tokens; Type: TABLE DATA; Schema: public; Owner: timesheet_user
--

COPY public.developer_api_tokens (id, developer_id, api_token, token_name, is_active, created_at) FROM stdin;
1	Riddhi Dankhara	AWToken_SGKYclwfOQ-7s1yAx6a6ypO8Snut-NoFPxvVNzfUvSM	Riddhi Dankhara Token	t	2025-09-22 09:43:05.266786+00
\.


--
-- Data for Name: developers; Type: TABLE DATA; Schema: public; Owner: timesheet_user
--

COPY public.developers (id, developer_id, name, email, active, api_token, created_at, last_sync) FROM stdin;
1	riddhidhakhara	RiddhiDhakhara	riddhidhakhara@company.com	t	AWToken_vkeY5pcMmyvUkfh_6Jh8JMHVOWhyz0YirwxNuw2NhLI	2025-09-24 13:34:47.590701+00	\N
3	mrunali	mrunali	mrunali@company.com	t	AWToken_1CEPGEXcx1rlfDHHAtQjbMotUMn5MDAajhBYkoWCur0	2025-10-30 13:11:23.904444+00	\N
42	ankita_gholap	ankita gholap	ankita_gholap@company.com	t	AWToken_k6kNaTg86QRjwgmxktgajNd4yj_IDMnxRCvSWiOqA64	2025-12-05 07:51:39.03613+00	\N
\.


--
-- Data for Name: discovered_developers; Type: TABLE DATA; Schema: public; Owner: timesheet_user
--

COPY public.discovered_developers (id, developer_name, developer_pattern, confidence_score, first_seen, last_seen, activity_count) FROM stdin;
\.


--
-- Data for Name: discovered_developers_enhanced; Type: TABLE DATA; Schema: public; Owner: timesheet_user
--

COPY public.discovered_developers_enhanced (id, name, host, port, hostname, device_id, description, version, bucket_count, activity_count, status, last_seen, last_checked, source, discovered_at, is_active, created_at, updated_at) FROM stdin;
\.


--
-- Data for Name: projects; Type: TABLE DATA; Schema: public; Owner: timesheet_user
--

COPY public.projects (id, name, description, is_active, created_at) FROM stdin;
\.


--
-- Data for Name: users; Type: TABLE DATA; Schema: public; Owner: timesheet_user
--

COPY public.users (id, username, email, hashed_password, created_at) FROM stdin;
1	admin	admin@example.com	$2b$12$nkkJrzFndcTX.qIw4Sx5Gu4HEW39Eb1Oq9zdJRTVcYw7zxfFc9gR.	2025-09-21 18:47:14.294799+00
\.


--
-- Name: activity_data_id_seq; Type: SEQUENCE SET; Schema: public; Owner: timesheet_user
--

SELECT pg_catalog.setval('public.activity_data_id_seq', 1, false);


--
-- Name: activity_records_id_seq; Type: SEQUENCE SET; Schema: public; Owner: timesheet_user
--

SELECT pg_catalog.setval('public.activity_records_id_seq', 180883, true);


--
-- Name: activity_sessions_id_seq; Type: SEQUENCE SET; Schema: public; Owner: timesheet_user
--

SELECT pg_catalog.setval('public.activity_sessions_id_seq', 1, false);


--
-- Name: developer_api_tokens_id_seq; Type: SEQUENCE SET; Schema: public; Owner: timesheet_user
--

SELECT pg_catalog.setval('public.developer_api_tokens_id_seq', 1, true);


--
-- Name: developers_id_seq; Type: SEQUENCE SET; Schema: public; Owner: timesheet_user
--

SELECT pg_catalog.setval('public.developers_id_seq', 42, true);


--
-- Name: discovered_developers_id_seq; Type: SEQUENCE SET; Schema: public; Owner: timesheet_user
--

SELECT pg_catalog.setval('public.discovered_developers_id_seq', 1, false);


--
-- Name: projects_id_seq; Type: SEQUENCE SET; Schema: public; Owner: timesheet_user
--

SELECT pg_catalog.setval('public.projects_id_seq', 1, false);


--
-- Name: users_id_seq; Type: SEQUENCE SET; Schema: public; Owner: timesheet_user
--

SELECT pg_catalog.setval('public.users_id_seq', 1, true);


--
-- Name: activity_data activity_data_pkey; Type: CONSTRAINT; Schema: public; Owner: timesheet_user
--

ALTER TABLE ONLY public.activity_data
    ADD CONSTRAINT activity_data_pkey PRIMARY KEY (id);


--
-- Name: activity_records activity_records_pkey; Type: CONSTRAINT; Schema: public; Owner: timesheet_user
--

ALTER TABLE ONLY public.activity_records
    ADD CONSTRAINT activity_records_pkey PRIMARY KEY (id);


--
-- Name: activity_sessions activity_sessions_pkey; Type: CONSTRAINT; Schema: public; Owner: timesheet_user
--

ALTER TABLE ONLY public.activity_sessions
    ADD CONSTRAINT activity_sessions_pkey PRIMARY KEY (id);


--
-- Name: developer_api_tokens developer_api_tokens_api_token_key; Type: CONSTRAINT; Schema: public; Owner: timesheet_user
--

ALTER TABLE ONLY public.developer_api_tokens
    ADD CONSTRAINT developer_api_tokens_api_token_key UNIQUE (api_token);


--
-- Name: developer_api_tokens developer_api_tokens_pkey; Type: CONSTRAINT; Schema: public; Owner: timesheet_user
--

ALTER TABLE ONLY public.developer_api_tokens
    ADD CONSTRAINT developer_api_tokens_pkey PRIMARY KEY (id);


--
-- Name: developers developers_api_token_key; Type: CONSTRAINT; Schema: public; Owner: timesheet_user
--

ALTER TABLE ONLY public.developers
    ADD CONSTRAINT developers_api_token_key UNIQUE (api_token);


--
-- Name: developers developers_pkey; Type: CONSTRAINT; Schema: public; Owner: timesheet_user
--

ALTER TABLE ONLY public.developers
    ADD CONSTRAINT developers_pkey PRIMARY KEY (id);


--
-- Name: discovered_developers_enhanced discovered_developers_enhanced_pkey; Type: CONSTRAINT; Schema: public; Owner: timesheet_user
--

ALTER TABLE ONLY public.discovered_developers_enhanced
    ADD CONSTRAINT discovered_developers_enhanced_pkey PRIMARY KEY (id);


--
-- Name: discovered_developers discovered_developers_pkey; Type: CONSTRAINT; Schema: public; Owner: timesheet_user
--

ALTER TABLE ONLY public.discovered_developers
    ADD CONSTRAINT discovered_developers_pkey PRIMARY KEY (id);


--
-- Name: projects projects_pkey; Type: CONSTRAINT; Schema: public; Owner: timesheet_user
--

ALTER TABLE ONLY public.projects
    ADD CONSTRAINT projects_pkey PRIMARY KEY (id);


--
-- Name: users users_pkey; Type: CONSTRAINT; Schema: public; Owner: timesheet_user
--

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


--
-- Name: idx_activity_data_developer_timestamp; Type: INDEX; Schema: public; Owner: timesheet_user
--

CREATE INDEX idx_activity_data_developer_timestamp ON public.activity_data USING btree (developer_id, "timestamp");


--
-- Name: idx_activity_records_developer_id; Type: INDEX; Schema: public; Owner: timesheet_user
--

CREATE INDEX idx_activity_records_developer_id ON public.activity_records USING btree (developer_id);


--
-- Name: ix_activity_records_application_name; Type: INDEX; Schema: public; Owner: timesheet_user
--

CREATE INDEX ix_activity_records_application_name ON public.activity_records USING btree (application_name);


--
-- Name: ix_activity_records_category; Type: INDEX; Schema: public; Owner: timesheet_user
--

CREATE INDEX ix_activity_records_category ON public.activity_records USING btree (category);


--
-- Name: ix_activity_records_developer_id; Type: INDEX; Schema: public; Owner: timesheet_user
--

CREATE INDEX ix_activity_records_developer_id ON public.activity_records USING btree (developer_id);


--
-- Name: ix_activity_records_id; Type: INDEX; Schema: public; Owner: timesheet_user
--

CREATE INDEX ix_activity_records_id ON public.activity_records USING btree (id);


--
-- Name: ix_activity_records_project_name; Type: INDEX; Schema: public; Owner: timesheet_user
--

CREATE INDEX ix_activity_records_project_name ON public.activity_records USING btree (project_name);


--
-- Name: ix_developers_developer_id; Type: INDEX; Schema: public; Owner: timesheet_user
--

CREATE UNIQUE INDEX ix_developers_developer_id ON public.developers USING btree (developer_id);


--
-- Name: ix_developers_id; Type: INDEX; Schema: public; Owner: timesheet_user
--

CREATE INDEX ix_developers_id ON public.developers USING btree (id);


--
-- Name: ix_discovered_developers_id; Type: INDEX; Schema: public; Owner: timesheet_user
--

CREATE INDEX ix_discovered_developers_id ON public.discovered_developers USING btree (id);


--
-- Name: ix_projects_id; Type: INDEX; Schema: public; Owner: timesheet_user
--

CREATE INDEX ix_projects_id ON public.projects USING btree (id);


--
-- Name: ix_projects_name; Type: INDEX; Schema: public; Owner: timesheet_user
--

CREATE UNIQUE INDEX ix_projects_name ON public.projects USING btree (name);


--
-- Name: ix_users_email; Type: INDEX; Schema: public; Owner: timesheet_user
--

CREATE UNIQUE INDEX ix_users_email ON public.users USING btree (email);


--
-- Name: ix_users_id; Type: INDEX; Schema: public; Owner: timesheet_user
--

CREATE INDEX ix_users_id ON public.users USING btree (id);


--
-- Name: ix_users_username; Type: INDEX; Schema: public; Owner: timesheet_user
--

CREATE UNIQUE INDEX ix_users_username ON public.users USING btree (username);


--
-- Name: activity_records activity_records_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: timesheet_user
--

ALTER TABLE ONLY public.activity_records
    ADD CONSTRAINT activity_records_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id);


--
--

