fix trying to updates visits with user_id when there are no visits to update
This commit is contained in:
parent
ebbf4b6a28
commit
f6a8d7a325
@ -20,8 +20,11 @@ async function up(knex) {
|
||||
});
|
||||
|
||||
const [{ count }] = await knex("visits").count("* as count");
|
||||
|
||||
if (count < 1_000_000) {
|
||||
|
||||
const count_number = parseInt(count);
|
||||
if (Number.isNaN(count_number) || count_number === 0) return;
|
||||
|
||||
if (count_number < 1_000_000) {
|
||||
const last_visit = await knex("visits").orderBy("id", "desc").first();
|
||||
|
||||
const size = 100_000;
|
||||
|
Loading…
x
Reference in New Issue
Block a user