Pkey violates unique constraint after Seed

After i add data to the DB with some data and i try to do an insert, i get the error: duplicate key value violates unique constraint "users_pkey". I can get around it by
await db.execute(sql.raw(
            `ALTER SEQUENCE users_id_seq RESTART WITH ${Math.max(...users.map(u => u.id)) + 1}`
        ));
but i was wondering if there was something im doing wrong when inserting?

I dont use seed and have a script that runs and inserts data to the db, basicalli make to db connections. Not sure if that affects it
Was this page helpful?