Blame view

console/migrations/m150818_125718_create_user_180815.php 830 Bytes
a63b5418   Administrator   first_commit
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
  <?php
  
  
  use yii\db\Schema;
  use yii\db\Migration;
  
  
  class m150818_125718_create_user_180815 extends Migration
  {
      public function up()
      {
  
  
          $user_array = [
              'username' => 'admin',
              'auth_key' => 'admin',
              'password_hash' => Yii::$app->security->generatePasswordHash('admin'),
              'password_reset_token' => 'admin',
              'email'=> 'admin@test.com',
              'status' => '10',
              'created_at'=>'000000',
              'updated_at' => '000000'
          ];
          $this->insert('{{%user}}', $user_array);
      }
  
  
  
      public function down()
      {
          $this->dropTable('{{%user}}');
      }
  
      /*
      // Use safeUp/safeDown to run migration code within a transaction
      public function safeUp()
      {
      }
  
      public function safeDown()
      {
      }
      */
  }