forked from benedmunds/CodeIgniter-Ion-Auth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
migrate.mssql.sql
43 lines (36 loc) · 972 Bytes
/
migrate.mssql.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
* Activation feature upgrade
*/
ALTER TABLE users
ADD activation_selector varchar(255);
ALTER TABLE users
ALTER COLUMN activation_code varchar(255);
/*
* Remember_me feature upgrade
*/
ALTER TABLE users
ADD remember_selector varchar(255);
ALTER TABLE users
ALTER COLUMN remember_code varchar(255);
/*
* Forgotten password feature upgrade
*/
ALTER TABLE users
ADD forgotten_password_selector varchar(255);
ALTER TABLE users
ALTER COLUMN forgotten_password_code varchar(255);
/*
* Add optimization
*/
ALTER TABLE users
ADD CONSTRAINT uc_email
UNIQUE (email);
CREATE UNIQUE INDEX uc_activation_selector
ON users (activation_selector)
WHERE activation_selector IS NOT NULL
CREATE UNIQUE INDEX uc_remember_selector
ON users (remember_selector)
WHERE remember_selector IS NOT NULL
CREATE UNIQUE INDEX uc_forgotten_password_selector
ON users (forgotten_password_selector)
WHERE forgotten_password_selector IS NOT NULL