USE [TryNFeOnline]
GO

ALTER TABLE [dbo].[configuracoes] ADD 
[idnExibirDescontoPorProdutoDANFCe] [bit] NULL
GO
ALTER TABLE [dbo].[emitente] ADD 
[clasEstabelecIndustrialICMS] [varchar] (5) COLLATE Latin1_General_CI_AS NULL
GO
ALTER TABLE [dbo].[OrdemServicoServico] ADD 
[quilometragemProximoServico] [int] NULL,
[dataPrevistaProximoServico] [date] NULL
GO
ALTER TABLE [dbo].[SpedIcmsIdentificacaoItem] ADD 
[numDoctoArrecadacaoEstadual] [varchar] (50) COLLATE Latin1_General_CI_AS NULL
GO
CREATE TABLE [dbo].[SpedIcmsIdentificacaoItens]
(
	[id] [int] IDENTITY (1,1) NOT NULL,
	[idSpedIcmsIdentificacaoItem] [int] NOT NULL,
	[numeroSequencialItem] [int] NULL,
	[codigoItem] [varchar] (60) COLLATE Latin1_General_CI_AS NULL,
	[quantidade] [decimal] (18,4) NULL,
	[unidade] [varchar] (10) COLLATE Latin1_General_CI_AS NULL,
	[valorIcmsOperacao] [decimal] (18,4) NULL,
	[valorIcmsST] [decimal] (18,4) NULL,
	[valorIcmsFrete] [decimal] (18,4) NULL,
	[valorIcmsDifAliquota] [decimal] (18,4) NULL,
	CONSTRAINT [PK_SpedIcmsIdentificacaoItens] PRIMARY KEY CLUSTERED
	(
		[id] ASC
	) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY  = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[SpedIcmsIdentificacaoItens] ADD CONSTRAINT [FK_SpedIcmsIdentificacaoItens_SpedIcmsIdentificacaoItem] FOREIGN KEY
	(
		[idSpedIcmsIdentificacaoItem]
	)
	REFERENCES [dbo].[SpedIcmsIdentificacaoItem]
	(
		[id]
	)
GO
INSERT INTO VERSAO(VERSAO, VERSAOATUALIZACAO, DATAATUALIZACAO) VALUES(404, 662, GETDATE());