Skip to content

Commit

Permalink
Updated migration js script for aliases in favorites (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
stankis authored Jan 20, 2024
1 parent d21361e commit 40a2fe2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/db/scripts/update-alias-favorites.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ import {db} from '../index';
for (const entry of favorites.rows) {
const {entry_id, tenant_id, login, alias, display_alias} = entry;

if (display_alias === null || alias.toLowerCase() !== display_alias.toLowerCase()) {
if (
display_alias === null ||
alias !== alias.toLowerCase() ||
alias.toLowerCase() !== display_alias.toLowerCase()
) {
await db.primary
.table('favorites')
.update({alias: alias.toLowerCase(), display_alias: alias})
Expand Down

0 comments on commit 40a2fe2

Please sign in to comment.