Permalink
Browse files

change all user table columns names to snake_case

  • Loading branch information...
1 parent 62d62ff commit 7013a323d21688e5a91c3d4200ccd917dc156900 @mihan007 mihan007 committed Sep 5, 2012
@@ -51,13 +51,13 @@ class APasswordBehavior extends CActiveRecordBehavior {
* The name of the attribute that contains the password strategy name
* @var string
*/
- public $strategyAttribute ="passwordStrategy";
+ public $strategyAttribute ="password_strategy";
/**
* The name of the attribute that determines whether a user requires a new password or not
* @var string
*/
- public $requireNewPasswordAttribute = "requiresNewPassword";
+ public $requireNewPasswordAttribute = "requires_new_password";
/**
* The name of the default password strategy
@@ -57,8 +57,8 @@ By default, APasswordBehavior assumes that your model contains the following fie
<ul>
<li><strong>salt</strong> - holds the per user salt used for hashing passwords</li>
<li><strong>password</strong> - holds the hashed password</li>
- <li><strong>passwordStrategy</strong> - holds the name of the current password strategy for this user
- <li><strong>requiresNewPassword</strong> - a boolean field that determines whether the user should change their password or not
+ <li><strong>password_strategy</strong> - holds the name of the current password strategy for this user
+ <li><strong>requires_new_password</strong> - a boolean field that determines whether the user should change their password or not
</ul>
You can configure the field names on the behavior.
@@ -55,7 +55,7 @@ class MockUserModel extends AUser
{
public $password;
public $salt;
- public $passwordStrategy;
+ public $password_strategy;
public function tableName()
{
@@ -19,8 +19,8 @@
* @property integer $login_attempts
* @property integer $login_time
* @property string $validation_key
- * @property string $passwordStrategy
- * @property boolean $requiresNewPassword
+ * @property string $password_strategy
+ * @property boolean $requires_new_password
* @property integer $create_id
* @property integer $create_time
* @property integer $update_id
@@ -99,12 +99,12 @@ public function rules()
array('email', 'email'),
array('username, email', 'unique'),
array('passwordConfirm', 'compare', 'compareAttribute' => 'newPassword', 'message' => Yii::t('validation', "Passwords don't match")),
- array('newPassword, passwordStrategy ', 'length', 'max' => 50, 'min' => 8),
+ array('newPassword, password_strategy ', 'length', 'max' => 50, 'min' => 8),
array('email, password, salt', 'length', 'max' => 255),
- array('requiresNewPassword, login_attempts', 'numerical', 'integerOnly' => true),
+ array('requires_new_password, login_attempts', 'numerical', 'integerOnly' => true),
// The following rule is used by search().
// Please remove those attributes that should not be searched.
- array('id, password, salt, passwordStrategy , requiresNewPassword , email', 'safe', 'on' => 'search'),
+ array('id, password, salt, password_strategy , requires_new_password , email', 'safe', 'on' => 'search'),
);
}
@@ -15,8 +15,8 @@ public function up()
`username` varchar(45) DEFAULT NULL,
`password` varchar(255) DEFAULT NULL,
`salt` varchar(255) DEFAULT NULL,
- `passwordStrategy` varchar(50) DEFAULT NULL,
- `requiresNewPassword` tinyint(1) DEFAULT NULL,
+ `password_strategy` varchar(50) DEFAULT NULL,
+ `requires_new_password` tinyint(1) DEFAULT NULL,
`email` varchar(255) DEFAULT NULL,
`login_attempts` int(11) DEFAULT NULL,
`login_time` int(11) DEFAULT NULL,

0 comments on commit 7013a32

Please sign in to comment.