
[dbo].[XLedgerCustomerPaymentTerms]
CREATE TABLE [dbo].[XLedgerCustomerPaymentTerms]
(
[XLedgerCustomerPaymentTermsId] [int] NOT NULL IDENTITY(1, 1),
[ExternalDbId] [bigint] NOT NULL,
[AccountingCustomerPaymentTermsFid] [int] NOT NULL,
[CreatedOn] [datetimeoffset] NOT NULL,
[LastImportedOn] [datetimeoffset] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XLedgerCustomerPaymentTerms] ADD CONSTRAINT [PK_XLedgerCustomerPaymentTerms] PRIMARY KEY NONCLUSTERED ([XLedgerCustomerPaymentTermsId]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XLedgerCustomerPaymentTerms] ADD CONSTRAINT [IX_XLedgerCustomerPaymentTerms_ExternalDbId] UNIQUE CLUSTERED ([ExternalDbId]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[XLedgerCustomerPaymentTerms] ADD CONSTRAINT [FK_XLedgerCustomerPaymentTerms_AccountingCustomerPaymentTerms] FOREIGN KEY ([AccountingCustomerPaymentTermsFid]) REFERENCES [dbo].[AccountingCustomerPaymentTerms] ([AccountingCustomerPaymentTermsId])
GO
GRANT SELECT ON [dbo].[XLedgerCustomerPaymentTerms] TO [MssExec]
GRANT INSERT ON [dbo].[XLedgerCustomerPaymentTerms] TO [MssExec]
GRANT DELETE ON [dbo].[XLedgerCustomerPaymentTerms] TO [MssExec]
GRANT UPDATE ON [dbo].[XLedgerCustomerPaymentTerms] TO [MssExec]
GO