Commit 4feaae98 authored by Eric Chiang's avatar Eric Chiang

db: add better comment about migration

parent 01a24542
-- +migrate Up -- +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 $$ CREATE OR REPLACE FUNCTION raise_exp() RETURNS VOID AS $$
BEGIN BEGIN
RAISE EXCEPTION 'Found duplicate emails when using case insensitive comparision, cannot perform migration.'; RAISE EXCEPTION 'Found duplicate emails when using case insensitive comparision, cannot perform migration.';
......
...@@ -425,7 +425,7 @@ func (r *userRepo) insertRemoteIdentity(tx repo.Transaction, userID string, ri u ...@@ -425,7 +425,7 @@ func (r *userRepo) insertRemoteIdentity(tx repo.Transaction, userID string, ri u
type userModel struct { type userModel struct {
ID string `db:"id"` 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"` EmailVerified bool `db:"email_verified"`
DisplayName string `db:"display_name"` DisplayName string `db:"display_name"`
Disabled bool `db:"disabled"` Disabled bool `db:"disabled"`
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment