mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-21 22:59:07 +00:00
34 lines
975 B
TypeScript
34 lines
975 B
TypeScript
import DataMigrationBase from "./DataMigrationBase";
|
|
import ObjectID from "Common/Types/ObjectID";
|
|
import GlobalConfigService from "Common/Server/Services/GlobalConfigService";
|
|
import GlobalConfig, {
|
|
EmailServerType,
|
|
} from "Common/Models/DatabaseModels/GlobalConfig";
|
|
|
|
export default class AddDefaultGlobalConfig extends DataMigrationBase {
|
|
public constructor() {
|
|
super("AddDefaultGlobalConfig");
|
|
}
|
|
|
|
public override async migrate(): Promise<void> {
|
|
// get all the users with email isVerified true.
|
|
|
|
const globalConfig: GlobalConfig = new GlobalConfig();
|
|
globalConfig.id = ObjectID.getZeroObjectID();
|
|
globalConfig.emailServerType = EmailServerType.Internal;
|
|
globalConfig.sendgridFromName = "OneUptime";
|
|
globalConfig.smtpFromName = "OneUptime";
|
|
|
|
await GlobalConfigService.create({
|
|
data: globalConfig,
|
|
props: {
|
|
isRoot: true,
|
|
},
|
|
});
|
|
}
|
|
|
|
public override async rollback(): Promise<void> {
|
|
return;
|
|
}
|
|
}
|