Advertisement
QuangDepTrai

Create Table Auditlog Line

Aug 18th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- ----------------------------
  2. -- Table structure for auditlog_log_line
  3. -- ----------------------------
  4. DROP TABLE IF EXISTS "public"."auditlog_log_line";
  5. CREATE TABLE "public"."auditlog_log_line" (
  6.   "id" int4 NOT NULL,
  7.   "field_id" int4 NOT NULL,
  8.   "log_id" int4,
  9.   "old_value" text COLLATE "pg_catalog"."default",
  10.   "new_value" text COLLATE "pg_catalog"."default",
  11.   "old_value_text" text COLLATE "pg_catalog"."default",
  12.   "new_value_text" text COLLATE "pg_catalog"."default",
  13.   "create_uid" int4,
  14.   "create_date" timestamp(6),
  15.   "write_uid" int4,
  16.   "write_date" timestamp(6)
  17. )
  18. ;
  19. COMMENT ON COLUMN "public"."auditlog_log_line"."field_id" IS 'Field';
  20. COMMENT ON COLUMN "public"."auditlog_log_line"."log_id" IS 'Log';
  21. COMMENT ON COLUMN "public"."auditlog_log_line"."old_value" IS 'Old Value';
  22. COMMENT ON COLUMN "public"."auditlog_log_line"."new_value" IS 'New Value';
  23. COMMENT ON COLUMN "public"."auditlog_log_line"."old_value_text" IS 'Old value Text';
  24. COMMENT ON COLUMN "public"."auditlog_log_line"."new_value_text" IS 'New value Text';
  25. COMMENT ON COLUMN "public"."auditlog_log_line"."create_uid" IS 'Created by';
  26. COMMENT ON COLUMN "public"."auditlog_log_line"."create_date" IS 'Created on';
  27. COMMENT ON COLUMN "public"."auditlog_log_line"."write_uid" IS 'Last Updated by';
  28. COMMENT ON COLUMN "public"."auditlog_log_line"."write_date" IS 'Last Updated on';
  29. COMMENT ON TABLE "public"."auditlog_log_line" IS 'Auditlog - Log details (fields updated)';
  30.  
  31. -- ----------------------------
  32. -- Indexes structure for table auditlog_log_line
  33. -- ----------------------------
  34. CREATE INDEX "auditlog_log_line_log_id_index" ON "public"."auditlog_log_line" USING btree (
  35.   "log_id" "pg_catalog"."int4_ops" ASC NULLS LAST
  36. );
  37.  
  38. -- ----------------------------
  39. -- Primary Key structure for table auditlog_log_line
  40. -- ----------------------------
  41. ALTER TABLE "public"."auditlog_log_line" ADD CONSTRAINT "auditlog_log_line_pkey" PRIMARY KEY ("id");
  42.  
  43. -- ----------------------------
  44. -- Foreign Keys structure for table auditlog_log_line
  45. -- ----------------------------
  46. ALTER TABLE "public"."auditlog_log_line" ADD CONSTRAINT "auditlog_log_line_log_id_fkey" FOREIGN KEY ("log_id") REFERENCES "public"."auditlog_log" ("id") ON DELETE CASCADE ON UPDATE NO ACTION;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement