FEATURE: Add language into widgets
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddLanguageIntoWidgets extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('widgets', function (Blueprint $table) {
|
||||
$table->string('language', 8)
|
||||
->after('widget_type_handler')
|
||||
->default(\App::getLocale());
|
||||
|
||||
$table->foreign('language')
|
||||
->references('code')
|
||||
->on('languages')
|
||||
->onDelete('cascade')
|
||||
->onUpdate('cascade');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('widgets', function (Blueprint $table) {
|
||||
$table->dropForeign('widgets_language_foreign');
|
||||
$table->dropColumn('language');
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user