CREATE TABLE scav_registro_diario_empresa ( id int(11) AUTO_INCREMENT NOT NULL, id_parque int(11) NOT NULL, id_empresa int(11) NOT NULL, fecha date NOT NULL, autorizados int(11) NOT NULL DEFAULT 0, descargados int(11) NOT NULL DEFAULT 0, accesos int(11) NOT NULL DEFAULT 0, personas int(11) NOT NULL DEFAULT 0, usuarios int(11) NOT NULL DEFAULT 0, PRIMARY KEY (id), UNIQUE KEY (id_parque, id_empresa, fecha) ); CREATE TABLE scav_registro_diario_parque ( id int(11) AUTO_INCREMENT NOT NULL, id_parque int(11) NOT NULL, fecha date NOT NULL, negaciones int(11) NOT NULL DEFAULT 0, PRIMARY KEY (id), UNIQUE KEY (id_parque, fecha) ); -- Estancia CREATE TABLE scav_registro_diario ( id int(11) AUTO_INCREMENT NOT NULL, id_parque int(11) NOT NULL, id_empresa int(11) NOT NULL, fecha date NOT NULL, autorizados int(11) NOT NULL DEFAULT 0, descargados_1 int(11) NOT NULL DEFAULT 0, descargados_2 int(11) NOT NULL DEFAULT 0, accesos int(11) NOT NULL DEFAULT 0, personas int(11) NOT NULL DEFAULT 0, usuarios int(11) NOT NULL DEFAULT 0, PRIMARY KEY (id) ); ALTER TABLE scav_retiro_autorizados ADD estado int(10) DEFAULT 0; -- Control Sincronizadores Integrador ALTER TABLE usuarios ADD UNIQUE (idusuario) CREATE TABLE integradores_parques( id INT NOT NULL AUTO_INCREMENT, id_usuario INT(11) NOT NULL, parques VARCHAR(20) NOT NULL, dbnombre VARCHAR(45) NOT NULL, PRIMARY KEY (id) CONSTRAINT FK_integradorParque FOREIGN KEY (id_usuario) REFERENCES usuarios(idusuario)); ALTER TABLE usuarios ADD es_integrador TINYINT(4) NOT NULL;