/*TABLA EQU_CICLOHOROMETRO*/
if not exists(select * FROM INFORMATION_SCHEMA.TABLES  where Table_Name='equ_cicloHorometro' )
EXEC _ini_creartabla 'equ_cicloHorometro', 1
go


/*EQU_CICLOHOROMETRO*/

if not exists(select * FROM INFORMATION_SCHEMA.COLUMNS  where Table_Name='equ_cicloHorometro' and column_name = 'id_equipo' )
begin
alter table [equ_cicloHorometro] add [id_equipo] int  NOT NULL DEFAULT 0
end
if not exists(select * FROM INFORMATION_SCHEMA.COLUMNS  where Table_Name='equ_cicloHorometro' and column_name = 'horometroInicial' )
begin
alter table [equ_cicloHorometro] add [horometroInicial] float  NOT NULL DEFAULT 0
end
if not exists(select * FROM INFORMATION_SCHEMA.COLUMNS  where Table_Name='equ_cicloHorometro' and column_name = 'horometroFinal' )
begin
alter table [equ_cicloHorometro] add [horometroFinal] float  NOT NULL DEFAULT 0
end
if not exists(select * FROM INFORMATION_SCHEMA.COLUMNS  where Table_Name='equ_cicloHorometro' and column_name = 'afectarProyeccion' )
begin
alter table [equ_cicloHorometro] add [afectarProyeccion] bit  NOT NULL DEFAULT 0
end
if not exists(select * FROM INFORMATION_SCHEMA.COLUMNS  where Table_Name='equ_cicloHorometro' and column_name = 'reparacionMayor' )
begin
alter table [equ_cicloHorometro] add [reparacionMayor] bit  NOT NULL DEFAULT 0
end
if not exists(select * FROM INFORMATION_SCHEMA.COLUMNS  where Table_Name='equ_cicloHorometro' and column_name = 'reiniciarHorometro' )
begin
alter table [equ_cicloHorometro] add [reiniciarHorometro] bit  NOT NULL DEFAULT 0
end
if not exists(select * FROM INFORMATION_SCHEMA.COLUMNS  where Table_Name='equ_cicloHorometro' and column_name = 'Nciclo' )
begin
alter table [equ_cicloHorometro] add [Nciclo] int  NOT NULL DEFAULT 0
end



/*EQU_TRAZABILIDAD*/
if not exists(select * FROM INFORMATION_SCHEMA.COLUMNS  where Table_Name='equ_trazabilidad' and column_name = 'id_cicloHorometro' )
begin
alter table [equ_trazabilidad] add [id_cicloHorometro] int  NOT NULL DEFAULT 0
end
