mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-31 00:16:47 +01:00
chore: default the data migration flag for createdbyuserid to false (#6048)
## About the changes Sets data migration of features and events created_by_user_id to disabled by default Map to promise and await all in created by user id migration for features
This commit is contained in:
parent
ce219f1b74
commit
e652af49af
@ -79,7 +79,7 @@ exports[`should create default config 1`] = `
|
||||
"caseInsensitiveInOperators": false,
|
||||
"celebrateUnleash": false,
|
||||
"changeRequestConflictHandling": false,
|
||||
"createdByUserIdDataMigration": true,
|
||||
"createdByUserIdDataMigration": false,
|
||||
"customRootRolesKillSwitch": false,
|
||||
"demo": false,
|
||||
"detectSegmentUsageInChangeRequests": false,
|
||||
|
@ -746,15 +746,17 @@ export default class FeatureToggleStore implements IFeatureToggleStore {
|
||||
.limit(batchSize)
|
||||
.select(['f.*', 'ev.created_by', 'u.id', 't.username']);
|
||||
|
||||
toUpdate
|
||||
const updatePromises = toUpdate
|
||||
.filter((row) => row.id || row.username)
|
||||
.forEach(async (row) => {
|
||||
.map((row) => {
|
||||
const id = row.id || ADMIN_TOKEN_USER.id;
|
||||
|
||||
await this.db(TABLE)
|
||||
return this.db(TABLE)
|
||||
.update({ created_by_user_id: id })
|
||||
.where({ name: row.name });
|
||||
});
|
||||
|
||||
await Promise.all(updatePromises);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -225,7 +225,7 @@ const flags: IFlags = {
|
||||
},
|
||||
createdByUserIdDataMigration: parseEnvVarBoolean(
|
||||
process.env.CREATED_BY_USERID_DATA_MIGRATION,
|
||||
true,
|
||||
false,
|
||||
),
|
||||
};
|
||||
|
||||
|
@ -27,6 +27,7 @@ export function createTestConfig(config?: IUnleashOptions): IUnleashConfig {
|
||||
flags: {
|
||||
embedProxy: true,
|
||||
embedProxyFrontend: true,
|
||||
createdByUserIdDataMigration: true,
|
||||
},
|
||||
},
|
||||
publicFolder: path.join(__dirname, '../examples'),
|
||||
|
Loading…
Reference in New Issue
Block a user