CREATE TABLE [dbo].[{TABLE_NAME}](
    [id] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY,
    [referral_username] [varchar](10) NOT NULL,
    [referral_character] [varchar](10) NOT NULL,
    [referred_username] [varchar](10) NOT NULL,
    [referred_character] [varchar](10) NULL,
    [referred_registration_date] [datetime] NOT NULL CONSTRAINT [DF_{TABLE_NAME}_registration] DEFAULT (GETDATE()),
    [referred_last_check] [datetime] NULL,
    [referred_complete_date] [datetime] NULL,
    [rewarded_date] [datetime] NULL,
    [referred_ip] [varchar](45) NULL,
    [status] [tinyint] NOT NULL CONSTRAINT [DF_{TABLE_NAME}_status] DEFAULT ((2))
);
CREATE UNIQUE INDEX [UX_{TABLE_NAME}_referred_username] ON [dbo].[{TABLE_NAME}] ([referred_username]);
CREATE INDEX [IX_{TABLE_NAME}_status] ON [dbo].[{TABLE_NAME}] ([status]);
