if not exists (select * from sys.sysobjects where id = object_id(N'dbo.PamResetPasswordSchedule'))
begin
    create table dbo.PamResetPasswordSchedule(
        ID uniqueidentifier NOT NULL,
        CredentialID uniqueidentifier NOT NULL constraint FK_PamResetPasswordSchedule_CredentialID foreign key references dbo.PamCredential(ID),
        Active bit NOT NULL constraint DF_PamResetPasswordSchedule_Active default(0),
        Frequency int NULL,
        FrequencyUnit int NULL,
        AtDateTime DateTime2 NULL,
        LastResetDateTime DateTime2 NULL,
        NextResetDateTime DateTime2 NULL,
        constraint PK_PamResetPasswordSchedule primary key clustered (ID)
    );
end;