Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

insert entity with defined primary key #34

Closed
albertborsos opened this issue Sep 24, 2019 · 1 comment
Closed

insert entity with defined primary key #34

albertborsos opened this issue Sep 24, 2019 · 1 comment

Comments

@albertborsos
Copy link
Contributor

albertborsos commented Sep 24, 2019

I would like to insert an entity with a primary key which already set.

albertborsos/yii2-ddd@d902852#diff-ae9027ddfeba092d21397ff138998d33R35

When the insert runs it overrides the primary key.

Which is a problem when I would like to migrate an old database to a new structure, but with the old primary keys.

I tried to override the nextPrimaryKey method in the Mapper class, but I cannot reach the current value of the entity in the Mapper.

@albertborsos
Copy link
Contributor Author

Sorry, in the debugging process I forgot this problem occurs only with composer's --prefer-lowest option. So it will be a dependency issue, I just have to find which one needs an update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant