/**
 * @author tpasquet via pminot
 * @date 20/10/21
 * @version 1.0.0
 * @project SIEau
 * @table enquetes_reponses_doc pgsse_dangers_doc pgsse_dangers inst_visites
 */

# --- !Ups
ALTER TABLE inst_visites DROP COLUMN IF EXISTS pgsse;
ALTER TABLE inst_visites DROP COLUMN IF EXISTS idEnquete;
ALTER TABLE inst_visites ADD COLUMN idEnquete BIGINT;

DROP TABLE IF EXISTS enquetes_reponses_doc;
CREATE TABLE enquetes_reponses_doc (
idEnquete BIGINT,
codeInstallation BIGINT,
idQuestionLie BIGINT,
nomDocument VARCHAR ( 255 ),
description VARCHAR ( 255 )
);

DROP TABLE IF EXISTS pgsse_dangers_doc;
CREATE TABLE pgsse_dangers_doc (
idEnquete BIGINT,
typeSite BIGINT,
codeSite BIGINT,
idDanger BIGINT,
nomDocument VARCHAR ( 255 ),
description VARCHAR ( 255 )
);

DROP TABLE IF EXISTS enquetes_reponses_doc;
CREATE TABLE enquetes_reponses_doc (
idDanger BIGINT,
idEnquete BIGINT,
typeSite BIGINT,
codeSite BIGINT,
typeLexique VARCHAR ( 50 ),
situationDangereuse BIGINT,
commentaire VARCHAR ( 255 )
);

# --- !Downs
