USE [TryNFeOnline]
GO

ALTER TABLE [dbo].[ServicoContratoRestricao] DROP CONSTRAINT [FK_ServicoContratoRestricao_ServicoContrato]
GO
ALTER TABLE [dbo].[FaturaParcela] ADD 
[idNotaFiscalFaturamento] [int] NULL
GO
ALTER TABLE [dbo].[ServicoContratoRestricao] ALTER COLUMN [idServicoContrato] [int] NULL
GO
ALTER TABLE [dbo].[ServicoContratoRestricao] ADD 
[idGrupoServico] [int] NULL
GO
ALTER TABLE [dbo].[FaturaParcela] ADD CONSTRAINT [FK_FaturaParcela_notafiscal] FOREIGN KEY
	(
		[idNotaFiscalFaturamento]
	)
	REFERENCES [dbo].[notafiscal]
	(
		[id]
	)
GO
ALTER TABLE [dbo].[ServicoContratoRestricao] ADD CONSTRAINT [FK_ServicoContratoRestricao_ServicoContrato] FOREIGN KEY
	(
		[idServicoContrato]
	)
	REFERENCES [dbo].[ServicoContrato]
	(
		[id]
	)
GO
ALTER TABLE [dbo].[ServicoContratoRestricao] ADD CONSTRAINT [FK_ServicoContratoRestricao_GrupoServico] FOREIGN KEY
	(
		[idGrupoServico]
	)
	REFERENCES [dbo].[GrupoServico]
	(
		[id]
	)
GO
INSERT INTO VERSAO(VERSAO, VERSAOATUALIZACAO, DATAATUALIZACAO, REVISAO) VALUES(554, 812, GETDATE(),1);