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
Describe the bug
Currently, the sequelize schema adds a default uuid (_id) as a primary key to the model. In case the user provides a database for introspection and the tables have already a primary key, there will be a conflict between that primary key and the _id we are trying to add to the schema.
We need to keep both ids though, since Conduit uses the _id for any queries related to that model.
One possible solution would be to change the _id from primary key to virtual, however sequelize currently doesn't support converting the virtual datatype into the sql equivalent (see sequelize/sequelize#12451).
To Reproduce
Start the database module with an existing database connection in the envs
Notice that the database won't sync because of the virtual field is not defined.
Expected Behavior
The database module should introspect the db by keeping both it's already defined primary key and adding the conduit _id used for future queries.
The text was updated successfully, but these errors were encountered:
Describe the bug
Currently, the sequelize schema adds a default uuid (_id) as a primary key to the model. In case the user provides a database for introspection and the tables have already a primary key, there will be a conflict between that primary key and the _id we are trying to add to the schema.
We need to keep both ids though, since Conduit uses the _id for any queries related to that model.
One possible solution would be to change the _id from primary key to virtual, however sequelize currently doesn't support converting the virtual datatype into the sql equivalent (see sequelize/sequelize#12451).
To Reproduce
Expected Behavior
The database module should introspect the db by keeping both it's already defined primary key and adding the conduit _id used for future queries.
The text was updated successfully, but these errors were encountered: