From 1dd7c8d18936d85bd373e2236dde34b8683cca64 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Tue, 17 Jul 2018 18:05:37 -0600 Subject: [PATCH] Add UserFilter model/migration --- app/UserFilter.php | 10 +++++ ...07_15_013106_create_user_filters_table.php | 41 +++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 app/UserFilter.php create mode 100644 database/migrations/2018_07_15_013106_create_user_filters_table.php diff --git a/app/UserFilter.php b/app/UserFilter.php new file mode 100644 index 000000000..071f2eeb4 --- /dev/null +++ b/app/UserFilter.php @@ -0,0 +1,10 @@ +bigIncrements('id'); + $table->bigInteger('user_id')->unsigned()->index(); + $table->bigInteger('filterable_id')->unsigned(); + $table->string('filterable_type'); + $table->string('filter_type')->default('block')->index(); + $table->unique([ + 'user_id', + 'filterable_id', + 'filterable_type', + 'filter_type' + ], 'filter_unique'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('user_filters'); + } +}