for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Uccello\Core\Database\Migrations\Migration;
class CreateFiltersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
Schema::create($this->tablePrefix.'filters', function(Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('module_id');
$table->unsignedInteger('domain_id')->nullable();
$table->unsignedInteger('user_id')->nullable();
$table->string('name');
$table->string('type');
$table->text('columns');
$table->text('conditions')->nullable();
$table->string('order_by')->nullable();
$table->boolean('is_default')->default(false);
$table->boolean('is_public')->default(false);
$table->text('data')->nullable();
$table->timestamps();
// Foreign keys
$table->foreign('module_id')
->references('id')->on($this->tablePrefix.'modules')
->onDelete('cascade');
$table->foreign('domain_id')
->references('id')->on($this->tablePrefix.'domains')
$table->foreign('user_id')
->references('id')->on('users')
});
}
* Reverse the migrations.
public function down()
Schema::dropIfExists($this->tablePrefix.'filters');