mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2024-11-22 13:07:59 +01:00
#86: Updated migrations to work with Postgres
This commit is contained in:
parent
a4db41c6b1
commit
f6c82bf245
12 changed files with 25 additions and 25 deletions
|
@ -17,8 +17,8 @@ class CreateActivitiesTable extends Migration {
|
||||||
$table->bigInteger('id', true)->unsigned();
|
$table->bigInteger('id', true)->unsigned();
|
||||||
$table->dateTime('created_at')->index();
|
$table->dateTime('created_at')->index();
|
||||||
$table->integer('user_id')->unsigned();
|
$table->integer('user_id')->unsigned();
|
||||||
$table->boolean('activity_type');
|
$table->unsignedTinyInteger('activity_type');
|
||||||
$table->boolean('resource_type');
|
$table->unsignedTinyInteger('resource_type');
|
||||||
$table->integer('resource_id')->unsigned();
|
$table->integer('resource_id')->unsigned();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ class CreateFavouritesTable extends Migration {
|
||||||
$table->integer('track_id')->unsigned()->nullable()->index();
|
$table->integer('track_id')->unsigned()->nullable()->index();
|
||||||
$table->integer('album_id')->unsigned()->nullable()->index();
|
$table->integer('album_id')->unsigned()->nullable()->index();
|
||||||
$table->integer('playlist_id')->unsigned()->nullable()->index();
|
$table->integer('playlist_id')->unsigned()->nullable()->index();
|
||||||
$table->dateTime('created_at')->default('now()');
|
$table->dateTime('created_at')->default('now()')->nullable();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ class CreateFollowersTable extends Migration {
|
||||||
$table->integer('user_id')->unsigned()->index();
|
$table->integer('user_id')->unsigned()->index();
|
||||||
$table->integer('artist_id')->unsigned()->nullable()->index();
|
$table->integer('artist_id')->unsigned()->nullable()->index();
|
||||||
$table->integer('playlist_id')->unsigned()->nullable()->index();
|
$table->integer('playlist_id')->unsigned()->nullable()->index();
|
||||||
$table->dateTime('created_at')->default('now()');
|
$table->dateTime('created_at')->default('now()')->nullable();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ class CreateGenresTable extends Migration {
|
||||||
$table->string('name')->unique();
|
$table->string('name')->unique();
|
||||||
$table->string('slug', 200)->index();
|
$table->string('slug', 200)->index();
|
||||||
$table->softDeletes()->index();
|
$table->softDeletes()->index();
|
||||||
$table->timestamps();
|
$table->nullableTimestamps();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,9 +17,9 @@ class CreateLicensesTable extends Migration {
|
||||||
$table->increments('id');
|
$table->increments('id');
|
||||||
$table->string('title', 100);
|
$table->string('title', 100);
|
||||||
$table->text('description', 65535);
|
$table->text('description', 65535);
|
||||||
$table->boolean('affiliate_distribution');
|
$table->unsignedTinyInteger('affiliate_distribution');
|
||||||
$table->boolean('open_distribution');
|
$table->unsignedTinyInteger('open_distribution');
|
||||||
$table->boolean('remix');
|
$table->unsignedTinyInteger('remix');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ class CreateNotificationsTable extends Migration {
|
||||||
$table->bigInteger('id', true)->unsigned();
|
$table->bigInteger('id', true)->unsigned();
|
||||||
$table->bigInteger('activity_id')->unsigned()->index();
|
$table->bigInteger('activity_id')->unsigned()->index();
|
||||||
$table->integer('user_id')->unsigned()->index();
|
$table->integer('user_id')->unsigned()->index();
|
||||||
$table->boolean('is_read')->default(0)->index();
|
$table->unsignedTinyInteger('is_read')->default(0)->index();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ class CreatePlaylistsTable extends Migration {
|
||||||
$table->string('title')->index();
|
$table->string('title')->index();
|
||||||
$table->string('slug');
|
$table->string('slug');
|
||||||
$table->text('description', 65535);
|
$table->text('description', 65535);
|
||||||
$table->boolean('is_public')->index();
|
$table->unsignedTinyInteger('is_public')->index();
|
||||||
$table->integer('track_count')->unsigned()->index();
|
$table->integer('track_count')->unsigned()->index();
|
||||||
$table->integer('view_count')->unsigned();
|
$table->integer('view_count')->unsigned();
|
||||||
$table->integer('download_count')->unsigned();
|
$table->integer('download_count')->unsigned();
|
||||||
|
|
|
@ -20,9 +20,9 @@ class CreateResourceUsersTable extends Migration {
|
||||||
$table->integer('album_id')->unsigned()->nullable()->index();
|
$table->integer('album_id')->unsigned()->nullable()->index();
|
||||||
$table->integer('playlist_id')->unsigned()->nullable()->index();
|
$table->integer('playlist_id')->unsigned()->nullable()->index();
|
||||||
$table->integer('artist_id')->unsigned()->nullable()->index();
|
$table->integer('artist_id')->unsigned()->nullable()->index();
|
||||||
$table->boolean('is_followed');
|
$table->unsignedTinyInteger('is_followed');
|
||||||
$table->boolean('is_favourited');
|
$table->unsignedTinyInteger('is_favourited');
|
||||||
$table->boolean('is_pinned');
|
$table->unsignedTinyInteger('is_pinned');
|
||||||
$table->integer('view_count');
|
$table->integer('view_count');
|
||||||
$table->integer('play_count');
|
$table->integer('play_count');
|
||||||
$table->integer('download_count');
|
$table->integer('download_count');
|
||||||
|
|
|
@ -19,7 +19,7 @@ class CreateSubscriptionsTable extends Migration {
|
||||||
$table->string('endpoint');
|
$table->string('endpoint');
|
||||||
$table->string('p256dh');
|
$table->string('p256dh');
|
||||||
$table->string('auth');
|
$table->string('auth');
|
||||||
$table->timestamps();
|
$table->nullableTimestamps();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,10 +16,10 @@ class CreateTrackFilesTable extends Migration {
|
||||||
{
|
{
|
||||||
$table->increments('id');
|
$table->increments('id');
|
||||||
$table->integer('track_id')->unsigned()->index('track_files_track_id_foreign');
|
$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->string('format')->index();
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
$table->boolean('is_cacheable')->default(0)->index();
|
$table->unsignedTinyInteger('is_cacheable')->default(0)->index();
|
||||||
$table->unsignedTinyInteger('status')->default(0);
|
$table->unsignedTinyInteger('status')->default(0);
|
||||||
$table->dateTime('expires_at')->nullable()->index();
|
$table->dateTime('expires_at')->nullable()->index();
|
||||||
$table->integer('filesize')->unsigned()->nullable();
|
$table->integer('filesize')->unsigned()->nullable();
|
||||||
|
|
|
@ -23,10 +23,10 @@ class CreateTracksTable extends Migration {
|
||||||
$table->string('slug', 200)->index();
|
$table->string('slug', 200)->index();
|
||||||
$table->text('description', 65535)->nullable();
|
$table->text('description', 65535)->nullable();
|
||||||
$table->text('lyrics', 65535)->nullable();
|
$table->text('lyrics', 65535)->nullable();
|
||||||
$table->boolean('is_vocal')->default(0);
|
$table->unsignedTinyInteger('is_vocal')->default(0);
|
||||||
$table->boolean('is_explicit')->default(0);
|
$table->unsignedTinyInteger('is_explicit')->default(0);
|
||||||
$table->integer('cover_id')->unsigned()->nullable()->index('tracks_cover_id_foreign');
|
$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->float('duration')->unsigned();
|
||||||
$table->integer('play_count')->unsigned()->default(0);
|
$table->integer('play_count')->unsigned()->default(0);
|
||||||
$table->integer('view_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->dateTime('released_at')->nullable();
|
||||||
$table->integer('album_id')->unsigned()->nullable()->index('tracks_album_id_foreign');
|
$table->integer('album_id')->unsigned()->nullable()->index('tracks_album_id_foreign');
|
||||||
$table->integer('track_number')->unsigned()->nullable();
|
$table->integer('track_number')->unsigned()->nullable();
|
||||||
$table->boolean('is_latest')->default(0);
|
$table->unsignedTinyInteger('is_latest')->default(0);
|
||||||
$table->string('hash', 32)->nullable();
|
$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->string('source', 40)->default('direct_upload');
|
||||||
$table->text('metadata')->nullable();
|
$table->text('metadata')->nullable();
|
||||||
$table->text('original_tags')->nullable();
|
$table->text('original_tags')->nullable();
|
||||||
|
|
|
@ -17,19 +17,19 @@ class CreateUsersTable extends Migration {
|
||||||
$table->increments('id');
|
$table->increments('id');
|
||||||
$table->string('display_name')->index();
|
$table->string('display_name')->index();
|
||||||
$table->string('username')->nullable();
|
$table->string('username')->nullable();
|
||||||
$table->boolean('sync_names')->default(1);
|
$table->unsignedTinyInteger('sync_names')->default(1);
|
||||||
$table->string('email', 150)->nullable();
|
$table->string('email', 150)->nullable();
|
||||||
$table->string('gravatar')->nullable();
|
$table->string('gravatar')->nullable();
|
||||||
$table->string('slug')->unique();
|
$table->string('slug')->unique();
|
||||||
$table->boolean('uses_gravatar')->default(1);
|
$table->unsignedTinyInteger('uses_gravatar')->default(1);
|
||||||
$table->boolean('can_see_explicit_content')->default(0);
|
$table->unsignedTinyInteger('can_see_explicit_content')->default(0);
|
||||||
$table->text('bio', 65535)->default('');
|
$table->text('bio', 65535)->default('');
|
||||||
$table->integer('track_count')->unsigned()->default(0)->index();
|
$table->integer('track_count')->unsigned()->default(0)->index();
|
||||||
$table->integer('comment_count')->unsigned()->default(0);
|
$table->integer('comment_count')->unsigned()->default(0);
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
$table->integer('avatar_id')->unsigned()->nullable()->index('users_avatar_id_foreign');
|
$table->integer('avatar_id')->unsigned()->nullable()->index('users_avatar_id_foreign');
|
||||||
$table->string('remember_token', 100)->nullable();
|
$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();
|
$table->dateTime('disabled_at')->nullable()->index();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue