From f9956cc5df41a94060cf4bdd9243bed6f93e990b Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 10 Aug 2022 14:54:33 -0700 Subject: [PATCH] Added DB migration Signed-off-by: snipe --- ..._add_notes_denorm_to_consumables_users.php | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 database/migrations/2022_08_10_141328_add_notes_denorm_to_consumables_users.php diff --git a/database/migrations/2022_08_10_141328_add_notes_denorm_to_consumables_users.php b/database/migrations/2022_08_10_141328_add_notes_denorm_to_consumables_users.php new file mode 100644 index 0000000000..a3c82cda89 --- /dev/null +++ b/database/migrations/2022_08_10_141328_add_notes_denorm_to_consumables_users.php @@ -0,0 +1,44 @@ +text('note')->nullable()->default(null); + }); + + Schema::table('components_assets', function (Blueprint $table) { + $table->text('note')->nullable()->default(null); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('consumables_users', function (Blueprint $table) { + if (Schema::hasColumn('consumables_users', 'note')) { + $table->dropColumn('note'); + } + }); + + Schema::table('components_assets', function (Blueprint $table) { + if (Schema::hasColumn('components_assets', 'note')) { + $table->dropColumn('note'); + } + }); + } +}