| @@ 13-25 (lines=13) @@ | ||
| 10 | * |
|
| 11 | * @return void |
|
| 12 | */ |
|
| 13 | public function up() |
|
| 14 | { |
|
| 15 | Schema::create('users', function (Blueprint $table) { |
|
| 16 | $table->increments('id'); |
|
| 17 | $table->string('name')->nullable(); |
|
| 18 | $table->string('email')->unique(); |
|
| 19 | $table->string('password')->nullable(); |
|
| 20 | $table->string('avatar')->default('/img/user2-160x160.png'); |
|
| 21 | $table->string('nickname')->nullable(); |
|
| 22 | $table->rememberToken(); |
|
| 23 | $table->timestamps(); |
|
| 24 | }); |
|
| 25 | } |
|
| 26 | ||
| 27 | /** |
|
| 28 | * Reverse the migrations. |
|
| @@ 15-25 (lines=11) @@ | ||
| 12 | */ |
|
| 13 | public function up() |
|
| 14 | { |
|
| 15 | Schema::create('videos', function (Blueprint $table) { |
|
| 16 | $table->increments('id'); |
|
| 17 | $table->string('name'); |
|
| 18 | $table->string('category'); |
|
| 19 | $table->string('path'); |
|
| 20 | $table->integer('user_id')->unsigned(); |
|
| 21 | $table->foreign('user_id')->references('id')->on('users') |
|
| 22 | ->onDelete('cascade') |
|
| 23 | ->onUpdate('cascade'); |
|
| 24 | $table->timestamps(); |
|
| 25 | }); |
|
| 26 | } |
|
| 27 | ||
| 28 | /** |
|