CreateUsersTable::down()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
use Illuminate\Database\Schema\Blueprint;
4
use Illuminate\Database\Migrations\Migration;
5
6
class CreateUsersTable extends Migration {
7
8
	/**
9
	 * @author	Andrea Marco Sartori
10
	 * @var		string	$table	The name of the users table.
11
	 */
12
	protected $table;
13
14
	/**
15
	 * Set the name of the users table.
16
	 *
17
	 * @author	Andrea Marco Sartori
18
	 * @return	void
19
	 */
20
	public function __construct()
21
	{
22
		$this->table = config('auth.table');
23
	}
24
25
	/**
26
	 * Run the migrations.
27
	 *
28
	 * @return void
29
	 */
30
	public function up()
31
	{
32
		Schema::create($this->table, function(Blueprint $table)
33
		{
34
			$table->increments('id');
35
			$table->string('email')->unique();
36
			$table->string('password', 60);
37
			$table->string('reset_token', 10)->nullable();
38
			$table->rememberToken();
39
			$table->timestamps();
40
		});
41
	}
42
43
	/**
44
	 * Reverse the migrations.
45
	 *
46
	 * @return void
47
	 */
48
	public function down()
49
	{
50
		Schema::drop($this->table);
51
	}
52
53
}
54