
/******************** MYSQL ***********************/

Flávio Júnior
ALTER TABLE usuario ADD COLUMN ultimoacessoportal DATE NULL DEFAULT NULL  AFTER ldap ;

CREATE  TABLE categoriapost (
  idcategoriapost INT NOT NULL ,
  idcategoriapostPai INT NULL ,
  nomecategoria VARCHAR(255) NULL ,
  datainicio DATE NULL ,
  datafim DATE NULL ,
  PRIMARY KEY (idcategoriapost) )
ENGINE = InnoDB;

CREATE  TABLE post (
  idPost INT NOT NULL AUTO_INCREMENT ,
  titulo VARCHAR(255) NULL ,
  descricao TEXT NULL ,
  conteudo TEXT NULL ,
  imagem VARCHAR(255) NULL ,
  idCategoriaPost INT NULL ,
  dataInicio DATE NULL ,
  dataFim DATE NULL ,
  PRIMARY KEY (idPost) ,
  INDEX fk_post_1_idx (idCategoriaPost ASC) ,
  CONSTRAINT fk_post_1
    FOREIGN KEY (idCategoriaPost)
    REFERENCES categoriapost (idcategoriapost)
    ON DELETE NO ACTION
    ON UPDATE NO ACTION)
ENGINE = InnoDB;


ALTER TABLE logdados ADD COLUMN datalog TIMESTAMP NULL  DEFAULT NULL ;

*thays.araujo
ALTER TABLE baseconhecimento ADD COLUMN fontereferencia VARCHAR(255) ;




/******************* ORACLE ************************/

CREATE TABLE CATEGORIAPOST(
	IDCATEGORIAPOST INT NOT NULL,
	IDCATEGORIAPOSTPAI INT DEFAULT NULL,
	NOMECATEGORIA VARCHAR2 (255) DEFAULT 'NULL',
	DATAINICIO DATE,
	DATAFIM DATE DEFAULT NULL,
	PRIMARY KEY (IDCATEGORIAPOST)
);

CREATE TABLE POST(
	IDPOST INT NOT NULL,
	TITULO VARCHAR2 (255) NOT NULL,
	DESCRICAO CLOB DEFAULT NULL,
	CONTEUDO CLOB DEFAULT NULL,
	IMAGEM VARCHAR2 (255) DEFAULT NULL,
	IDCATEGORIAPOST INT DEFAULT NULL,
	DATAINICIO DATE,
	DATAFIM DATE DEFAULT NULL,
	PRIMARY KEY (IDPOST)
);

ALTER TABLE POST ADD CONSTRAINT FK_POST_1 FOREIGN KEY (IDCATEGORIAPOST) REFERENCES CATEGORIAPOST(IDCATEGORIAPOST);

* cleison.ferreira 27/10 ** ORACLE
ALTER TABLE PORTAL MODIFY HORA TIMESTAMP;

* cleison.ferreira 27/10 ** MYSQL
ALTER TABLE `portal` CHANGE COLUMN `hora` `hora` TIMESTAMP NULL DEFAULT NULL  ;

* flavio.santana 27/10 ** MYSQL
ALTER TABLE `opiniao` CHANGE COLUMN `hora` `hora` TIMESTAMP NULL DEFAULT NULL;

* flavio.santana 27/10 ** ORACLE
ALTER TABLE OPINIAO MODIFY HORA TIMESTAMP;


* flavio.santana 05/11 ** ORACLE
CREATE TABLE CONTADORACESSO(
   IDCONTADORACESSO     INT NOT NULL,
   IDUSUARIO            INT,
   IDBASECONHECIMENTO   INT,
   DATAHORAACESSO       TIMESTAMP ,
   CONTADORACESSO       INT,
   PRIMARY KEY (IDCONTADORACESSO) 
);

*Thays.araujo
ALTER TABLE BASECONHECIMENTO ADD  (FONTEREFERENCIA VARCHAR(255)) ;

/******************** MYSQL ***********************/

ALTER TABLE empregados ADD RAMAL VARCHAR(5) ;
ALTER TABLE contatosolicitacaoservico ADD RAMAL VARCHAR(5) ;


/******************* ORACLE ************************/


ALTER TABLE EMPREGADOS ADD (RAMAL VARCHAR(5) );
ALTER TABLE CONTATOSOLICITACAOSERVICO ADD (RAMAL VARCHAR(5) );
ALTER TABLE LOGDADOS ADD DATALOG TIMESTAMP;

===============================

/* DINAMIC VIEWS */
