Parcourir la source

Update migrations to use bigInts for profile, status, user

Daniel Supernault il y a 7 ans
Parent
commit
92c0ef8a74

+ 1 - 1
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();

+ 1 - 1
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');

+ 3 - 1
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();

+ 5 - 3
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();
         });
     }

+ 7 - 3
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();