From a9220e4e0159e7361432bd6576f1d82c827de784 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Mon, 7 Aug 2023 23:48:58 -0600 Subject: [PATCH] Add Account Migrations --- app/Models/ProfileAlias.php | 17 ++++++++++ ...07_021252_create_profile_aliases_table.php | 32 +++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 app/Models/ProfileAlias.php create mode 100644 database/migrations/2023_08_07_021252_create_profile_aliases_table.php diff --git a/app/Models/ProfileAlias.php b/app/Models/ProfileAlias.php new file mode 100644 index 000000000..b7a3bdc9c --- /dev/null +++ b/app/Models/ProfileAlias.php @@ -0,0 +1,17 @@ +belongsTo(Profile::class); + } +} diff --git a/database/migrations/2023_08_07_021252_create_profile_aliases_table.php b/database/migrations/2023_08_07_021252_create_profile_aliases_table.php new file mode 100644 index 000000000..ed9ab6ada --- /dev/null +++ b/database/migrations/2023_08_07_021252_create_profile_aliases_table.php @@ -0,0 +1,32 @@ +id(); + $table->unsignedBigInteger('profile_id')->nullable()->index(); + $table->string('acct')->nullable(); + $table->string('uri')->nullable(); + $table->foreign('profile_id')->references('id')->on('profiles'); + $table->unique(['profile_id', 'acct'], 'profile_id_acct_unique'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('profile_aliases'); + } +};