
--Migration_RCCP_20230619_152700.txt
CREATE TABLE [dbo].[CompanyPaymentAccounts] (
    [Id] [bigint] NOT NULL IDENTITY,
    [ServerGuid] [nvarchar](max),
    [CompanyId] [bigint] NOT NULL,
    [Currency] [nvarchar](max),
    [CurrencyBalance] [decimal](18, 2) NOT NULL,
    [FinancialEntityId] [bigint] NOT NULL,
    CONSTRAINT [PK_dbo.CompanyPaymentAccounts] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[CompanyPaymentTransactions] (
    [Id] [bigint] NOT NULL IDENTITY,
    [ServerGuid] [nvarchar](max),
    [CompanyId] [bigint] NOT NULL,
    [FinancialEntityId] [bigint] NOT NULL,
    [TransactionUtcDateTime] [datetime],
    [Amount] [decimal](18, 2) NOT NULL,
    [TransactionNumber] [nvarchar](max),
    [Status] [bigint] NOT NULL,
    [SageType] [bigint] NOT NULL,
    CONSTRAINT [PK_dbo.CompanyPaymentTransactions] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[Credits] (
    [Id] [bigint] NOT NULL IDENTITY,
    [Type] [int] NOT NULL,
    [EntityType] [int] NOT NULL,
    [EntityTypeId] [nvarchar](max),
    [CreatedUtcDateTime] [datetime] NOT NULL,
    CONSTRAINT [PK_dbo.Credits] PRIMARY KEY ([Id])
)
CREATE TABLE [dbo].[CreditConsumptions] (
    [Id] [bigint] NOT NULL IDENTITY,
    [CreditId] [bigint] NOT NULL,
    [EntityType] [int] NOT NULL,
    [EntityTypeId] [nvarchar](max),
    [UtcDateTime] [datetime] NOT NULL,
    CONSTRAINT [PK_dbo.CreditConsumptions] PRIMARY KEY ([Id])
)
ALTER TABLE [dbo].[CompanySupportContractSubscriptions] ADD [ServerGuid] [nvarchar](max)
ALTER TABLE [dbo].[Staffs] ADD [IsActive] [bit]
ALTER TABLE [dbo].[SupportServicePlans] ADD [ServerGuid] [nvarchar](max)
