#86: Corrected a number of column definitions.

This commit is contained in:
Peter Deltchev 2016-06-30 04:08:07 -07:00
parent 28bd79aa1a
commit ccb05bb958
7 changed files with 17 additions and 17 deletions

View file

@ -20,7 +20,7 @@ class CreateAlbumsTable extends Migration {
$table->string('slug')->index();
$table->text('description', 65535);
$table->integer('cover_id')->unsigned()->nullable()->index('albums_cover_id_foreign');
$table->integer('track_count')->unsigned();
$table->integer('track_count')->unsigned()->default(0);
$table->integer('view_count')->unsigned()->default(0);
$table->integer('download_count')->unsigned()->default(0);
$table->integer('favourite_count')->unsigned()->default(0);

View file

@ -15,8 +15,8 @@ class CreateOauth2TokensTable extends Migration {
Schema::create('oauth2_tokens', function(Blueprint $table)
{
$table->increments('id');
$table->integer('user_id');
$table->integer('external_user_id');
$table->integer('user_id')->unsigned();
$table->integer('external_user_id')->unsigned();
$table->text('access_token', 65535);
$table->dateTime('expires')->default('now()');
$table->text('refresh_token', 65535);

View file

@ -16,9 +16,9 @@ class CreateResourceLogItemsTable extends Migration {
{
$table->increments('id');
$table->integer('user_id')->unsigned()->nullable()->index();
$table->integer('log_type')->unsigned();
$table->tinyInteger('log_type')->unsigned();
$table->string('ip_address', 46)->index();
$table->integer('track_format_id')->unsigned()->nullable();
$table->tinyInteger('track_format_id')->unsigned()->nullable();
$table->integer('track_id')->unsigned()->nullable()->index();
$table->integer('album_id')->unsigned()->nullable()->index();
$table->integer('playlist_id')->unsigned()->nullable()->index();

View file

@ -23,9 +23,9 @@ class CreateResourceUsersTable extends Migration {
$table->boolean('is_followed')->default(false);
$table->boolean('is_favourited')->default(false);
$table->boolean('is_pinned')->default(false);
$table->integer('view_count')->default(0);
$table->integer('play_count')->default(0);
$table->integer('download_count')->default(0);
$table->unsignedInteger('view_count')->default(0);
$table->unsignedInteger('play_count')->default(0);
$table->unsignedInteger('download_count')->default(0);
$table->unique(['user_id','track_id','album_id','playlist_id','artist_id'], 'resource_unique');
});
}

View file

@ -17,7 +17,7 @@ class CreateRevisionsTable extends Migration {
$table->increments('id');
$table->string('revisionable_type');
$table->integer('revisionable_id');
$table->integer('user_id')->nullable();
$table->unsignedInteger('user_id')->nullable();
$table->string('key');
$table->text('old_value', 65535)->nullable();
$table->text('new_value', 65535)->nullable();

View file

@ -20,7 +20,7 @@ class CreateTrackFilesTable extends Migration {
$table->string('format')->index();
$table->timestamps();
$table->boolean('is_cacheable')->default(false)->index();
$table->boolean('status')->default(false);
$table->unsignedTinyInteger('status')->default(false);
$table->dateTime('expires_at')->nullable()->index();
$table->integer('filesize')->unsigned()->nullable();
});

View file

@ -23,10 +23,10 @@ class CreateTracksTable extends Migration {
$table->string('slug', 200)->index();
$table->text('description', 65535)->nullable();
$table->text('lyrics', 65535)->nullable();
$table->unsignedTinyInteger('is_vocal')->default(0);
$table->unsignedTinyInteger('is_explicit')->default(0);
$table->boolean('is_vocal')->default(0);
$table->boolean('is_explicit')->default(0);
$table->integer('cover_id')->unsigned()->nullable()->index('tracks_cover_id_foreign');
$table->unsignedTinyInteger('is_downloadable')->default(0);
$table->boolean('is_downloadable')->default(0);
$table->float('duration')->unsigned();
$table->integer('play_count')->unsigned()->default(0);
$table->integer('view_count')->unsigned()->default(0);
@ -39,12 +39,12 @@ class CreateTracksTable extends Migration {
$table->dateTime('released_at')->nullable();
$table->integer('album_id')->unsigned()->nullable()->index('tracks_album_id_foreign');
$table->integer('track_number')->unsigned()->nullable();
$table->unsignedTinyInteger('is_latest')->default(0);
$table->boolean('is_latest')->default(0);
$table->string('hash', 32)->nullable();
$table->unsignedTinyInteger('is_listed')->default(1);
$table->boolean('is_listed')->default(1);
$table->string('source', 40)->default('direct_upload');
$table->text('metadata')->nullable();
$table->text('original_tags')->nullable();
$table->jsonb('metadata')->nullable();
$table->jsonb('original_tags')->nullable();
});
}