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

[WIP] Add NOT NULL constraints to repository #978

Closed
wants to merge 1 commit into from

Conversation

ethantkoenig
Copy link
Member

@ethantkoenig ethantkoenig commented Feb 19, 2017

#962

I'm having trouble with my migration; right now, it does not actually add NOT NULL constraints to the existing columns of the repository table. If someone who knows what they're doing could point me in the right direction, I would appreciate it! 😄

I've tested locally using Postgres 9.5.5

return err
}

if err := sess.Sync2(new(RepoV17)); err != nil {
Copy link
Member Author

Choose a reason for hiding this comment

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

I had assumed that calling Sync2(..) would add the new NOT NULL constraints to the table, but it doesn't seem to be working.

Copy link
Member

Choose a reason for hiding this comment

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

No. It will not.

Copy link
Member Author

@ethantkoenig ethantkoenig Feb 19, 2017

Choose a reason for hiding this comment

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

So what should I do?

Copy link
Member

Choose a reason for hiding this comment

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

I think you have to write SQL yourself.

@ethantkoenig ethantkoenig changed the title Add NOT NULL constraints to repository [WIP] Add NOT NULL constraints to repository Feb 19, 2017
@lunny lunny added this to the 1.2.0 milestone Feb 19, 2017
@lunny lunny added the type/enhancement An improvement of existing functionality label Feb 19, 2017
@ethantkoenig
Copy link
Member Author

This will be more annoying than I had initially thought, since SQLite and TiDB don't support adding constraints to existing columns. I'll put this on hold for now.

@tboerger tboerger added lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. reviewed/invalid and removed type/enhancement An improvement of existing functionality lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Feb 19, 2017
@tboerger tboerger removed this from the 1.2.0 milestone Feb 20, 2017
@ethantkoenig ethantkoenig deleted the not_null branch December 18, 2017 06:05
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
@delvh delvh added issue/not-a-bug The reported issue is the intended behavior or the problem is not inside Gitea and removed reviewed/invalid labels Oct 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/not-a-bug The reported issue is the intended behavior or the problem is not inside Gitea
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants