File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -751,6 +751,19 @@ fn migrations() -> Vec<Migration> {
751
751
DROP NOT NULL", & [ ] ) ) ;
752
752
Ok ( ( ) )
753
753
} ) ,
754
+ Migration :: new( 20160812094502 , |tx| {
755
+ // Enusre that gh_id is always unique (sure hope it is), but
756
+ // only where the id is > 0. Historically we didn't track id, and we
757
+ // had to fill it in at one point after-the-fact. User rows that
758
+ // couldn't be resolved either have a github id of 0 or -1 so they
759
+ // can't ever be logged into again.
760
+ try!( tx. execute( "CREATE UNIQUE INDEX users_gh_id \
761
+ ON users (gh_id) WHERE gh_id > 0", & [ ] ) ) ;
762
+ Ok ( ( ) )
763
+ } , |tx| {
764
+ try!( tx. execute( "DROP INDEX users_gh_id" , & [ ] ) ) ;
765
+ Ok ( ( ) )
766
+ } ) ,
754
767
] ;
755
768
// NOTE: Generate a new id via `date +"%Y%m%d%H%M%S"`
756
769
You can’t perform that action at this time.
0 commit comments