SHARE
TWEET

Create Table Mail Message

QuangDepTrai Aug 20th, 2019 (edited) 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- ----------------------------
  2. -- Table structure for mail_message
  3. -- ----------------------------
  4. DROP TABLE IF EXISTS "public"."mail_message";
  5. CREATE TABLE "public"."mail_message" (
  6.   "id" int4 NOT NULL DEFAULT nextval('mail_message_id_seq'::regclass),
  7.   "subject" varchar COLLATE "pg_catalog"."default",
  8.   "date" timestamp(6),
  9.   "body" text COLLATE "pg_catalog"."default",
  10.   "parent_id" int4,
  11.   "model" varchar COLLATE "pg_catalog"."default",
  12.   "res_id" int4,
  13.   "record_name" varchar COLLATE "pg_catalog"."default",
  14.   "message_type" varchar COLLATE "pg_catalog"."default" NOT NULL,
  15.   "subtype_id" int4,
  16.   "mail_activity_type_id" int4,
  17.   "email_from" varchar COLLATE "pg_catalog"."default",
  18.   "author_id" int4,
  19.   "no_auto_thread" bool,
  20.   "message_id" varchar COLLATE "pg_catalog"."default",
  21.   "reply_to" varchar COLLATE "pg_catalog"."default",
  22.   "mail_server_id" int4,
  23.   "create_uid" int4,
  24.   "create_date" timestamp(6),
  25.   "write_uid" int4,
  26.   "write_date" timestamp(6),
  27.   "website_published" bool
  28. )
  29. ;
  30. COMMENT ON COLUMN "public"."mail_message"."subject" IS 'Subject';
  31. COMMENT ON COLUMN "public"."mail_message"."date" IS 'Date';
  32. COMMENT ON COLUMN "public"."mail_message"."body" IS 'Contents';
  33. COMMENT ON COLUMN "public"."mail_message"."parent_id" IS 'Parent Message';
  34. COMMENT ON COLUMN "public"."mail_message"."model" IS 'Related Document Model';
  35. COMMENT ON COLUMN "public"."mail_message"."res_id" IS 'Related Document ID';
  36. COMMENT ON COLUMN "public"."mail_message"."record_name" IS 'Message Record Name';
  37. COMMENT ON COLUMN "public"."mail_message"."message_type" IS 'Type';
  38. COMMENT ON COLUMN "public"."mail_message"."subtype_id" IS 'Subtype';
  39. COMMENT ON COLUMN "public"."mail_message"."mail_activity_type_id" IS 'Mail Activity Type';
  40. COMMENT ON COLUMN "public"."mail_message"."email_from" IS 'From';
  41. COMMENT ON COLUMN "public"."mail_message"."author_id" IS 'Author';
  42. COMMENT ON COLUMN "public"."mail_message"."no_auto_thread" IS 'No threading for answers';
  43. COMMENT ON COLUMN "public"."mail_message"."message_id" IS 'Message-Id';
  44. COMMENT ON COLUMN "public"."mail_message"."reply_to" IS 'Reply-To';
  45. COMMENT ON COLUMN "public"."mail_message"."mail_server_id" IS 'Outgoing mail server';
  46. COMMENT ON COLUMN "public"."mail_message"."create_uid" IS 'Created by';
  47. COMMENT ON COLUMN "public"."mail_message"."create_date" IS 'Created on';
  48. COMMENT ON COLUMN "public"."mail_message"."write_uid" IS 'Last Updated by';
  49. COMMENT ON COLUMN "public"."mail_message"."write_date" IS 'Last Updated on';
  50. COMMENT ON COLUMN "public"."mail_message"."website_published" IS 'Published';
  51. COMMENT ON TABLE "public"."mail_message" IS 'Message';
  52.  
  53. -- ----------------------------
  54. -- Indexes structure for table mail_message
  55. -- ----------------------------
  56. CREATE INDEX "mail_message_author_id_index" ON "public"."mail_message" USING btree (
  57.   "author_id" "pg_catalog"."int4_ops" ASC NULLS LAST
  58. );
  59. CREATE INDEX "mail_message_mail_activity_type_id_index" ON "public"."mail_message" USING btree (
  60.   "mail_activity_type_id" "pg_catalog"."int4_ops" ASC NULLS LAST
  61. );
  62. CREATE INDEX "mail_message_message_id_index" ON "public"."mail_message" USING btree (
  63.   "message_id" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
  64. );
  65. CREATE INDEX "mail_message_model_index" ON "public"."mail_message" USING btree (
  66.   "model" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
  67. );
  68. CREATE INDEX "mail_message_model_res_id_idx" ON "public"."mail_message" USING btree (
  69.   "model" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  70.   "res_id" "pg_catalog"."int4_ops" ASC NULLS LAST
  71. );
  72. CREATE INDEX "mail_message_parent_id_index" ON "public"."mail_message" USING btree (
  73.   "parent_id" "pg_catalog"."int4_ops" ASC NULLS LAST
  74. );
  75. CREATE INDEX "mail_message_res_id_index" ON "public"."mail_message" USING btree (
  76.   "res_id" "pg_catalog"."int4_ops" ASC NULLS LAST
  77. );
  78. CREATE INDEX "mail_message_subtype_id_index" ON "public"."mail_message" USING btree (
  79.   "subtype_id" "pg_catalog"."int4_ops" ASC NULLS LAST
  80. );
  81.  
  82. -- ----------------------------
  83. -- Primary Key structure for table mail_message
  84. -- ----------------------------
  85. ALTER TABLE "public"."mail_message" ADD CONSTRAINT "mail_message_pkey" PRIMARY KEY ("id");
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top