Guest User

Untitled

a guest
Aug 28th, 2024
344
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CREATE EXTENSION pg_trgm;
  2.  
  3. DROP TABLE IF EXISTS "auteurs";
  4. DROP SEQUENCE IF EXISTS auteurs_id_seq;
  5. CREATE SEQUENCE auteurs_id_seq INCREMENT 1 MINVALUE 1 MAXVALUE 9223372036854775807 CACHE 1;
  6.  
  7. CREATE TABLE "public"."auteurs" (
  8.     "id" bigint DEFAULT nextval('auteurs_id_seq') NOT NULL,
  9.     "pseudo" text NOT NULL,
  10.     "avatar" text,
  11.     "jva" smallint DEFAULT '1' NOT NULL,
  12.     CONSTRAINT "auteurs_pkey" PRIMARY KEY ("id")
  13. ) WITH (oids = false);
  14.  
  15. create index idx_gin_auteurs_pseudo on auteurs using gin (pseudo gin_trgm_ops)
  16.  
  17.  
  18. DROP TABLE IF EXISTS "messages";
  19. DROP SEQUENCE IF EXISTS messages_id_seq;
  20. CREATE SEQUENCE messages_id_seq INCREMENT 1 MINVALUE 1 MAXVALUE 9223372036854775807 CACHE 1;
  21.  
  22. CREATE TABLE "public"."messages" (
  23.     "id" bigint DEFAULT nextval('messages_id_seq') NOT NULL,
  24.     "date_post" timestamp,
  25.     "texte" text,
  26.     "topic_id" bigint,
  27.     "auteur_id" bigint,
  28.     "jva" integer DEFAULT '1' NOT NULL,
  29.     CONSTRAINT "messages_pkey" PRIMARY KEY ("id")
  30. ) WITH (oids = false);
  31.  
  32. create index idx_gin_messages_texte on messages using gin (texte gin_trgm_ops)
  33.  
  34. CREATE INDEX "messages_auteur_id" ON "public"."messages" USING btree ("auteur_id");
  35.  
  36. CREATE INDEX "messages_date_post" ON "public"."messages" USING btree ("date_post");
  37.  
  38. CREATE INDEX "messages_jva" ON "public"."messages" USING btree ("jva");
  39.  
  40. CREATE INDEX "messages_topic_id" ON "public"."messages" USING btree ("topic_id");
  41.  
  42.  
  43. DROP TABLE IF EXISTS "topics";
  44. DROP SEQUENCE IF EXISTS topics_id_seq;
  45. CREATE SEQUENCE topics_id_seq INCREMENT 1 MINVALUE 1 MAXVALUE 9223372036854775807 CACHE 1;
  46.  
  47. CREATE TABLE "public"."topics" (
  48.     "id" bigint DEFAULT nextval('topics_id_seq') NOT NULL,
  49.     "titre" text,
  50.     "nb_messages" bigint,
  51.     "date_creation" timestamp,
  52.     "date_suppression" timestamp,
  53.     "restaure" smallint,
  54.     "delete_by_modo" character(1),
  55.     "auteur_id" bigint,
  56.     "date_dernier_message_enregistre" timestamp,
  57.     "date_dernier_message" timestamp,
  58.     "nb_messages_enregistre" bigint,
  59.     "jva" smallint DEFAULT '1' NOT NULL,
  60.     CONSTRAINT "topics_pkey" PRIMARY KEY ("id")
  61. ) WITH (oids = false);
  62.  
  63. CREATE INDEX "topics_auteur_id" ON "public"."topics" USING btree ("auteur_id");
  64.  
  65. CREATE INDEX "topics_date_creation" ON "public"."topics" USING btree ("date_creation");
  66.  
  67. CREATE INDEX "topics_date_dernier_message" ON "public"."topics" USING btree ("date_dernier_message");
  68.  
  69. CREATE INDEX "topics_date_dernier_message_enregistre" ON "public"."topics" USING btree ("date_dernier_message_enregistre");
  70.  
  71. CREATE INDEX "topics_date_suppression" ON "public"."topics" USING btree ("date_suppression");
  72.  
  73. CREATE INDEX "topics_delete_by_modo" ON "public"."topics" USING btree ("delete_by_modo");
  74.  
  75. CREATE INDEX "topics_jva" ON "public"."topics" USING btree ("jva");
  76.  
  77. CREATE INDEX "topics_nb_messages" ON "public"."topics" USING btree ("nb_messages");
  78.  
  79. CREATE INDEX "topics_nb_messages_enregistre" ON "public"."topics" USING btree ("nb_messages_enregistre");
  80.  
  81. CREATE INDEX "topics_restaure" ON "public"."topics" USING btree ("restaure");
  82.  
  83. CREATE INDEX "topics_titre" ON "public"."topics" USING btree ("titre");
  84.  
  85. create index idx_gin_topics_titre on topics using gin (titre gin_trgm_ops)
Advertisement
Add Comment
Please, Sign In to add comment