Use dropIfExists

This commit is contained in:
James Cole
2022-02-19 05:20:42 +01:00
parent ec93b7b5a0
commit 7399edee2e
10 changed files with 47 additions and 47 deletions

View File

@@ -35,16 +35,16 @@ class CreateSupportTables extends Migration
*/ */
public function down(): void public function down(): void
{ {
Schema::drop('account_types'); Schema::dropIfExists('account_types');
Schema::drop('transaction_currencies'); Schema::dropIfExists('transaction_currencies');
Schema::drop('transaction_types'); Schema::dropIfExists('transaction_types');
Schema::drop('jobs'); Schema::dropIfExists('jobs');
Schema::drop('password_resets'); Schema::dropIfExists('password_resets');
Schema::drop('permission_role'); Schema::dropIfExists('permission_role');
Schema::drop('permissions'); Schema::dropIfExists('permissions');
Schema::drop('roles'); Schema::dropIfExists('roles');
Schema::drop('sessions'); Schema::dropIfExists('sessions');
Schema::drop('configuration'); Schema::dropIfExists('configuration');
} }
/** /**

View File

@@ -35,7 +35,7 @@ class CreateUsersTable extends Migration
*/ */
public function down(): void public function down(): void
{ {
Schema::drop('users'); Schema::dropIfExists('users');
} }
/** /**

View File

@@ -35,34 +35,34 @@ class CreateMainTables extends Migration
*/ */
public function down(): void public function down(): void
{ {
Schema::drop('account_meta'); Schema::dropIfExists('account_meta');
Schema::drop('piggy_bank_repetitions'); Schema::dropIfExists('piggy_bank_repetitions');
Schema::drop('attachments'); Schema::dropIfExists('attachments');
Schema::drop('limit_repetitions'); Schema::dropIfExists('limit_repetitions');
Schema::drop('budget_limits'); Schema::dropIfExists('budget_limits');
Schema::drop('export_jobs'); Schema::dropIfExists('export_jobs');
Schema::drop('import_jobs'); Schema::dropIfExists('import_jobs');
Schema::drop('preferences'); Schema::dropIfExists('preferences');
Schema::drop('role_user'); Schema::dropIfExists('role_user');
Schema::drop('rule_actions'); Schema::dropIfExists('rule_actions');
Schema::drop('rule_triggers'); Schema::dropIfExists('rule_triggers');
Schema::drop('rules'); Schema::dropIfExists('rules');
Schema::drop('rule_groups'); Schema::dropIfExists('rule_groups');
Schema::drop('category_transaction'); Schema::dropIfExists('category_transaction');
Schema::drop('budget_transaction'); Schema::dropIfExists('budget_transaction');
Schema::drop('transactions'); Schema::dropIfExists('transactions');
Schema::drop('piggy_bank_events'); Schema::dropIfExists('piggy_bank_events');
Schema::drop('piggy_banks'); Schema::dropIfExists('piggy_banks');
Schema::drop('accounts'); Schema::dropIfExists('accounts');
Schema::drop('category_transaction_journal'); Schema::dropIfExists('category_transaction_journal');
Schema::drop('budget_transaction_journal'); Schema::dropIfExists('budget_transaction_journal');
Schema::drop('categories'); Schema::dropIfExists('categories');
Schema::drop('budgets'); Schema::dropIfExists('budgets');
Schema::drop('tag_transaction_journal'); Schema::dropIfExists('tag_transaction_journal');
Schema::drop('tags'); Schema::dropIfExists('tags');
Schema::drop('journal_meta'); Schema::dropIfExists('journal_meta');
Schema::drop('transaction_journals'); Schema::dropIfExists('transaction_journals');
Schema::drop('bills'); Schema::dropIfExists('bills');
} }
/** /**

View File

@@ -36,7 +36,7 @@ class ChangesForV440 extends Migration
public function down(): void public function down(): void
{ {
if (Schema::hasTable('currency_exchange_rates')) { if (Schema::hasTable('currency_exchange_rates')) {
Schema::drop('currency_exchange_rates'); Schema::dropIfExists('currency_exchange_rates');
} }
Schema::table( Schema::table(

View File

@@ -38,7 +38,7 @@ class CreateOauthAuthCodesTable extends Migration
*/ */
public function down(): void public function down(): void
{ {
Schema::drop('oauth_auth_codes'); Schema::dropIfExists('oauth_auth_codes');
} }
/** /**

View File

@@ -38,7 +38,7 @@ class CreateOauthAccessTokensTable extends Migration
*/ */
public function down(): void public function down(): void
{ {
Schema::drop('oauth_access_tokens'); Schema::dropIfExists('oauth_access_tokens');
} }
/** /**

View File

@@ -38,7 +38,7 @@ class CreateOauthRefreshTokensTable extends Migration
*/ */
public function down(): void public function down(): void
{ {
Schema::drop('oauth_refresh_tokens'); Schema::dropIfExists('oauth_refresh_tokens');
} }
/** /**

View File

@@ -38,7 +38,7 @@ class CreateOauthClientsTable extends Migration
*/ */
public function down(): void public function down(): void
{ {
Schema::drop('oauth_clients'); Schema::dropIfExists('oauth_clients');
} }
/** /**

View File

@@ -38,7 +38,7 @@ class CreateOauthPersonalAccessClientsTable extends Migration
*/ */
public function down(): void public function down(): void
{ {
Schema::drop('oauth_personal_access_clients'); Schema::dropIfExists('oauth_personal_access_clients');
} }
/** /**

View File

@@ -39,7 +39,7 @@ class ChangesForV550 extends Migration
public function down() public function down()
{ {
// recreate jobs table. // recreate jobs table.
Schema::drop('jobs'); Schema::dropIfExists('jobs');
Schema::create( Schema::create(
'jobs', 'jobs',
static function (Blueprint $table) { static function (Blueprint $table) {
@@ -88,7 +88,7 @@ class ChangesForV550 extends Migration
public function up() public function up()
{ {
// drop and recreate jobs table. // drop and recreate jobs table.
Schema::drop('jobs'); Schema::dropIfExists('jobs');
// this is the NEW table // this is the NEW table
Schema::create( Schema::create(
'jobs', function (Blueprint $table) { 'jobs', function (Blueprint $table) {