CREATE TABLE [dbo].[AccountTransactions] (
    [AccountTransactionId]     BIGINT          IDENTITY (1, 1) NOT NULL,
    [AccountId]                BIGINT          NOT NULL,
    [UserId]                   BIGINT          NOT NULL,
    [AccountTransactionDate]   DATETIME2 (7)   NOT NULL,
    [AccountTransactionTypeId] SMALLINT        NOT NULL,
    [Symbol]                   NVARCHAR (10)   NULL,
    [Amount]                   DECIMAL (22, 8) NOT NULL,
    [AmountUSD]                DECIMAL (22, 8) NULL,
    [ExternalReferenceId]      VARCHAR (66)    NULL,
    [Comment]                  NVARCHAR (2000) NULL,
    [Origin]                   NVARCHAR (256)  NULL,
    [CurrentBalance]           DECIMAL (22, 8) NULL,
    [CurrentBonusBalance]      DECIMAL (22, 8) NULL,
    [OperatorId]               INT             NULL,
    [WalletAddress]            VARCHAR (100)   NULL,
    [PendingId]                BIGINT          NULL,
    [KnokId]					BIGINT			NULL, 
    CONSTRAINT [PK_AccountTransactions] PRIMARY KEY CLUSTERED ([AccountTransactionId] ASC),
	CONSTRAINT [FK_AccountTransactions_Signals] FOREIGN KEY (KnokId) REFERENCES [dbo].[Signals] ([KnokId]),
);

