diff --git a/database/migrations/2016_06_26_225535_create_activities_table.php b/database/migrations/2016_06_26_225535_create_activities_table.php index 9859557b..3fb6943c 100644 --- a/database/migrations/2016_06_26_225535_create_activities_table.php +++ b/database/migrations/2016_06_26_225535_create_activities_table.php @@ -17,8 +17,8 @@ class CreateActivitiesTable extends Migration { $table->bigInteger('id', true)->unsigned(); $table->dateTime('created_at')->index(); $table->integer('user_id')->unsigned(); - $table->boolean('activity_type'); - $table->boolean('resource_type'); + $table->unsignedTinyInteger('activity_type'); + $table->unsignedTinyInteger('resource_type'); $table->integer('resource_id')->unsigned(); }); } diff --git a/database/migrations/2016_06_26_225535_create_favourites_table.php b/database/migrations/2016_06_26_225535_create_favourites_table.php index 92b8daeb..7adadee3 100644 --- a/database/migrations/2016_06_26_225535_create_favourites_table.php +++ b/database/migrations/2016_06_26_225535_create_favourites_table.php @@ -19,7 +19,7 @@ class CreateFavouritesTable extends Migration { $table->integer('track_id')->unsigned()->nullable()->index(); $table->integer('album_id')->unsigned()->nullable()->index(); $table->integer('playlist_id')->unsigned()->nullable()->index(); - $table->dateTime('created_at')->default('now()'); + $table->dateTime('created_at')->default('now()')->nullable(); }); } diff --git a/database/migrations/2016_06_26_225535_create_followers_table.php b/database/migrations/2016_06_26_225535_create_followers_table.php index b36cc776..48596cff 100644 --- a/database/migrations/2016_06_26_225535_create_followers_table.php +++ b/database/migrations/2016_06_26_225535_create_followers_table.php @@ -18,7 +18,7 @@ class CreateFollowersTable extends Migration { $table->integer('user_id')->unsigned()->index(); $table->integer('artist_id')->unsigned()->nullable()->index(); $table->integer('playlist_id')->unsigned()->nullable()->index(); - $table->dateTime('created_at')->default('now()'); + $table->dateTime('created_at')->default('now()')->nullable(); }); } diff --git a/database/migrations/2016_06_26_225535_create_genres_table.php b/database/migrations/2016_06_26_225535_create_genres_table.php index a248b612..dcf2da07 100644 --- a/database/migrations/2016_06_26_225535_create_genres_table.php +++ b/database/migrations/2016_06_26_225535_create_genres_table.php @@ -18,7 +18,7 @@ class CreateGenresTable extends Migration { $table->string('name')->unique(); $table->string('slug', 200)->index(); $table->softDeletes()->index(); - $table->timestamps(); + $table->nullableTimestamps(); }); } diff --git a/database/migrations/2016_06_26_225535_create_licenses_table.php b/database/migrations/2016_06_26_225535_create_licenses_table.php index 0ce99166..aa625c50 100644 --- a/database/migrations/2016_06_26_225535_create_licenses_table.php +++ b/database/migrations/2016_06_26_225535_create_licenses_table.php @@ -17,9 +17,9 @@ class CreateLicensesTable extends Migration { $table->increments('id'); $table->string('title', 100); $table->text('description', 65535); - $table->boolean('affiliate_distribution'); - $table->boolean('open_distribution'); - $table->boolean('remix'); + $table->unsignedTinyInteger('affiliate_distribution'); + $table->unsignedTinyInteger('open_distribution'); + $table->unsignedTinyInteger('remix'); }); } diff --git a/database/migrations/2016_06_26_225535_create_notifications_table.php b/database/migrations/2016_06_26_225535_create_notifications_table.php index ca886133..99ecd626 100644 --- a/database/migrations/2016_06_26_225535_create_notifications_table.php +++ b/database/migrations/2016_06_26_225535_create_notifications_table.php @@ -17,7 +17,7 @@ class CreateNotificationsTable extends Migration { $table->bigInteger('id', true)->unsigned(); $table->bigInteger('activity_id')->unsigned()->index(); $table->integer('user_id')->unsigned()->index(); - $table->boolean('is_read')->default(0)->index(); + $table->unsignedTinyInteger('is_read')->default(0)->index(); }); } diff --git a/database/migrations/2016_06_26_225535_create_playlists_table.php b/database/migrations/2016_06_26_225535_create_playlists_table.php index 89cf2290..98648028 100644 --- a/database/migrations/2016_06_26_225535_create_playlists_table.php +++ b/database/migrations/2016_06_26_225535_create_playlists_table.php @@ -19,7 +19,7 @@ class CreatePlaylistsTable extends Migration { $table->string('title')->index(); $table->string('slug'); $table->text('description', 65535); - $table->boolean('is_public')->index(); + $table->unsignedTinyInteger('is_public')->index(); $table->integer('track_count')->unsigned()->index(); $table->integer('view_count')->unsigned(); $table->integer('download_count')->unsigned(); diff --git a/database/migrations/2016_06_26_225535_create_resource_users_table.php b/database/migrations/2016_06_26_225535_create_resource_users_table.php index bf0acd39..c72f7f5b 100644 --- a/database/migrations/2016_06_26_225535_create_resource_users_table.php +++ b/database/migrations/2016_06_26_225535_create_resource_users_table.php @@ -20,9 +20,9 @@ class CreateResourceUsersTable extends Migration { $table->integer('album_id')->unsigned()->nullable()->index(); $table->integer('playlist_id')->unsigned()->nullable()->index(); $table->integer('artist_id')->unsigned()->nullable()->index(); - $table->boolean('is_followed'); - $table->boolean('is_favourited'); - $table->boolean('is_pinned'); + $table->unsignedTinyInteger('is_followed'); + $table->unsignedTinyInteger('is_favourited'); + $table->unsignedTinyInteger('is_pinned'); $table->integer('view_count'); $table->integer('play_count'); $table->integer('download_count'); diff --git a/database/migrations/2016_06_26_225535_create_subscriptions_table.php b/database/migrations/2016_06_26_225535_create_subscriptions_table.php index 76111d2b..b34de79d 100644 --- a/database/migrations/2016_06_26_225535_create_subscriptions_table.php +++ b/database/migrations/2016_06_26_225535_create_subscriptions_table.php @@ -19,7 +19,7 @@ class CreateSubscriptionsTable extends Migration { $table->string('endpoint'); $table->string('p256dh'); $table->string('auth'); - $table->timestamps(); + $table->nullableTimestamps(); }); } diff --git a/database/migrations/2016_06_26_225535_create_track_files_table.php b/database/migrations/2016_06_26_225535_create_track_files_table.php index d5cabd02..df8a211d 100644 --- a/database/migrations/2016_06_26_225535_create_track_files_table.php +++ b/database/migrations/2016_06_26_225535_create_track_files_table.php @@ -16,10 +16,10 @@ class CreateTrackFilesTable extends Migration { { $table->increments('id'); $table->integer('track_id')->unsigned()->index('track_files_track_id_foreign'); - $table->boolean('is_master')->default(0)->index(); + $table->unsignedTinyInteger('is_master')->default(0)->index(); $table->string('format')->index(); $table->timestamps(); - $table->boolean('is_cacheable')->default(0)->index(); + $table->unsignedTinyInteger('is_cacheable')->default(0)->index(); $table->unsignedTinyInteger('status')->default(0); $table->dateTime('expires_at')->nullable()->index(); $table->integer('filesize')->unsigned()->nullable(); diff --git a/database/migrations/2016_06_26_225535_create_tracks_table.php b/database/migrations/2016_06_26_225535_create_tracks_table.php index a090b47a..8a208d3e 100644 --- a/database/migrations/2016_06_26_225535_create_tracks_table.php +++ b/database/migrations/2016_06_26_225535_create_tracks_table.php @@ -23,10 +23,10 @@ class CreateTracksTable extends Migration { $table->string('slug', 200)->index(); $table->text('description', 65535)->nullable(); $table->text('lyrics', 65535)->nullable(); - $table->boolean('is_vocal')->default(0); - $table->boolean('is_explicit')->default(0); + $table->unsignedTinyInteger('is_vocal')->default(0); + $table->unsignedTinyInteger('is_explicit')->default(0); $table->integer('cover_id')->unsigned()->nullable()->index('tracks_cover_id_foreign'); - $table->boolean('is_downloadable')->default(0); + $table->unsignedTinyInteger('is_downloadable')->default(0); $table->float('duration')->unsigned(); $table->integer('play_count')->unsigned()->default(0); $table->integer('view_count')->unsigned()->default(0); @@ -39,9 +39,9 @@ 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->boolean('is_latest')->default(0); + $table->unsignedTinyInteger('is_latest')->default(0); $table->string('hash', 32)->nullable(); - $table->boolean('is_listed')->default(1); + $table->unsignedTinyInteger('is_listed')->default(1); $table->string('source', 40)->default('direct_upload'); $table->text('metadata')->nullable(); $table->text('original_tags')->nullable(); diff --git a/database/migrations/2016_06_26_225535_create_users_table.php b/database/migrations/2016_06_26_225535_create_users_table.php index b5fb7484..dce0806c 100644 --- a/database/migrations/2016_06_26_225535_create_users_table.php +++ b/database/migrations/2016_06_26_225535_create_users_table.php @@ -17,19 +17,19 @@ class CreateUsersTable extends Migration { $table->increments('id'); $table->string('display_name')->index(); $table->string('username')->nullable(); - $table->boolean('sync_names')->default(1); + $table->unsignedTinyInteger('sync_names')->default(1); $table->string('email', 150)->nullable(); $table->string('gravatar')->nullable(); $table->string('slug')->unique(); - $table->boolean('uses_gravatar')->default(1); - $table->boolean('can_see_explicit_content')->default(0); + $table->unsignedTinyInteger('uses_gravatar')->default(1); + $table->unsignedTinyInteger('can_see_explicit_content')->default(0); $table->text('bio', 65535)->default(''); $table->integer('track_count')->unsigned()->default(0)->index(); $table->integer('comment_count')->unsigned()->default(0); $table->timestamps(); $table->integer('avatar_id')->unsigned()->nullable()->index('users_avatar_id_foreign'); $table->string('remember_token', 100)->nullable(); - $table->boolean('is_archived')->default(0)->index(); + $table->unsignedTinyInteger('is_archived')->default(0)->index(); $table->dateTime('disabled_at')->nullable()->index(); }); }