· 9 years ago · Dec 14, 2016, 09:16 AM
1/* tambahan tabel */
2
3DROP TABLE IF EXISTS "irci"."authors_articles";
4CREATE TABLE "irci"."authors_articles" (
5"id_authors" uuid NOT NULL,
6"id_record" uuid NOT NULL,
7"date_claim" date,
8"id_profile" uuid
9)
10WITH (OIDS=FALSE)
11
12;
13
14-- ----------------------------
15-- Alter Sequences Owned By
16-- ----------------------------
17
18-- ----------------------------
19-- Primary Key structure for table authors_articles
20-- ----------------------------
21ALTER TABLE "irci"."authors_articles" ADD PRIMARY KEY ("id_authors", "id_record");
22
23-- ----------------------------
24-- Foreign Key structure for table "irci"."authors_articles"
25-- ----------------------------
26ALTER TABLE "irci"."authors_articles" ADD FOREIGN KEY ("id_authors") REFERENCES "irci"."authors" ("id_authors") ON DELETE NO ACTION ON UPDATE NO ACTION;
27ALTER TABLE "irci"."authors_articles" ADD FOREIGN KEY ("id_record") REFERENCES "irci"."records" ("id_record") ON DELETE NO ACTION ON UPDATE NO ACTION;
28
29DROP TABLE IF EXISTS "irci"."profiles";
30CREATE TABLE "irci"."profiles" (
31"id_profile" uuid NOT NULL,
32"name" varchar(500) COLLATE "default",
33"date_generate" date,
34"affiliation" varchar(500) COLLATE "default"
35)
36WITH (OIDS=FALSE)
37
38;
39
40-- ----------------------------
41-- Alter Sequences Owned By
42-- ----------------------------
43
44-- ----------------------------
45-- Primary Key structure for table profiles
46-- ----------------------------
47ALTER TABLE "irci"."profiles" ADD PRIMARY KEY ("id_profile");
48
49DROP TABLE IF EXISTS "irci"."profiles_articles";
50CREATE TABLE "irci"."profiles_articles" (
51"id_profile" uuid NOT NULL,
52"id_record" uuid NOT NULL,
53"date_generate" date
54)
55WITH (OIDS=FALSE)
56
57;
58
59-- ----------------------------
60-- Alter Sequences Owned By
61-- ----------------------------
62
63-- ----------------------------
64-- Primary Key structure for table profiles_articles
65-- ----------------------------
66ALTER TABLE "irci"."profiles_articles" ADD PRIMARY KEY ("id_profile", "id_record");