-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added 'lang_start' into personal form.
- Loading branch information
1 parent
b1c935b
commit 8b9b648
Showing
7 changed files
with
399 additions
and
154 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
database/migrations/2023_02_20_195717_add_lang_start_to_users.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\DB; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
class AddLangStartToUsers extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::table('users', function (Blueprint $table) { | ||
DB::statement('SET FOREIGN_KEY_CHECKS = 0;'); | ||
DB::statement('TRUNCATE TABLE user_test_cards;'); | ||
DB::statement('TRUNCATE TABLE user_tests;'); | ||
DB::statement('TRUNCATE TABLE users;'); | ||
DB::statement('SET FOREIGN_KEY_CHECKS = 1;'); | ||
|
||
$table->integer('lang_start')->after('lang_level'); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::table('users', function (Blueprint $table) { | ||
$table->dropColumn('lang_start'); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.