Update migrations to use bigInts for profile, status, user

pull/9/head
Daniel Supernault 2018-05-19 20:56:20 -06:00
rodzic 7eb45af38c
commit 92c0ef8a74
5 zmienionych plików z 17 dodań i 9 usunięć

Wyświetl plik

@ -14,7 +14,7 @@ class CreateUsersTable extends Migration
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->bigIncrements('id');
$table->string('name')->nullable();
$table->string('username')->nullable()->unique()->index();
$table->string('email')->unique();

Wyświetl plik

@ -15,7 +15,7 @@ class CreateSessionsTable extends Migration
{
Schema::create('sessions', function (Blueprint $table) {
$table->string('id')->unique();
$table->unsignedInteger('user_id')->nullable();
$table->bigInteger('user_id')->unsigned()->nullable();
$table->string('ip_address', 45)->nullable();
$table->text('user_agent')->nullable();
$table->text('payload');

Wyświetl plik

@ -14,7 +14,7 @@ class CreateProfilesTable extends Migration
public function up()
{
Schema::create('profiles', function (Blueprint $table) {
$table->increments('id');
$table->bigIncrements('id');
$table->unsignedInteger('user_id')->nullable();
$table->string('domain')->nullable();
$table->string('username')->nullable()->index();
@ -24,6 +24,8 @@ class CreateProfilesTable extends Migration
$table->string('website')->nullable();
$table->text('keybase_proof')->nullable();
$table->boolean('is_private')->default(false);
// ActivityPub
$table->string('sharedInbox')->nullable()->index();
// PuSH/WebSub
$table->string('verify_token')->nullable();
$table->string('secret')->nullable();

Wyświetl plik

@ -14,10 +14,11 @@ class CreateStatusesTable extends Migration
public function up()
{
Schema::create('statuses', function (Blueprint $table) {
$table->increments('id');
$table->bigIncrements('id');
$table->string('uri')->nullable();
$table->string('caption')->nullable();
$table->unsignedInteger('profile_id')->nullable();
$table->text('rendered')->nullable();
$table->bigInteger('profile_id')->unsigned()->nullable();
$table->bigInteger('in_reply_to_id')->unsigned()->nullable();
$table->bigInteger('reblog_of_id')->unsigned()->nullable();
$table->string('url')->nullable();
@ -29,8 +30,9 @@ class CreateStatusesTable extends Migration
$table->string('language')->nullable();
$table->bigInteger('conversation_id')->unsigned()->nullable();
$table->boolean('local')->default(true);
$table->bigInteger('application_id')
$table->bigInteger('application_id')->unsigned()->nullable();
$table->bigInteger('in_reply_to_profile_id')->unsigned()->nullable();
$table->json('entities')->nullable();
$table->timestamps();
});
}

Wyświetl plik

@ -15,14 +15,18 @@ class CreateMediaTable extends Migration
{
Schema::create('media', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('status_id')->nullable();
$table->unsignedInteger('profile_id')->nullable();
$table->unsignedInteger('user_id')->nullable();
$table->bigInteger('status_id')->unsigned()->nullable();
$table->bigInteger('profile_id')->unsigned()->nullable();
$table->bigInteger('user_id')->unsigned()->nullable();
$table->string('media_path');
$table->string('thumbnail_path')->nullable();
$table->string('cdn_url')->nullable();
$table->string('optimized_url')->nullable();
$table->string('thumbnail_url')->nullable();
$table->tinyInteger('order')->unsigned()->default(1);
$table->string('mime')->nullable();
$table->unsignedInteger('size')->nullable();
$table->string('orientation')->nullable();
$table->timestamp('processed_at')->nullable();
$table->unique(['status_id', 'media_path']);
$table->timestamps();