--
--





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

CREATE TABLE public.autores (
    id bigint NOT NULL,
    nombre character varying(255) NOT NULL,
    "a├▒o" integer NOT NULL,
    descripcion character varying(255) NOT NULL,
    estado integer DEFAULT 1 NOT NULL,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone
);


ALTER TABLE public.autores OWNER TO postgres;

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

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


ALTER SEQUENCE public.autores_id_seq OWNER TO postgres;

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

ALTER SEQUENCE public.autores_id_seq OWNED BY public.autores.id;

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

CREATE TABLE public.categorias (
    id bigint NOT NULL,
    nombre character varying(255) NOT NULL,
    descripcion character varying(500) NOT NULL,
    estado smallint DEFAULT '1'::smallint NOT NULL,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone
);


ALTER TABLE public.categorias OWNER TO postgres;

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

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


ALTER SEQUENCE public.categorias_id_seq OWNER TO postgres;

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

ALTER SEQUENCE public.categorias_id_seq OWNED BY public.categorias.id;


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

CREATE TABLE public.failed_jobs (
    id bigint NOT NULL,
    uuid character varying(255) NOT NULL,
    connection text NOT NULL,
    queue text NOT NULL,
    payload text NOT NULL,
    exception text NOT NULL,
    failed_at timestamp(0) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL
);


ALTER TABLE public.failed_jobs OWNER TO postgres;

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

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


ALTER SEQUENCE public.failed_jobs_id_seq OWNER TO postgres;

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

ALTER SEQUENCE public.failed_jobs_id_seq OWNED BY public.failed_jobs.id;


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

CREATE TABLE public.job_batches (
    id character varying(255) NOT NULL,
    name character varying(255) NOT NULL,
    total_jobs integer NOT NULL,
    pending_jobs integer NOT NULL,
    failed_jobs integer NOT NULL,
    failed_job_ids text NOT NULL,
    options text,
    cancelled_at integer,
    created_at integer NOT NULL,
    finished_at integer
);


ALTER TABLE public.job_batches OWNER TO postgres;

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

CREATE TABLE public.jobs (
    id bigint NOT NULL,
    queue character varying(255) NOT NULL,
    payload text NOT NULL,
    attempts smallint NOT NULL,
    reserved_at integer,
    available_at integer NOT NULL,
    created_at integer NOT NULL
);


ALTER TABLE public.jobs OWNER TO postgres;

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

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


ALTER SEQUENCE public.jobs_id_seq OWNER TO postgres;

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

ALTER SEQUENCE public.jobs_id_seq OWNED BY public.jobs.id;


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

CREATE TABLE public.migrations (
    id integer NOT NULL,
    migration character varying(255) NOT NULL,
    batch integer NOT NULL
);


ALTER TABLE public.migrations OWNER TO postgres;

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

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


ALTER SEQUENCE public.migrations_id_seq OWNER TO postgres;

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

ALTER SEQUENCE public.migrations_id_seq OWNED BY public.migrations.id;

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

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


ALTER SEQUENCE public.personal_access_tokens_id_seq OWNER TO postgres;

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

ALTER SEQUENCE public.personal_access_tokens_id_seq OWNED BY public.personal_access_tokens.id;


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

CREATE TABLE public.sessions (
    id character varying(255) NOT NULL,
    user_id bigint,
    ip_address character varying(45),
    user_agent text,
    payload text NOT NULL,
    last_activity integer NOT NULL
);


ALTER TABLE public.sessions OWNER TO postgres;

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

CREATE TABLE public.textos (
    id bigint NOT NULL,
    id_categoria bigint NOT NULL,
    id_autor bigint NOT NULL,
    titulo character varying(255) NOT NULL,
    sub_titulo character varying(255),
    "a├▒o" integer NOT NULL,
    descripcion text NOT NULL,
    resumen text NOT NULL,
    estado character varying(255) NOT NULL,
    estado_texto character varying(255) DEFAULT 'nuevo'::character varying,
    portada character varying(255) NOT NULL,
    archivo_pdf character varying(255) NOT NULL,
    created_at timestamp(0) without time zone,
    updated_at timestamp(0) without time zone,
    CONSTRAINT textos_estado_check CHECK (((estado)::text = ANY ((ARRAY['activo'::character varying, 'inactivo'::character varying])::text[]))),
    CONSTRAINT textos_estado_texto_check CHECK (((estado_texto)::text = ANY ((ARRAY['nuevo'::character varying, 'bueno'::character varying, 'regular'::character varying, 'antiguo'::character varying])::text[])))
);


ALTER TABLE public.textos OWNER TO postgres;

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

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


ALTER SEQUENCE public.textos_id_seq OWNER TO postgres;

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

ALTER SEQUENCE public.textos_id_seq OWNED BY public.textos.id;

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

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


ALTER SEQUENCE public.users_id_seq OWNER TO postgres;

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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

COPY public.autores (id, nombre, "a├▒o", descripcion, estado, created_at, updated_at) FROM stdin;
2	Eduardo Couture	2015	Derecho Procesal	1	2025-04-21 12:56:40	2025-04-21 12:56:40
3	Miguel Carbonell	2018	Derecho Constitucional	1	2025-04-21 12:56:54	2025-04-21 12:56:54
4	Norberto Bobbio	2019	Filosof├¡a y Teor├¡a del Derecho	1	2025-04-21 12:57:08	2025-04-21 12:57:08
5	Rafael Bielsa	2018	Derecho Internacional P├║blico	1	2025-04-21 12:57:22	2025-04-21 12:57:22
6	Hans Kelsen	2017	Teor├¡a Pura del Derecho	1	2025-04-21 12:58:10	2025-04-21 12:58:10
7	Roberto Su├írez Soto	2015	Derecho Penal	1	2025-04-21 12:58:23	2025-04-21 12:58:23
1	Luis Recas├®ns Siches 1	2015	Filosof├¡a del Derecho	0	2025-04-21 12:56:17	2025-04-22 14:41:09
8	pedro benito	2019	buenos dias 1	0	2025-04-22 14:41:48	2025-04-22 14:41:55
\.


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

COPY public.categorias (id, nombre, descripcion, estado, created_at, updated_at) FROM stdin;
2	Derecho Penal	Derecho Penal	1	2025-04-21 12:54:12	2025-04-21 12:54:12
3	Derecho Civil	Derecho Civil	1	2025-04-21 12:54:22	2025-04-21 12:54:22
4	Derecho Procesal Penal	Derecho Procesal Penal	1	2025-04-21 12:54:29	2025-04-21 12:54:29
5	Derecho Procesal Civil	Derecho Procesal Civil	1	2025-04-21 12:54:36	2025-04-21 12:54:36
6	Derecho Administrativo	Derecho Administrativo	1	2025-04-21 12:54:43	2025-04-21 12:54:43
7	Derecho Laboral	Derecho Laboral	1	2025-04-21 12:54:50	2025-04-21 12:54:50
8	Derecho Tributario	Derecho Tributario	1	2025-04-21 12:54:58	2025-04-21 12:54:58
9	Derechos Humanos	Derechos Humanos	1	2025-04-21 12:55:05	2025-04-21 12:55:05
10	Sociolog├¡a Jur├¡dica	Sociolog├¡a Jur├¡dica	0	2025-04-21 12:55:12	2025-04-21 15:50:54
1	Derecho constitucional	Leyes2024	1	2025-04-21 12:53:57	2025-04-21 20:42:55
\.


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

COPY public.failed_jobs (id, uuid, connection, queue, payload, exception, failed_at) FROM stdin;
\.


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

COPY public.job_batches (id, name, total_jobs, pending_jobs, failed_jobs, failed_job_ids, options, cancelled_at, created_at, finished_at) FROM stdin;
\.


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

COPY public.jobs (id, queue, payload, attempts, reserved_at, available_at, created_at) FROM stdin;
\.


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

COPY public.migrations (id, migration, batch) FROM stdin;
1	0001_01_01_000001_create_cache_table	1
2	0001_01_01_000002_create_jobs_table	1
3	2014_10_12_000000_create_users_table	1
4	2025_04_02_154931_create_sessions_table	1
5	2025_04_02_155236_create_personal_access_tokens_table	1
6	2025_04_02_172049_create_categorias_table	1
7	2025_04_02_172155_create_autores_table	1
8	2025_04_02_172245_create_textos_table	1
\.


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

COPY public.sessions (id, user_id, ip_address, user_agent, payload, last_activity) FROM stdin;
6DOC8T6Xzth3c2WSUwVeFPftzqUR22I6nMbtIm9w	\N	127.0.0.1	Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36	YTo0OntzOjY6Il90b2tlbiI7czo0MDoidzhwanVCbUFIWmZ2RTZsOXZnQkRvSGp0NjNyajh6NW53eU5HNkxlaCI7czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319czo5OiJfcHJldmlvdXMiO2E6MTp7czozOiJ1cmwiO3M6MjE6Imh0dHA6Ly8xMjcuMC4wLjE6ODAwMCI7fXM6MzoidXJsIjthOjE6e3M6ODoiaW50ZW5kZWQiO3M6NDE6Imh0dHA6Ly8xMjcuMC4wLjE6ODAwMC9saWJyb3M/cXVlcnk9c2RmYXNkIjt9fQ==	1745347215
\.


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

COPY public.textos (id, id_categoria, id_autor, titulo, sub_titulo, "a├▒o", descripcion, resumen, estado, estado_texto, portada, archivo_pdf, created_at, updated_at) FROM stdin;
3	8	6	"Derecho Procesal Civil"\t	nada	2025	asd	asd	activo	nuevo	storage/portadas/aRbu8EBzRjTLB6bfUAGIUygDQLk1ADbjGI2AHIQQ.jpg	storage/documentos/PW2SwPnnPHKiuPYEqrAAAIcHQtHoIuR3rBtCHAAH.pdf	2025-04-21 15:22:28	2025-04-21 15:22:28
5	9	7	"Derechos Fundamentales y Garant├¡as Constitucionales"	nada	2025	"Derechos Fundamentales y Garant├¡as Constitucionales"	"Derechos	activo	bueno	storage/portadas/Mij2iXM92dbQhc4uIKRgoCORZIuTkiojI4H998Il.png	storage/documentos/zamsQjYVT5SvCt5n5kz0EupMb6GP2GvZniqlNmEU.pdf	2025-04-21 21:25:47	2025-04-21 21:39:43
4	6	5	"Tratado de Derecho Civil: Contratos"	"Tratado de Derecho Civil: Contratos"	2025	"Tratado de Derecho Civil: Contratos"	"Tratado de Derecho Civil: Contratos"	activo	antiguo	storage/portadas/vFfHaPAICzwsuxoB2DXf41acp9ijtb3FwfJ3pTpN.jpg	storage/documentos/1CKZL1YFnt6CkQAtSv517y5oXZuh0eq9YGbWlBvc.pdf	2025-04-21 21:24:38	2025-04-21 21:39:54
1	4	2	"Teor├¡a Pura del Derecho"	Filosof├¡a del Derecho	2025	Filosof├¡a del Derecho	Filosof├¡a del Derecho	activo	nuevo	storage/portadas/AgYwAChb3TfKo2Igujqnb3wb4WisTMe3Mf2mGFHm.jpg	storage/documentos/B1a3VltHD9Mjg90nlv2IgSbChl7llavtE7RKl7JH.pdf	2025-04-21 12:59:12	2025-04-21 23:09:54
2	2	3	"Los L├¡mites del Derecho Penal"	nada	2015	asd	asd1	activo	antiguo	storage/portadas/TfNUapCHrN95e7p5T2ohBCZRNTaubGYkxkk5nfji.jpg	storage/documentos/d0MR8Lhbao0m8pXkroah73DjqTsKKv92jnNnLTIb.pdf	2025-04-21 15:21:31	2025-04-22 14:55:28
\.



--
-- Name: autores autores_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.autores
    ADD CONSTRAINT autores_pkey PRIMARY KEY (id);


--
-- Name: categorias categorias_nombre_unique; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.categorias
    ADD CONSTRAINT categorias_nombre_unique UNIQUE (nombre);


--
-- Name: categorias categorias_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.categorias
    ADD CONSTRAINT categorias_pkey PRIMARY KEY (id);


--
-- Name: failed_jobs failed_jobs_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.failed_jobs
    ADD CONSTRAINT failed_jobs_pkey PRIMARY KEY (id);


--
-- Name: failed_jobs failed_jobs_uuid_unique; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.failed_jobs
    ADD CONSTRAINT failed_jobs_uuid_unique UNIQUE (uuid);


--
-- Name: job_batches job_batches_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.job_batches
    ADD CONSTRAINT job_batches_pkey PRIMARY KEY (id);


--
-- Name: jobs jobs_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.jobs
    ADD CONSTRAINT jobs_pkey PRIMARY KEY (id);


--
-- Name: migrations migrations_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.migrations
    ADD CONSTRAINT migrations_pkey PRIMARY KEY (id);


--
-- Name: sessions sessions_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.sessions
    ADD CONSTRAINT sessions_pkey PRIMARY KEY (id);


--
-- Name: textos textos_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.textos
    ADD CONSTRAINT textos_pkey PRIMARY KEY (id);


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

CREATE INDEX jobs_queue_index ON public.jobs USING btree (queue);


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

CREATE INDEX sessions_last_activity_index ON public.sessions USING btree (last_activity);


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

CREATE INDEX sessions_user_id_index ON public.sessions USING btree (user_id);


--
-- Name: textos textos_id_autor_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.textos
    ADD CONSTRAINT textos_id_autor_foreign FOREIGN KEY (id_autor) REFERENCES public.autores(id) ON DELETE CASCADE;


--
-- Name: textos textos_id_categoria_foreign; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY public.textos
    ADD CONSTRAINT textos_id_categoria_foreign FOREIGN KEY (id_categoria) REFERENCES public.categorias(id) ON DELETE CASCADE;


--
--

