question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

problem with db.sync()

See original GitHub issue

error: Uncaught (in promise) SqliteError: index email already exists

I have a subscriptions table with email as a field.

Using db.sync() causes this error. I’m not sure if I need it. It appears to work without it, but I’m not sure.

Can someone clarify the point of db.sync()

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:18

github_iconTop GitHub Comments

1reaction
slim-hmidicommented, Jan 7, 2022

I have the same issue, db.sync() throws an error when drop set to false.

0reactions
slim-hmidicommented, Jan 9, 2022

I created a migration file to accomplish my task (it’s not clean but it does the work) and I think that the sync method is overengineering and contains a lot of logic that makes things not easy to do. It is better to rethink the design of this function to not contain a lot of details in the background. And the migrations can be simple enough by creating a cli like knex, one for up and the other for down, and user will trigger them manually whenever he needs to update the database.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot SQL Data Sync - Azure SQL Database
Cause. The SQL Data Sync provisioning process uses the same tracking tables for tables that have the same name but are in different...
Read more >
How to overcome issue when Xray online DB Sync fails with ...
XRAY – How to overcome issue when Xray online DB Sync fails with 401? ... The below log entry is logged in the...
Read more >
Database error - Sync
This problem may be caused by Sync shutting down incorrectly which, in its turn, can be the result of a system/application crash or...
Read more >
Sequelize model.sync() is throwing an error - Stack Overflow
So the problem here was with the Data type of phone. As you can see DataType.NUMBER does not change into INTEGER in the...
Read more >
Getting error while doing Database Sync
Hi,. Getting the below error while doing full db sync. Have done a full build with reference package and it has passed without...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found