3
3
* Copyright © Magento, Inc. All rights reserved.
4
4
* See COPYING.txt for license details.
5
5
*/
6
-
7
6
namespace Magento \User \Setup ;
8
7
8
+ use Magento \Framework \DB \Ddl \Table ;
9
9
use Magento \Framework \Setup \ModuleContextInterface ;
10
10
use Magento \Framework \Setup \SchemaSetupInterface ;
11
11
use Magento \Framework \Setup \UpgradeSchemaInterface ;
@@ -45,7 +45,7 @@ private function addFailuresToAdminUserTable(SchemaSetupInterface $setup)
45
45
$ tableAdmins ,
46
46
'failures_num ' ,
47
47
[
48
- 'type ' => \ Magento \ Framework \ DB \ Ddl \ Table::TYPE_SMALLINT ,
48
+ 'type ' => Table::TYPE_SMALLINT ,
49
49
'nullable ' => true ,
50
50
'default ' => 0 ,
51
51
'comment ' => 'Failure Number '
@@ -55,15 +55,15 @@ private function addFailuresToAdminUserTable(SchemaSetupInterface $setup)
55
55
$ tableAdmins ,
56
56
'first_failure ' ,
57
57
[
58
- 'type ' => \ Magento \ Framework \ DB \ Ddl \ Table::TYPE_TIMESTAMP ,
58
+ 'type ' => Table::TYPE_TIMESTAMP ,
59
59
'comment ' => 'First Failure '
60
60
]
61
61
);
62
62
$ setup ->getConnection ()->addColumn (
63
63
$ tableAdmins ,
64
64
'lock_expires ' ,
65
65
[
66
- 'type ' => \ Magento \ Framework \ DB \ Ddl \ Table::TYPE_TIMESTAMP ,
66
+ 'type ' => Table::TYPE_TIMESTAMP ,
67
67
'comment ' => 'Expiration Lock Dates '
68
68
]
69
69
);
@@ -81,57 +81,63 @@ private function createAdminPasswordsTable(SchemaSetupInterface $setup)
81
81
return ;
82
82
}
83
83
84
- $ table = $ setup ->getConnection ()->newTable (
85
- $ setup ->getTable ('admin_passwords ' )
86
- )->addColumn (
87
- 'password_id ' ,
88
- \Magento \Framework \DB \Ddl \Table::TYPE_INTEGER ,
89
- null ,
90
- ['identity ' => true , 'unsigned ' => true , 'nullable ' => false , 'primary ' => true ],
91
- 'Password Id '
92
- )->addColumn (
93
- 'user_id ' ,
94
- \Magento \Framework \DB \Ddl \Table::TYPE_INTEGER ,
95
- null ,
96
- ['unsigned ' => true , 'nullable ' => false , 'default ' => '0 ' ],
97
- 'User Id '
98
- )->addColumn (
99
- 'password_hash ' ,
100
- \Magento \Framework \DB \Ddl \Table::TYPE_TEXT ,
101
- 100 ,
102
- [],
103
- 'Password Hash '
104
- )->addColumn (
105
- 'expires ' ,
106
- \Magento \Framework \DB \Ddl \Table::TYPE_INTEGER ,
107
- null ,
108
- ['unsigned ' => true , 'nullable ' => false , 'default ' => '0 ' ],
109
- 'Deprecated '
110
- )->addColumn (
111
- 'last_updated ' ,
112
- \Magento \Framework \DB \Ddl \Table::TYPE_INTEGER ,
113
- null ,
114
- ['unsigned ' => true , 'nullable ' => false , 'default ' => '0 ' ],
115
- 'Last Updated '
116
- )->addIndex (
117
- $ setup ->getIdxName ('admin_passwords ' , ['user_id ' ]),
118
- ['user_id ' ]
119
- )->addForeignKey (
120
- $ setup ->getFkName ('admin_passwords ' , 'user_id ' , 'admin_user ' , 'user_id ' ),
121
- 'user_id ' ,
122
- $ setup ->getTable ('admin_user ' ),
123
- 'user_id ' ,
124
- \Magento \Framework \DB \Ddl \Table::ACTION_CASCADE
125
- )->setComment (
126
- 'Admin Passwords '
127
- );
84
+ $ table = $ setup ->getConnection ()
85
+ ->newTable ($ setup ->getTable ('admin_passwords ' ))
86
+ ->addColumn (
87
+ 'password_id ' ,
88
+ Table::TYPE_INTEGER ,
89
+ null ,
90
+ ['identity ' => true , 'unsigned ' => true , 'nullable ' => false , 'primary ' => true ],
91
+ 'Password Id '
92
+ )
93
+ ->addColumn (
94
+ 'user_id ' ,
95
+ Table::TYPE_INTEGER ,
96
+ null ,
97
+ ['unsigned ' => true , 'nullable ' => false , 'default ' => '0 ' ],
98
+ 'User Id '
99
+ )
100
+ ->addColumn (
101
+ 'password_hash ' ,
102
+ Table::TYPE_TEXT ,
103
+ 100 ,
104
+ [],
105
+ 'Password Hash '
106
+ )
107
+ ->addColumn (
108
+ 'expires ' ,
109
+ Table::TYPE_INTEGER ,
110
+ null ,
111
+ ['unsigned ' => true , 'nullable ' => false , 'default ' => '0 ' ],
112
+ 'Deprecated '
113
+ )
114
+ ->addColumn (
115
+ 'last_updated ' ,
116
+ Table::TYPE_INTEGER ,
117
+ null ,
118
+ ['unsigned ' => true , 'nullable ' => false , 'default ' => '0 ' ],
119
+ 'Last Updated '
120
+ )
121
+ ->addIndex (
122
+ $ setup ->getIdxName ('admin_passwords ' , ['user_id ' ]),
123
+ ['user_id ' ]
124
+ )
125
+ ->addForeignKey (
126
+ $ setup ->getFkName ('admin_passwords ' , 'user_id ' , 'admin_user ' , 'user_id ' ),
127
+ 'user_id ' ,
128
+ $ setup ->getTable ('admin_user ' ),
129
+ 'user_id ' ,
130
+ Table::ACTION_CASCADE
131
+ )
132
+ ->setComment ('Admin Passwords ' );
133
+
128
134
$ setup ->getConnection ()->createTable ($ table );
129
135
130
136
$ setup ->getConnection ()->modifyColumn (
131
137
$ setup ->getTable ('admin_passwords ' ),
132
138
'expires ' ,
133
139
[
134
- 'type ' => \ Magento \ Framework \ DB \ Ddl \ Table::TYPE_INTEGER ,
140
+ 'type ' => Table::TYPE_INTEGER ,
135
141
'unsigned ' => true ,
136
142
'nullable ' => false ,
137
143
'default ' => '0 ' ,
0 commit comments