From 92c0ef8a74a4c333ced98c90e10025bb89d9a5f5 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sat, 19 May 2018 20:56:20 -0600 Subject: [PATCH] Update migrations to use bigInts for profile, status, user --- .../2014_10_12_000000_create_users_table.php | 2 +- .../2018_04_16_000059_create_sessions_table.php | 2 +- .../2018_04_16_002611_create_profiles_table.php | 4 +++- .../2018_04_16_005848_create_statuses_table.php | 8 +++++--- .../2018_04_16_011918_create_media_table.php | 10 +++++++--- 5 files changed, 17 insertions(+), 9 deletions(-) diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php index af911842d..c249292b6 100644 --- a/database/migrations/2014_10_12_000000_create_users_table.php +++ b/database/migrations/2014_10_12_000000_create_users_table.php @@ -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(); diff --git a/database/migrations/2018_04_16_000059_create_sessions_table.php b/database/migrations/2018_04_16_000059_create_sessions_table.php index c213297d1..7d848f178 100644 --- a/database/migrations/2018_04_16_000059_create_sessions_table.php +++ b/database/migrations/2018_04_16_000059_create_sessions_table.php @@ -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'); diff --git a/database/migrations/2018_04_16_002611_create_profiles_table.php b/database/migrations/2018_04_16_002611_create_profiles_table.php index b469839e8..598edddbf 100644 --- a/database/migrations/2018_04_16_002611_create_profiles_table.php +++ b/database/migrations/2018_04_16_002611_create_profiles_table.php @@ -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(); diff --git a/database/migrations/2018_04_16_005848_create_statuses_table.php b/database/migrations/2018_04_16_005848_create_statuses_table.php index 0d4163d14..b711df3bb 100644 --- a/database/migrations/2018_04_16_005848_create_statuses_table.php +++ b/database/migrations/2018_04_16_005848_create_statuses_table.php @@ -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(); }); } diff --git a/database/migrations/2018_04_16_011918_create_media_table.php b/database/migrations/2018_04_16_011918_create_media_table.php index 606634f61..8c2602488 100644 --- a/database/migrations/2018_04_16_011918_create_media_table.php +++ b/database/migrations/2018_04_16_011918_create_media_table.php @@ -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();