You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was checking out the related tutorial for this and found an error in the migration:
add_index :users, :token
This doesn't make sense as indexing foreign keys can only happen between two different tables. You would not index a column to a table to which it already belongs. In other words, you'd only do something like this if Token was a separate table.
If you switch your db to postgres you'll get an error while trying to migrate:
PG::UndefinedTable: ERROR: relation "users" does not exist
: CREATE INDEX "index_users_on_token" ON "users" ("token")
The reason it work in SQLite is because SQLite basically ignores foreign keys.
The text was updated successfully, but these errors were encountered:
I was checking out the related tutorial for this and found an error in the migration:
This doesn't make sense as indexing foreign keys can only happen between two different tables. You would not index a column to a table to which it already belongs. In other words, you'd only do something like this if Token was a separate table.
If you switch your db to postgres you'll get an error while trying to migrate:
The reason it work in SQLite is because SQLite basically ignores foreign keys.
The text was updated successfully, but these errors were encountered: