From 762fc0db72d4e6f0d5159487b09822c45dbdae34 Mon Sep 17 00:00:00 2001 From: farid saravi Date: Sat, 17 Aug 2019 18:25:48 +0430 Subject: [PATCH] add temp migrations --- ...054915_temp_append_role_name_en_column.php | 34 +++++++++++++++++ ...nd_permission_name_en_module_id_column.php | 36 ++++++++++++++++++ ...ule_virtual_activity_column_expires_at.php | 37 +++++++++++++++++++ 3 files changed, 107 insertions(+) create mode 100644 database/migrations/2019_08_12_054915_temp_append_role_name_en_column.php create mode 100644 database/migrations/2019_08_12_055107_temp_append_permission_name_en_module_id_column.php create mode 100644 database/migrations/2019_08_17_133716_temp_module_virtual_activity_column_expires_at.php diff --git a/database/migrations/2019_08_12_054915_temp_append_role_name_en_column.php b/database/migrations/2019_08_12_054915_temp_append_role_name_en_column.php new file mode 100644 index 0000000..e602f5c --- /dev/null +++ b/database/migrations/2019_08_12_054915_temp_append_role_name_en_column.php @@ -0,0 +1,34 @@ +string('name_en'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + if (Schema::hasColumn('tbl_roles', 'name_en')) { + Schema::table('tbl_roles', function (Blueprint $table) { + $table->dropColumn('name_en'); + }); + } + } +} diff --git a/database/migrations/2019_08_12_055107_temp_append_permission_name_en_module_id_column.php b/database/migrations/2019_08_12_055107_temp_append_permission_name_en_module_id_column.php new file mode 100644 index 0000000..2c65786 --- /dev/null +++ b/database/migrations/2019_08_12_055107_temp_append_permission_name_en_module_id_column.php @@ -0,0 +1,36 @@ +string('name_en'); + $table->unsignedInteger('module_id')->nullable(); + $table->index('module_id'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + if (Schema::hasColumn('tbl_permissions', 'name_en')) { + Schema::table('tbl_roles', function (Blueprint $table) { + $table->dropColumn('name_en'); + }); + } + } +} diff --git a/database/migrations/2019_08_17_133716_temp_module_virtual_activity_column_expires_at.php b/database/migrations/2019_08_17_133716_temp_module_virtual_activity_column_expires_at.php new file mode 100644 index 0000000..6f22ff8 --- /dev/null +++ b/database/migrations/2019_08_17_133716_temp_module_virtual_activity_column_expires_at.php @@ -0,0 +1,37 @@ +timestamp('expires_at')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + $dbName = config('core.db_name'); + if (Schema::hasColumn($dbName . '.module_virtual_activity', 'expires_at')) { + Schema::table($dbName . '.module_virtual_activity', function (Blueprint $table) { + $table->dropColumn('expires_at'); + }); + } + } +}