1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-07-26 13:48:33 +02:00

chore: Renames login_events to sign_on_log (#3203)

This makes the distinction from the event services clearer.

In enterprise we'll also rename LoginEventService etc to reflect this
rename.

In addition this adds a setting for how long of a retention one should have, defaulting to 336 hours (2 weeks)
This commit is contained in:
Christopher Kolstad 2023-02-27 15:42:13 +01:00 committed by GitHub
parent 7a52552485
commit 0a67cfed67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 1 deletions

View File

@ -0,0 +1,7 @@
exports.up = function (db, cb) {
db.runSql(`ALTER TABLE login_events RENAME TO sign_on_log`, cb);
};
exports.down = function (db, cb) {
db.runSql(`ALTER TABLE sign_on_log RENAME TO login_events`, cb);
};

View File

@ -0,0 +1,10 @@
exports.up = function (db, cb) {
db.runSql(
`INSERT INTO settings(name, content) VALUES ('sign_on_log_retention', '{"hours": 336}')`,
cb,
);
};
exports.down = function (db, cb) {
db.runSql(`DELETE FROM settings WHERE name = 'sign_on_log_retention'`, cb);
};

View File

@ -48,7 +48,7 @@ test('should getAll', async () => {
await stores.settingStore.insert('unleash.custom.2', { b: 'hello' });
await stores.settingStore.insert('unleash.custom.3', { b: 'hello' });
const ret = await stores.settingStore.getAll();
expect(ret).toHaveLength(5);
expect(ret).toHaveLength(6);
});
test('should exists', async () => {