CREATE TABLE [dbo].[{TABLE_NAME}](
    [id] [int] IDENTITY(1,1) NOT NULL,
    [code_id] [int] NOT NULL,
    [date_redeemed] [datetime] NOT NULL,
    [ip_address] [varchar](45) NOT NULL,
    [user_identifier] [varchar](100) NOT NULL,
    [account_username] [varchar](50) NULL,
    CONSTRAINT [PK_{TABLE_NAME}] PRIMARY KEY CLUSTERED ([id] ASC)
);
CREATE NONCLUSTERED INDEX [IX_{TABLE_NAME}_code_account] ON [dbo].[{TABLE_NAME}] ([code_id], [account_username]);
CREATE NONCLUSTERED INDEX [IX_{TABLE_NAME}_code_ip] ON [dbo].[{TABLE_NAME}] ([code_id], [ip_address]);
