From 78aa58f3db6f9a9a0beda4c3956d5b036b1c1eb2 Mon Sep 17 00:00:00 2001 From: structix Date: Sat, 11 Sep 2021 16:02:23 +0200 Subject: [PATCH] Add ShitUser table --- .../app/Http/Controllers/ShitController.php | 14 +++++++ shit-show/app/Models/ShitUser.php | 39 +++++++++++++++++++ .../2021_09_11_134641_shit_user.php | 38 ++++++++++++++++++ 3 files changed, 91 insertions(+) create mode 100644 shit-show/app/Http/Controllers/ShitController.php create mode 100644 shit-show/app/Models/ShitUser.php create mode 100644 shit-show/database/migrations/2021_09_11_134641_shit_user.php diff --git a/shit-show/app/Http/Controllers/ShitController.php b/shit-show/app/Http/Controllers/ShitController.php new file mode 100644 index 0000000..b0d77de --- /dev/null +++ b/shit-show/app/Http/Controllers/ShitController.php @@ -0,0 +1,14 @@ +id(); + $table->integer('user_id')->unsigned(); + $table->index('user_id'); + $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); + + $table->string('description'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + $table->dropForeign('lists_user_id_foreign'); + $table->dropIndex('lists_user_id_index'); + $table->dropColumn('user_id'); + $table->dropTable('shituser'); + } +}