Skip to content

Add primary key and index to external login user table #1656

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

Merged
merged 1 commit into from
May 2, 2017

Conversation

lafriks
Copy link
Member

@lafriks lafriks commented May 1, 2017

Fixes #1655

I don't know if that's the best way for migration, it would be better to add primary key as SQL commands not recreating table, let me know what you think.

@lafriks
Copy link
Member Author

lafriks commented May 1, 2017

I created migration this way as there is no way to add primary key on existing table in sqlite3, at least I did not found it

@tboerger tboerger added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label May 1, 2017
LoginSourceID int64 `xorm:"NOT NULL"`
ExternalID string `xorm:"pk NOT NULL"`
UserID int64 `xorm:"INDEX NOT NULL"`
LoginSourceID int64 `xorm:"pk NOT NULL"`
Copy link
Member

Choose a reason for hiding this comment

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

So one external user could be only linked to one internal user?

@lafriks
Copy link
Member Author

lafriks commented May 2, 2017

Yes, I think so. When authorizing with external user how would otherwise we know to what internal user to login otherwise. I think I did see error message about it somewhere when translating

@lunny
Copy link
Member

lunny commented May 2, 2017

LGTM

@tboerger tboerger added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels May 2, 2017
@lunny lunny added this to the 1.2.0 milestone May 2, 2017
@lunny lunny added the type/bug label May 2, 2017
@appleboy
Copy link
Member

appleboy commented May 2, 2017

LGTM

@tboerger tboerger added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels May 2, 2017
@appleboy appleboy merged commit 98548c8 into go-gitea:master May 2, 2017
@lafriks lafriks deleted the issue/1655 branch May 7, 2017 16:43
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot delete user with LDAP auth (500 - Internal Server Error)
4 participants