Skip to content

Commit

Permalink
fix trying to updates visits with user_id when there are no visits to…
Browse files Browse the repository at this point in the history
… update
  • Loading branch information
poeti8 committed Jan 9, 2025
1 parent ebbf4b6 commit f6a8d7a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions server/migrations/20241223103044_visits_user_id.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f6a8d7a

Please sign in to comment.