Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop Database Tables on Migration Rollback #62

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;

return new class extends Migration {
public function up()
Expand All @@ -10,6 +12,25 @@ public function up()

public function down()
{
//
Schema::disableForeignKeyConstraints();

Schema::dropIfExists('bot_user');
Schema::dropIfExists('bot_chat');
Schema::dropIfExists('bot_user_chat');
Schema::dropIfExists('bot_inline_query');
Schema::dropIfExists('bot_chosen_inline_result');
Schema::dropIfExists('bot_message');
Schema::dropIfExists('bot_edited_message');
Schema::dropIfExists('bot_callback_query');
Schema::dropIfExists('bot_shipping_query');
Schema::dropIfExists('bot_pre_checkout_query');
Schema::dropIfExists('bot_poll');
Schema::dropIfExists('bot_poll_answer');
Schema::dropIfExists('bot_chat_member_updated');
Schema::dropIfExists('bot_telegram_update');
Schema::dropIfExists('bot_conversation');
Schema::dropIfExists('bot_request_limiter');

Schema::enableForeignKeyConstraints();
}
};
6 changes: 5 additions & 1 deletion database/migrations/2022_02_18_175100_update_to_0.75.0.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;

return new class extends Migration {
public function up()
Expand All @@ -10,6 +12,8 @@ public function up()

public function down()
{
//
Schema::disableForeignKeyConstraints();
Schema::dropIfExists('bot_chat_join_request');
Schema::enableForeignKeyConstraints();
}
};
1 change: 1 addition & 0 deletions database/migrations/2022_04_24_175700_update_to_0.77.0.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;

return new class extends Migration {
public function up()
Expand Down
1 change: 1 addition & 0 deletions database/migrations/2022_10_04_221900_update_to_0.78.0.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;

return new class extends Migration {
public function up()
Expand Down