-
Notifications
You must be signed in to change notification settings - Fork 12
/
upgrade_from_old_codeigniter_3_bootstrap.sql
81 lines (66 loc) · 1.92 KB
/
upgrade_from_old_codeigniter_3_bootstrap.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#
# activation feature upgrade
#
ALTER TABLE `admin_users`
ADD COLUMN `activation_selector` varchar(255) AFTER `email`,
MODIFY COLUMN `activation_code` varchar(255);
#
# Remember_me feature upgrade
#
ALTER TABLE `admin_users`
ADD COLUMN `remember_selector` varchar(255) AFTER `forgotten_password_time`,
MODIFY COLUMN `remember_code` varchar(255);
#
# Forgotten password feature upgrade
#
ALTER TABLE `admin_users`
ADD COLUMN `forgotten_password_selector` varchar(255) AFTER `activation_code`,
MODIFY COLUMN `forgotten_password_code` varchar(255);
#
# Add optimization
#
ALTER TABLE `admin_users`
ADD CONSTRAINT uc_email
UNIQUE (email);
ALTER TABLE `admin_users`
ADD CONSTRAINT uc_activation_selector
UNIQUE (activation_selector);
ALTER TABLE `admin_users`
ADD CONSTRAINT uc_remember_selector
UNIQUE (remember_selector);
ALTER TABLE `admin_users`
ADD CONSTRAINT uc_forgotten_password_selector
UNIQUE (forgotten_password_selector);
#
# activation feature upgrade
#
ALTER TABLE `users`
ADD COLUMN `activation_selector` varchar(255) AFTER `email`,
MODIFY COLUMN `activation_code` varchar(255);
#
# Remember_me feature upgrade
#
ALTER TABLE `users`
ADD COLUMN `remember_selector` varchar(255) AFTER `forgotten_password_time`,
MODIFY COLUMN `remember_code` varchar(255);
#
# Forgotten password feature upgrade
#
ALTER TABLE `users`
ADD COLUMN `forgotten_password_selector` varchar(255) AFTER `activation_code`,
MODIFY COLUMN `forgotten_password_code` varchar(255);
#
# Add optimization
#
ALTER TABLE `users`
ADD CONSTRAINT uc_email
UNIQUE (email);
ALTER TABLE `users`
ADD CONSTRAINT uc_activation_selector
UNIQUE (activation_selector);
ALTER TABLE `users`
ADD CONSTRAINT uc_remember_selector
UNIQUE (remember_selector);
ALTER TABLE `users`
ADD CONSTRAINT uc_forgotten_password_selector
UNIQUE (forgotten_password_selector);