Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dex
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
dex
Commits
4feaae98
Commit
4feaae98
authored
Mar 02, 2016
by
Eric Chiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
db: add better comment about migration
parent
01a24542
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
0011_case_insensitive_emails.sql
db/migrations/0011_case_insensitive_emails.sql
+4
-0
user.go
db/user.go
+1
-1
No files found.
db/migrations/0011_case_insensitive_emails.sql
View file @
4feaae98
-- +migrate Up
-- This migration is a fix for a bug that allowed duplicate emails if they used different cases (see #338).
-- When migrating, dex will not take the liberty of deleting rows for duplicate cases. Instead it will
-- raise an exception and call for an admin to remove duplicates manually.
CREATE
OR
REPLACE
FUNCTION
raise_exp
()
RETURNS
VOID
AS
$$
BEGIN
RAISE
EXCEPTION
'Found duplicate emails when using case insensitive comparision, cannot perform migration.'
;
...
...
db/user.go
View file @
4feaae98
...
...
@@ -425,7 +425,7 @@ func (r *userRepo) insertRemoteIdentity(tx repo.Transaction, userID string, ri u
type
userModel
struct
{
ID
string
`db:"id"`
Email
string
`db:"email"`
// NOTE(ericchiang): When making comparisions emails are case insensitive.
Email
string
`db:"email"`
EmailVerified
bool
`db:"email_verified"`
DisplayName
string
`db:"display_name"`
Disabled
bool
`db:"disabled"`
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment