presentations.sql 1.0 KB

12345678910111213141516171819
  1. CREATE TABLE IF NOT EXISTS vote.presentations
  2. (
  3. numero_presentation integer NOT NULL PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
  4. numero_categorie integer NOT NULL,
  5. numero_production integer NOT NULL,
  6. numero_ordre integer NOT NULL DEFAULT 0,
  7. flag_media integer DEFAULT 0,
  8. mime_media character varying(128) COLLATE pg_catalog."default",
  9. data_media bytea,
  10. nombre_points integer NOT NULL DEFAULT 0,
  11. nombre_pole_position integer NOT NULL DEFAULT 0,
  12. CONSTRAINT fk_numeroCategoriePresentation FOREIGN KEY(numero_categorie) REFERENCES vote.categories(numero_categorie),
  13. CONSTRAINT fk_numeroProductionPresentation FOREIGN KEY(numero_production) REFERENCES vote.productions(numero_production)
  14. )
  15. TABLESPACE vote;
  16. ALTER TABLE IF EXISTS vote.presentations OWNER to vote;
  17. CREATE INDEX IF NOT EXISTS ix_numeroCategoriePresentation ON vote.presentations USING btree (numero_categorie) TABLESPACE vote;
  18. CREATE INDEX IF NOT EXISTS ix_numeroProductionPresentation ON vote.presentations USING btree (numero_production) TABLESPACE vote;