Skip to content

Commit 118215f

Browse files
committed
Tidy migrations
1 parent 81e8f2d commit 118215f

File tree

2 files changed

+2
-32
lines changed

2 files changed

+2
-32
lines changed

database/migrations/2020_04_07_181731_create_series_table.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
66

77
class CreateSeriesTable extends Migration
88
{
9-
/**
10-
* Run the migrations.
11-
*
12-
* @return void
13-
*/
149
public function up()
1510
{
1611
Schema::create('series', function (Blueprint $table) {
@@ -25,14 +20,4 @@ public function up()
2520
->onDelete('CASCADE');
2621
});
2722
}
28-
29-
/**
30-
* Reverse the migrations.
31-
*
32-
* @return void
33-
*/
34-
public function down()
35-
{
36-
Schema::dropIfExists('series');
37-
}
3823
}

database/migrations/2020_04_07_185543_create_community_articles_table.php

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
66

77
class CreateCommunityArticlesTable extends Migration
88
{
9-
/**
10-
* Run the migrations.
11-
*
12-
* @return void
13-
*/
149
public function up()
1510
{
1611
Schema::create('articles', function (Blueprint $table) {
@@ -19,27 +14,17 @@ public function up()
1914
$table->unsignedInteger('author_id');
2015
$table->string('title');
2116
$table->text('body');
22-
$table->string('canonical_url')->nullable();
17+
$table->string('original_url')->nullable();
2318
$table->string('slug')->unique();
2419
$table->timestamps();
2520

2621
$table->foreign('series_id')
2722
->references('id')->on('series')
28-
->onDelete('CASCADE');
23+
->onDelete('SET NULL');
2924

3025
$table->foreign('author_id')
3126
->references('id')->on('users')
3227
->onDelete('CASCADE');
3328
});
3429
}
35-
36-
/**
37-
* Reverse the migrations.
38-
*
39-
* @return void
40-
*/
41-
public function down()
42-
{
43-
Schema::dropIfExists('articles');
44-
}
4530
}

0 commit comments

Comments
 (0)