ALTER TABLE VOO ADD (
  IDCONSIDERAPLANPROD VARCHAR2(1) DEFAULT 'S' NOT NULL
)
/
ALTER TABLE VOO ADD CONSTRAINT CKC_IDCONSIDERAPLANPROD_VOO CHECK (IDCONSIDERAPLANPROD IN ('S', 'N'))
/
ALTER TABLE CIAFILI ADD (
  IDOBRIGAEQUIPPLAVOO VARCHAR2(1) DEFAULT 'N' NOT NULL
)
/
ALTER TABLE CIAFILI ADD CONSTRAINT CKC_IDOBRIGAEQUIPPLAVO_CIAFILI CHECK (IDOBRIGAEQUIPPLAVOO IN ('S', 'N'))
/
CREATE TABLE TIPOVOOCONFIGVOO (
  CDFILIAL VARCHAR2(4) NOT NULL, 
  CDCIA VARCHAR2(4) NOT NULL, 
  NRVOO VARCHAR2(5) NOT NULL, 
  CDTRECHO VARCHAR2(4) NOT NULL, 
  CDEXPTIPOVOO VARCHAR2(5) NOT NULL, 
  CDAGRDEL VARCHAR2(4) NOT NULL, 
  NRORG NUMBER(10) DEFAULT 1 NOT NULL, 
  IDATIVO VARCHAR2(1) DEFAULT 'S' NOT NULL, 
  DTINCLUSAO DATE DEFAULT NULL NULL, 
  CDOPERINCLUSAO VARCHAR2(12) DEFAULT '1' NULL, 
  DTULTATU DATE DEFAULT NULL NULL, 
  NRORGINCLUSAO NUMBER(10) DEFAULT 1 NULL, 
  NRORGULTATU NUMBER(10) DEFAULT 1 NULL, 
  CDOPERULTATU VARCHAR2(12) DEFAULT '1' NULL,
  CONSTRAINT PK_TIPOVOOCONFIGVOO PRIMARY KEY(CDFILIAL, CDCIA, NRVOO, CDTRECHO, CDAGRDEL, CDEXPTIPOVOO)
)
/
ALTER TABLE TIPOVOOCONFIGVOO ADD CONSTRAINT CKC_IDATIVO_TIPOVOOCONFIGVOO CHECK (IDATIVO IN ('S','N'))
/
CREATE TABLE TIPOVOOCONFIGPREF (
  CDFILIAL VARCHAR2(4) NOT NULL, 
  CDCIA VARCHAR2(4) NOT NULL, 
  SGPREFIXO VARCHAR2(10) NOT NULL, 
  CDEXPTIPOVOO VARCHAR2(5) NOT NULL, 
  CDAGRDEL VARCHAR2(4) NOT NULL, 
  NRORG NUMBER(10) DEFAULT 1 NOT NULL, 
  IDATIVO VARCHAR2(1) DEFAULT 'S' NOT NULL, 
  DTINCLUSAO DATE DEFAULT NULL NULL, 
  CDOPERINCLUSAO VARCHAR2(12) DEFAULT '1' NULL, 
  DTULTATU DATE DEFAULT NULL NULL, 
  NRORGINCLUSAO NUMBER(10) DEFAULT 1 NULL, 
  NRORGULTATU NUMBER(10) DEFAULT 1 NULL, 
  CDOPERULTATU VARCHAR2(12) DEFAULT '1' NULL,
  CONSTRAINT PK_TIPOVOOCONFIGPREF PRIMARY KEY(CDFILIAL, CDCIA, SGPREFIXO, CDEXPTIPOVOO, CDAGRDEL)
)
/
ALTER TABLE TIPOVOOCONFIGPREF ADD CONSTRAINT CKC_IDATIVO_TIPOVOOCONFIGPREF CHECK (IDATIVO IN ('S','N'))
/
CREATE TABLE TIPOVOOCONFIGEQUIP (
  CDFILIAL VARCHAR2(4) NOT NULL, 
  CDCIA VARCHAR2(4) NOT NULL, 
  CDEQUIP VARCHAR2(4) NOT NULL, 
  CDEXPTIPOVOO VARCHAR2(5) NOT NULL, 
  CDAGRDEL VARCHAR2(4) NOT NULL, 
  NRORG NUMBER(10) DEFAULT 1 NOT NULL, 
  IDATIVO VARCHAR2(1) DEFAULT 'S' NOT NULL, 
  DTINCLUSAO DATE DEFAULT NULL NULL, 
  CDOPERINCLUSAO VARCHAR2(12) DEFAULT '1' NULL, 
  DTULTATU DATE DEFAULT NULL NULL, 
  NRORGINCLUSAO NUMBER(10) DEFAULT 1 NULL, 
  NRORGULTATU NUMBER(10) DEFAULT 1 NULL, 
  CDOPERULTATU VARCHAR2(12) DEFAULT '1' NULL,
  CONSTRAINT PK_TIPOVOOCONFIGEQUIP PRIMARY KEY(CDFILIAL, CDCIA, CDEQUIP, CDEXPTIPOVOO, CDAGRDEL)
)
/
ALTER TABLE TIPOVOOCONFIGEQUIP ADD CONSTRAINT CKC_IDATIVO_TIPOVOOCONFIGEQUIP CHECK (IDATIVO IN ('S','N'))