diff options
| author | Adam Soltys <[email protected]> | 2024-01-09 20:34:00 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-01-09 23:10:39 -0800 |
| commit | e06878e18fc33e392fd16b76d1ab9f25f8bc7fbe (patch) | |
| tree | 14c3e0975aa059ac0caed761a4b340392d009c09 | |
| parent | 9eb6a95a24aab240dcfd6a62f9f0883e3c07013e (diff) | |
| download | coinos-server-e06878e18fc33e392fd16b76d1ab9f25f8bc7fbe.tar.gz coinos-server-e06878e18fc33e392fd16b76d1ab9f25f8bc7fbe.zip | |
check for existing migration
| -rw-r--r-- | lib/migrate.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/migrate.js b/lib/migrate.js index 49207902..7ff13649 100644 --- a/lib/migrate.js +++ b/lib/migrate.js @@ -8,7 +8,13 @@ async function migrate(id) { let user = await ga(`user:${id}`); if (typeof user === "string") { + if (await g(`user:${user}`)) { + warn("user already migrated", id); + s(`user:${id}`, user); + } + id = user; + user = await ga(`user:${id}`); } @@ -51,7 +57,7 @@ async function migrate(id) { multi = await multi .lPush(`${id}:invoices`, iid) .set(`invoice:${iid}`, JSON.stringify(inv)); - }) + }), ); try { |
