Skip to content

Commit cd92bde

Browse files
committed
use migrations
1 parent 0167915 commit cd92bde

File tree

4 files changed

+75
-37
lines changed

4 files changed

+75
-37
lines changed

database/migrations/2014_10_12_100000_create_password_resets_table.php

Lines changed: 0 additions & 32 deletions
This file was deleted.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
3+
use Illuminate\Support\Facades\Schema;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Database\Migrations\Migration;
6+
7+
class Category extends Migration
8+
{
9+
/**
10+
* 创建文章分类表
11+
*
12+
* @return void
13+
*/
14+
public function up()
15+
{
16+
Schema::create('categories', function (Blueprint $table) {
17+
$table->increments('id');
18+
$table->string('name');
19+
$table->softDeletes();
20+
$table->timestamps();
21+
});
22+
}
23+
24+
/**
25+
* 删除文章分类表
26+
*
27+
* @return void
28+
*/
29+
public function down()
30+
{
31+
Schema::dropIfExists('categories');
32+
}
33+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
3+
use Illuminate\Support\Facades\Schema;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Database\Migrations\Migration;
6+
7+
class Paper extends Migration
8+
{
9+
/**
10+
* 创建文章表
11+
*
12+
* @return void
13+
*/
14+
public function up()
15+
{
16+
Schema::create('papers', function (Blueprint $table) {
17+
$table->increments('id');
18+
$table->string('title');
19+
$table->text('markdown');
20+
$table->text('content');
21+
$table->tinyInteger('page');
22+
$table->integer('category_id');
23+
$table->softDeletes();
24+
$table->timestamps();
25+
});
26+
}
27+
28+
/**
29+
* 删除文章表
30+
*
31+
* @return void
32+
*/
33+
public function down()
34+
{
35+
Schema::dropIfExists('papers');
36+
}
37+
}

database/migrations/2014_10_12_000000_create_users_table.php renamed to database/migrations/2017_01_25_155907_user.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
use Illuminate\Database\Schema\Blueprint;
55
use Illuminate\Database\Migrations\Migration;
66

7-
class CreateUsersTable extends Migration
7+
class User extends Migration
88
{
99
/**
10-
* Run the migrations.
10+
* 创建用户表
1111
*
1212
* @return void
1313
*/
@@ -16,15 +16,15 @@ public function up()
1616
Schema::create('users', function (Blueprint $table) {
1717
$table->increments('id');
1818
$table->string('name');
19-
$table->string('email')->unique();
19+
$table->string('email');
2020
$table->string('password');
21-
$table->rememberToken();
21+
$table->string('token');
2222
$table->timestamps();
2323
});
2424
}
2525

2626
/**
27-
* Reverse the migrations.
27+
* 删除用户表
2828
*
2929
* @return void
3030
*/

0 commit comments

Comments
 (0)