Advertisement
Guest User

Init MySQL Spring

a guest
Jan 23rd, 2020
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.65 KB | None | 0 0
  1. --
  2. -- PostgreSQL database dump
  3. --
  4.  
  5. -- Dumped from database version 11.2 (Debian 11.2-1.pgdg90+1)
  6. -- Dumped by pg_dump version 11.2 (Debian 11.2-1.pgdg90+1)
  7.  
  8. SET statement_timeout = 0;
  9. SET lock_timeout = 0;
  10. SET idle_in_transaction_session_timeout = 0;
  11. SET client_encoding = 'UTF8';
  12. SET standard_conforming_strings = on;
  13. SELECT pg_catalog.set_config('search_path', '', false);
  14. SET check_function_bodies = false;
  15. SET client_min_messages = warning;
  16. SET row_security = off;
  17.  
  18. ALTER TABLE ONLY public.tbl_users_roles DROP CONSTRAINT fktluqqx2halgc7p9jkwky32vrv;
  19. ALTER TABLE ONLY public.tbl_assigment DROP CONSTRAINT fksptc0lftsxp29s0pod9bbprtp;
  20. ALTER TABLE ONLY public.tbl_users_roles DROP CONSTRAINT fkfyl02cyotreo3iktoovt2mp2d;
  21. ALTER TABLE ONLY public.tbl_student_subject DROP CONSTRAINT fkbvbdfavpbohtu2vh9kp944u9w;
  22. ALTER TABLE ONLY public.tbl_contact DROP CONSTRAINT fka16d3baa7wtpasdk9fi5vswmu;
  23. ALTER TABLE ONLY public.tbl_student_subject DROP CONSTRAINT fk3xp9h6tfnv9o6m6xpwyww83kw;
  24. ALTER TABLE ONLY public.tbl_user DROP CONSTRAINT uk_npn1wf1yu1g5rjohbek375pp1;
  25. ALTER TABLE ONLY public.tbl_contact DROP CONSTRAINT uk_l0ggcgypq0bvxvo8lp5uadu1p;
  26. ALTER TABLE ONLY public.tbl_user DROP CONSTRAINT tbl_user_pkey;
  27. ALTER TABLE ONLY public.tbl_subject DROP CONSTRAINT tbl_subject_pkey;
  28. ALTER TABLE ONLY public.tbl_student DROP CONSTRAINT tbl_student_pkey;
  29. ALTER TABLE ONLY public.tbl_role DROP CONSTRAINT tbl_role_pkey;
  30. ALTER TABLE ONLY public.tbl_employee DROP CONSTRAINT tbl_employee_pkey;
  31. ALTER TABLE ONLY public.tbl_contact DROP CONSTRAINT tbl_contact_pkey;
  32. ALTER TABLE ONLY public.tbl_assigment DROP CONSTRAINT tbl_assigment_pkey;
  33. DROP TABLE public.tbl_users_roles;
  34. DROP TABLE public.tbl_user;
  35. DROP TABLE public.tbl_subject;
  36. DROP TABLE public.tbl_student_subject;
  37. DROP TABLE public.tbl_student;
  38. DROP TABLE public.tbl_role;
  39. DROP TABLE public.tbl_employee;
  40. DROP TABLE public.tbl_contact;
  41. DROP TABLE public.tbl_assigment;
  42. SET default_tablespace = '';
  43.  
  44. SET default_with_oids = false;
  45.  
  46. --
  47. -- Name: tbl_assigment; Type: TABLE; Schema: public; Owner: postgres
  48. --
  49.  
  50. CREATE TABLE public.tbl_assigment (
  51. id bigint NOT NULL,
  52. grade integer NOT NULL,
  53. name character varying(100) NOT NULL,
  54. student_id bigint NOT NULL
  55. );
  56.  
  57.  
  58. ALTER TABLE public.tbl_assigment OWNER TO postgres;
  59.  
  60. --
  61. -- Name: tbl_contact; Type: TABLE; Schema: public; Owner: postgres
  62. --
  63.  
  64. CREATE TABLE public.tbl_contact (
  65. id bigint NOT NULL,
  66. city character varying(100),
  67. phone character varying(20),
  68. student_id bigint NOT NULL
  69. );
  70.  
  71.  
  72. ALTER TABLE public.tbl_contact OWNER TO postgres;
  73.  
  74. --
  75. -- Name: tbl_employee; Type: TABLE; Schema: public; Owner: postgres
  76. --
  77.  
  78. CREATE TABLE public.tbl_employee (
  79. company_id character varying(255) NOT NULL,
  80. employee_id character varying(255) NOT NULL,
  81. first_name character varying(100) NOT NULL,
  82. last_name character varying(100)
  83. );
  84.  
  85.  
  86. ALTER TABLE public.tbl_employee OWNER TO postgres;
  87.  
  88. --
  89. -- Name: tbl_role; Type: TABLE; Schema: public; Owner: postgres
  90. --
  91.  
  92. CREATE TABLE public.tbl_role (
  93. id bigint NOT NULL,
  94. role_name character varying(100) NOT NULL
  95. );
  96.  
  97.  
  98. ALTER TABLE public.tbl_role OWNER TO postgres;
  99.  
  100. --
  101. -- Name: tbl_student; Type: TABLE; Schema: public; Owner: postgres
  102. --
  103.  
  104. CREATE TABLE public.tbl_student (
  105. id bigint NOT NULL,
  106. created_by character varying(255),
  107. created_date timestamp without time zone,
  108. last_modified_by character varying(255),
  109. last_modified_date timestamp without time zone,
  110. age integer NOT NULL,
  111. name character varying(100) NOT NULL
  112. );
  113.  
  114.  
  115. ALTER TABLE public.tbl_student OWNER TO postgres;
  116.  
  117. --
  118. -- Name: tbl_student_subject; Type: TABLE; Schema: public; Owner: postgres
  119. --
  120.  
  121. CREATE TABLE public.tbl_student_subject (
  122. student_id bigint NOT NULL,
  123. subject_id bigint NOT NULL
  124. );
  125.  
  126.  
  127. ALTER TABLE public.tbl_student_subject OWNER TO postgres;
  128.  
  129. --
  130. -- Name: tbl_subject; Type: TABLE; Schema: public; Owner: postgres
  131. --
  132.  
  133. CREATE TABLE public.tbl_subject (
  134. id bigint NOT NULL,
  135. name character varying(100) NOT NULL
  136. );
  137.  
  138.  
  139. ALTER TABLE public.tbl_subject OWNER TO postgres;
  140.  
  141. --
  142. -- Name: tbl_user; Type: TABLE; Schema: public; Owner: postgres
  143. --
  144.  
  145. CREATE TABLE public.tbl_user (
  146. id bigint NOT NULL,
  147. email character varying(100),
  148. first_name character varying(100) NOT NULL,
  149. last_name character varying(100),
  150. password character varying(100),
  151. user_name character varying(50) NOT NULL
  152. );
  153.  
  154.  
  155. ALTER TABLE public.tbl_user OWNER TO postgres;
  156.  
  157. --
  158. -- Name: tbl_users_roles; Type: TABLE; Schema: public; Owner: postgres
  159. --
  160.  
  161. CREATE TABLE public.tbl_users_roles (
  162. user_id bigint NOT NULL,
  163. role_id bigint NOT NULL
  164. );
  165.  
  166.  
  167. ALTER TABLE public.tbl_users_roles OWNER TO postgres;
  168.  
  169. --
  170. -- Data for Name: tbl_assigment; Type: TABLE DATA; Schema: public; Owner: postgres
  171. --
  172.  
  173. COPY public.tbl_assigment (id, grade, name, student_id) FROM stdin;
  174. \.
  175.  
  176.  
  177. --
  178. -- Data for Name: tbl_contact; Type: TABLE DATA; Schema: public; Owner: postgres
  179. --
  180.  
  181. COPY public.tbl_contact (id, city, phone, student_id) FROM stdin;
  182. \.
  183.  
  184.  
  185. --
  186. -- Data for Name: tbl_employee; Type: TABLE DATA; Schema: public; Owner: postgres
  187. --
  188.  
  189. COPY public.tbl_employee (company_id, employee_id, first_name, last_name) FROM stdin;
  190. \.
  191.  
  192.  
  193. --
  194. -- Data for Name: tbl_role; Type: TABLE DATA; Schema: public; Owner: postgres
  195. --
  196.  
  197. COPY public.tbl_role (id, role_name) FROM stdin;
  198. \.
  199.  
  200.  
  201. --
  202. -- Data for Name: tbl_student; Type: TABLE DATA; Schema: public; Owner: postgres
  203. --
  204.  
  205. COPY public.tbl_student (id, created_by, created_date, last_modified_by, last_modified_date, age, name) FROM stdin;
  206. \.
  207.  
  208.  
  209. --
  210. -- Data for Name: tbl_student_subject; Type: TABLE DATA; Schema: public; Owner: postgres
  211. --
  212.  
  213. COPY public.tbl_student_subject (student_id, subject_id) FROM stdin;
  214. \.
  215.  
  216.  
  217. --
  218. -- Data for Name: tbl_subject; Type: TABLE DATA; Schema: public; Owner: postgres
  219. --
  220.  
  221. COPY public.tbl_subject (id, name) FROM stdin;
  222. \.
  223.  
  224.  
  225. --
  226. -- Data for Name: tbl_user; Type: TABLE DATA; Schema: public; Owner: postgres
  227. --
  228.  
  229. COPY public.tbl_user (id, email, first_name, last_name, password, user_name) FROM stdin;
  230. \.
  231.  
  232.  
  233. --
  234. -- Data for Name: tbl_users_roles; Type: TABLE DATA; Schema: public; Owner: postgres
  235. --
  236.  
  237. COPY public.tbl_users_roles (user_id, role_id) FROM stdin;
  238. \.
  239.  
  240.  
  241. --
  242. -- Name: tbl_assigment tbl_assigment_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
  243. --
  244.  
  245. ALTER TABLE ONLY public.tbl_assigment
  246. ADD CONSTRAINT tbl_assigment_pkey PRIMARY KEY (id);
  247.  
  248.  
  249. --
  250. -- Name: tbl_contact tbl_contact_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
  251. --
  252.  
  253. ALTER TABLE ONLY public.tbl_contact
  254. ADD CONSTRAINT tbl_contact_pkey PRIMARY KEY (id);
  255.  
  256.  
  257. --
  258. -- Name: tbl_employee tbl_employee_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
  259. --
  260.  
  261. ALTER TABLE ONLY public.tbl_employee
  262. ADD CONSTRAINT tbl_employee_pkey PRIMARY KEY (company_id, employee_id);
  263.  
  264.  
  265. --
  266. -- Name: tbl_role tbl_role_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
  267. --
  268.  
  269. ALTER TABLE ONLY public.tbl_role
  270. ADD CONSTRAINT tbl_role_pkey PRIMARY KEY (id);
  271.  
  272.  
  273. --
  274. -- Name: tbl_student tbl_student_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
  275. --
  276.  
  277. ALTER TABLE ONLY public.tbl_student
  278. ADD CONSTRAINT tbl_student_pkey PRIMARY KEY (id);
  279.  
  280.  
  281. --
  282. -- Name: tbl_subject tbl_subject_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
  283. --
  284.  
  285. ALTER TABLE ONLY public.tbl_subject
  286. ADD CONSTRAINT tbl_subject_pkey PRIMARY KEY (id);
  287.  
  288.  
  289. --
  290. -- Name: tbl_user tbl_user_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
  291. --
  292.  
  293. ALTER TABLE ONLY public.tbl_user
  294. ADD CONSTRAINT tbl_user_pkey PRIMARY KEY (id);
  295.  
  296.  
  297. --
  298. -- Name: tbl_contact uk_l0ggcgypq0bvxvo8lp5uadu1p; Type: CONSTRAINT; Schema: public; Owner: postgres
  299. --
  300.  
  301. ALTER TABLE ONLY public.tbl_contact
  302. ADD CONSTRAINT uk_l0ggcgypq0bvxvo8lp5uadu1p UNIQUE (student_id);
  303.  
  304.  
  305. --
  306. -- Name: tbl_user uk_npn1wf1yu1g5rjohbek375pp1; Type: CONSTRAINT; Schema: public; Owner: postgres
  307. --
  308.  
  309. ALTER TABLE ONLY public.tbl_user
  310. ADD CONSTRAINT uk_npn1wf1yu1g5rjohbek375pp1 UNIQUE (email);
  311.  
  312.  
  313. --
  314. -- Name: tbl_student_subject fk3xp9h6tfnv9o6m6xpwyww83kw; Type: FK CONSTRAINT; Schema: public; Owner: postgres
  315. --
  316.  
  317. ALTER TABLE ONLY public.tbl_student_subject
  318. ADD CONSTRAINT fk3xp9h6tfnv9o6m6xpwyww83kw FOREIGN KEY (student_id) REFERENCES public.tbl_student(id);
  319.  
  320.  
  321. --
  322. -- Name: tbl_contact fka16d3baa7wtpasdk9fi5vswmu; Type: FK CONSTRAINT; Schema: public; Owner: postgres
  323. --
  324.  
  325. ALTER TABLE ONLY public.tbl_contact
  326. ADD CONSTRAINT fka16d3baa7wtpasdk9fi5vswmu FOREIGN KEY (student_id) REFERENCES public.tbl_student(id);
  327.  
  328.  
  329. --
  330. -- Name: tbl_student_subject fkbvbdfavpbohtu2vh9kp944u9w; Type: FK CONSTRAINT; Schema: public; Owner: postgres
  331. --
  332.  
  333. ALTER TABLE ONLY public.tbl_student_subject
  334. ADD CONSTRAINT fkbvbdfavpbohtu2vh9kp944u9w FOREIGN KEY (subject_id) REFERENCES public.tbl_subject(id);
  335.  
  336.  
  337. --
  338. -- Name: tbl_users_roles fkfyl02cyotreo3iktoovt2mp2d; Type: FK CONSTRAINT; Schema: public; Owner: postgres
  339. --
  340.  
  341. ALTER TABLE ONLY public.tbl_users_roles
  342. ADD CONSTRAINT fkfyl02cyotreo3iktoovt2mp2d FOREIGN KEY (user_id) REFERENCES public.tbl_user(id);
  343.  
  344.  
  345. --
  346. -- Name: tbl_assigment fksptc0lftsxp29s0pod9bbprtp; Type: FK CONSTRAINT; Schema: public; Owner: postgres
  347. --
  348.  
  349. ALTER TABLE ONLY public.tbl_assigment
  350. ADD CONSTRAINT fksptc0lftsxp29s0pod9bbprtp FOREIGN KEY (student_id) REFERENCES public.tbl_student(id);
  351.  
  352.  
  353. --
  354. -- Name: tbl_users_roles fktluqqx2halgc7p9jkwky32vrv; Type: FK CONSTRAINT; Schema: public; Owner: postgres
  355. --
  356.  
  357. ALTER TABLE ONLY public.tbl_users_roles
  358. ADD CONSTRAINT fktluqqx2halgc7p9jkwky32vrv FOREIGN KEY (role_id) REFERENCES public.tbl_role(id);
  359.  
  360.  
  361. --
  362. -- PostgreSQL database dump complete
  363. --
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement