if not exists (select * from sys.tables where object_id = object_id(N'dbo.LoginHistory'))
    create table dbo.LoginHistory
    (
        UserName nvarchar(256) not null
        ,CreationDate datetime not null constraint DF_LoginHistory_CreationDate DEFAULT getdate()
        ,LastUpdateDate datetime not null constraint DF_LoginHistory_LastUpdateDate DEFAULT getdate()
        ,TokenExpirationDate datetime null
        ,Token nvarchar(256) null
        ,TokenInfo nvarchar(max) null
        ,Platform int null
        ,Source int null
        ,constraint PK_LoginHistory primary key (UserName, CreationDate desc)
    )