-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Josef Citrine
committed
Feb 21, 2017
1 parent
3526403
commit 8841bd2
Showing
2 changed files
with
118 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
database/migrations/2017_02_08_233324_create_ponify_tracks.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
|
||
use Illuminate\Support\Facades\Schema; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Database\Migrations\Migration; | ||
|
||
class CreatePonifyTracks extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::create('ponify_tracks', function(Blueprint $table) | ||
{ | ||
$table->increments('id'); | ||
$table->integer('track_id')->unsigned()->index(); | ||
$table->string('path')->index(); | ||
$table->string('filename')->index(); | ||
$table->string('extension')->index(); | ||
$table->dateTime('imported_at'); | ||
$table->text('parsed_tags'); | ||
$table->text('raw_tags'); | ||
}); | ||
|
||
Schema::table('ponify_tracks', function(Blueprint $table) | ||
{ | ||
$table->foreign('track_id')->references('id')->on('tracks')->onUpdate('RESTRICT')->onDelete('RESTRICT'); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::table('ponify_tracks', function(Blueprint $table) | ||
{ | ||
$table->dropForeign('ponify_tracks_track_id_foreign'); | ||
}); | ||
|
||
Schema::drop('ponify_tracks'); | ||
} | ||
} |