-
-
Notifications
You must be signed in to change notification settings - Fork 256
Non zero integer ID column #382
Copy link
Copy link
Open
Labels
proposalA suggestion for a change, feature, enhancement, etcA suggestion for a change, feature, enhancement, etc
Description
Description
If I Create a model with a valid uuid id, Pop creates the model with the id given. However, if I Create a model with a non-zero (or valid) integer id, Pop ignores the id completely. This restricts me from implementing the common polymorphism pattern (Where I use same integer for id field in two or more tables)
Steps to Reproduce the Problem
- Model with a integer ID field
- model := Model{}
- model.ID = nonzero
- db.Create(&model)
Expected Behavior
Pop creates the model with the given id
Actual Behavior
Pop ignores the given id
Here's the SQL statement in the log:
INSERT INTO posts (created_at, updated_at, user_id) VALUES (:created_at, :updated_at, :user_id) returning id
Info
Latest (v4.11.0) pop
Postgresql
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
proposalA suggestion for a change, feature, enhancement, etcA suggestion for a change, feature, enhancement, etc