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

feat: overriding system value for PostgreSQL's identity column #183

Merged
merged 4 commits into from
May 25, 2024

Conversation

amakmurr
Copy link
Contributor

@amakmurr amakmurr commented Feb 6, 2024

Add OVERRIDING SYSTEM VALUE insert clause when using PostgreSQL with version >= 10 dialect. It's necessary for table with always generated identity column also as primary key. By default those column must be always generated by PostgreSQL, but in this fixtures mostly case we want to define ourself id especially when declaring the relationship between fixtures.

This PR will allow you to force define value for column that has been made with such as statement id BIGSERIAL GENERATED ALWAYS AS IDENTITY PRIMARY KEY

Reference:

Copy link
Contributor

@andreynering andreynering left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @amakmurr,

The CI failed because of an out-of-date dependency. I just updated it in master.

Locally, I noticed that tests for MySQL broke with you change. Can you rebase with master and fix the issue?

postgresql.go Outdated Show resolved Hide resolved
postgresql.go Outdated Show resolved Hide resolved
postgresql.go Outdated Show resolved Hide resolved
@amakmurr
Copy link
Contributor Author

Hi @andreynering ,
I am just updating this PR and apply your suggestion. Also has been run the unit test for mysql in my local machine and it's works now. Please kindly take another look.

Thank you.

@andreynering andreynering merged commit e867d65 into go-testfixtures:master May 25, 2024
@andreynering
Copy link
Contributor

Thanks @amakmurr!

I did some very simple improvements at b6a9478.

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

Successfully merging this pull request may close these issues.

2 participants