From e269456d77cb17e768c7d519be354398caa06ef2 Mon Sep 17 00:00:00 2001 From: HDVinnie Date: Sat, 6 Jun 2020 11:38:02 -0400 Subject: [PATCH] add: resolutions migration --- app/Models/Resolution.php | 69 +++++++++++++++++++ ..._06_06_185230_create_resolutions_table.php | 44 ++++++++++++ 2 files changed, 113 insertions(+) create mode 100644 app/Models/Resolution.php create mode 100644 database/migrations/2020_06_06_185230_create_resolutions_table.php diff --git a/app/Models/Resolution.php b/app/Models/Resolution.php new file mode 100644 index 0000000000..6741738358 --- /dev/null +++ b/app/Models/Resolution.php @@ -0,0 +1,69 @@ +hasMany(Torrent::class); + } + + /** + * Has Many Torrent Requests. + * + * @return \Illuminate\Database\Eloquent\Relations\HasMany + */ + public function requests() + { + return $this->hasMany(TorrentRequest::class); + } +} diff --git a/database/migrations/2020_06_06_185230_create_resolutions_table.php b/database/migrations/2020_06_06_185230_create_resolutions_table.php new file mode 100644 index 0000000000..4d25957055 --- /dev/null +++ b/database/migrations/2020_06_06_185230_create_resolutions_table.php @@ -0,0 +1,44 @@ + + * @license https://www.gnu.org/licenses/agpl-3.0.en.html/ GNU Affero General Public License v3.0 + */ + +use Illuminate\Database\Migrations\Migration; +use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; + +class CreateResolutionsTable extends Migration +{ + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::create('resolutions', function (Blueprint $table) { + $table->bigIncrements('id'); + $table->string('name'); + $table->string('slug'); + $table->integer('position'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('resolutions'); + } +}