Created
March 17, 2015 02:37
-
-
Save ryanmr/bb2851b0c227045c006e to your computer and use it in GitHub Desktop.
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
<?php | |
use Illuminate\Database\Schema\Blueprint; | |
use Illuminate\Database\Migrations\Migration; | |
class CreateSeriesTable extends Migration { | |
/** | |
* Run the migrations. | |
* | |
* @return void | |
*/ | |
public function up() | |
{ | |
/* | |
Describes the basic details of a series. | |
*/ | |
Schema::create('series', function(Blueprint $table){ | |
$table->increments('id'); | |
// formal name | |
$table->string('name')->unique(); | |
// short name / slug (e.g. atn, eb, cs) | |
$table->string('slug')->unique(); | |
// long slug (e.g. at-the-nexus, eight-bit, control structure) | |
$table->string('long_slug')->unique(); | |
$table->text('description'); | |
$table->boolean('hidden')->default(false); | |
$table->boolean('retired')->default(false); | |
$table->boolean('hiatus')->default(false); | |
$table->timestamps(); | |
}); | |
/* | |
Describes the extra details for a series. | |
*/ | |
Schema::create('series_metas', function(Blueprint $table){ | |
$table->increments('id'); | |
$table->string('feed_title'); | |
$table->text('feed_description'); | |
$table->string('feed_landing_url'); | |
$table->string('feed_geographic_location'); | |
$table->string('feed_episode_frequency'); | |
$table->string('feed_image_url'); | |
$table->string('feed_tracking_url'); | |
$table->string('itunes_subscription_url'); | |
$table->string('itunes_subtitle'); | |
$table->text('itunes_summary'); | |
$table->string('itunes_keywords'); | |
$table->string('itunes_category_primary'); | |
$table->string('itunes_category_secondary'); | |
$table->string('itunes_explicit'); | |
$table->string('itunes_email'); | |
$table->string('itunes_image_url'); | |
$table->integer('series_id')->unsigned(); | |
$table->foreign('series_id')->references('id') | |
->on('series') | |
->onDelete('cascade');; | |
// default series album art | |
// defined in album art migration | |
// default series hosts? | |
// defined in people migration | |
}); | |
} | |
/** | |
* Reverse the migrations. | |
* | |
* @return void | |
*/ | |
public function down() | |
{ | |
Schema::table('series_metas', function(Blueprint $table) { | |
$table->dropForeign('series_metas_series_id_foreign'); | |
}); | |
Schema::drop('series_metas'); | |
Schema::drop('series'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment