Merge pull request #2261 from bluewave-labs/fix/settings-migration

fix: add migration for settings doc
This commit is contained in:
Alexander Holliday
2025-05-13 13:18:59 -07:00
committed by GitHub
3 changed files with 8 additions and 1 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ const SettingsAbout = () => {
<Typography component="h1">{t("settingsAbout")}</Typography>
</Box>
<Box>
<Typography component="h2">Checkmate {2.0}</Typography>
<Typography component="h2">Checkmate {2.1}</Typography>
<Typography sx={{ mt: theme.spacing(2), mb: theme.spacing(6), opacity: 0.6 }}>
{t("settingsDevelopedBy")}
</Typography>
+4
View File
@@ -34,6 +34,10 @@ const AppSettingsSchema = mongoose.Schema(
unique: true,
default: true,
},
version: {
type: Number,
default: 1,
},
},
{
timestamps: true,
+3
View File
@@ -59,6 +59,9 @@ class SettingsService {
}
async getDBSettings() {
// Remove any old settings
await this.appSettings.deleteMany({ version: { $exists: false } });
let settings = await this.appSettings
.findOne({ singleton: true })
.select("-__v -_id -createdAt -updatedAt -singleton")