IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'syn_tipoAutenticacion')
BEGIN
	EXEC [dbo].[_ini_creartabla] 'syn_tipoAutenticacion', 0	
END
GO

IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'syn_sistemaIntegrar' AND COLUMN_NAME = 'urlAutenticar')
BEGIN
	ALTER TABLE [syn_sistemaIntegrar]
	ADD [urlAutenticar] VARCHAR(800)
END
GO

IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'syn_sistemaIntegrar' AND COLUMN_NAME = 'id_tipoAutenticacion')
BEGIN
	ALTER TABLE [syn_sistemaIntegrar]
	ADD [id_tipoAutenticacion] INT 
	DEFAULT 0 NOT NULL
	FOREIGN KEY ([id_tipoAutenticacion]) REFERENCES [syn_tipoAutenticacion](id)
END
GO

IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'syn_sistemaIntegrar' AND COLUMN_NAME = 'token')
BEGIN
	ALTER TABLE [syn_sistemaIntegrar]
	ADD [token] VARCHAR(8000)
END
GO

IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'syn_sistemaIntegrar' AND COLUMN_NAME = 'metodoAutenticar')
BEGIN
	ALTER TABLE [syn_sistemaIntegrar]
	ADD [metodoAutenticar] VARCHAR(100)
END
GO

IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'syn_sistemaIntegrar' AND COLUMN_NAME = 'estructuraResponseAutenticar')
BEGIN
	ALTER TABLE [syn_sistemaIntegrar]
	ADD [estructuraResponseAutenticar] VARCHAR(MAX)
END
GO

IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'syn_puntoIntegracion' AND COLUMN_NAME = 'metodo')
BEGIN
	ALTER TABLE [syn_puntoIntegracion]
	ADD [metodo] VARCHAR(100)
END
GO
