/* Ruleta Nexora V1.6.0 - Network Identity */
IF OBJECT_ID(N'[dbo].[NEXORA_ROULETTE_SOCIAL_PROFILES]', N'U') IS NULL
BEGIN
    CREATE TABLE [dbo].[NEXORA_ROULETTE_SOCIAL_PROFILES](
        [account_username] varchar(50) NOT NULL PRIMARY KEY,
        [user_id] int NULL,
        [display_name] nvarchar(32) NOT NULL,
        [locked] bit NOT NULL CONSTRAINT [DF_NRSP_locked] DEFAULT(0),
        [moderation_note] nvarchar(250) NULL,
        [created_at] datetime2 NOT NULL CONSTRAINT [DF_NRSP_created] DEFAULT(SYSUTCDATETIME()),
        [updated_at] datetime2 NOT NULL CONSTRAINT [DF_NRSP_updated] DEFAULT(SYSUTCDATETIME())
    );
    CREATE INDEX [IX_NRSP_display] ON [dbo].[NEXORA_ROULETTE_SOCIAL_PROFILES]([display_name]);
    CREATE INDEX [IX_NRSP_updated] ON [dbo].[NEXORA_ROULETTE_SOCIAL_PROFILES]([updated_at] DESC);
END;
