14 use Illuminate\Database\Migrations\Migration;
15 use Illuminate\Database\Schema\Builder;
16 use Illuminate\Database\Schema\Blueprint;
17 use Illuminate\Database\Capsule\Manager as Capsule;
24 public function up() {
26 Capsule::schema()->create(
'review_forms',
function (Blueprint $table) {
27 $table->bigInteger(
'review_form_id')->autoIncrement();
28 $table->bigInteger(
'assoc_type');
29 $table->bigInteger(
'assoc_id');
30 $table->float(
'seq', 8, 2)->nullable();
31 $table->smallInteger(
'is_active')->nullable();
35 Capsule::schema()->create(
'review_form_settings',
function (Blueprint $table) {
36 $table->bigInteger(
'review_form_id');
37 $table->string(
'locale', 14)->
default(
'');
38 $table->string(
'setting_name', 255);
39 $table->text(
'setting_value')->nullable();
40 $table->string(
'setting_type', 6);
41 $table->index([
'review_form_id'],
'review_form_settings_review_form_id');
42 $table->unique([
'review_form_id',
'locale',
'setting_name'],
'review_form_settings_pkey');
46 Capsule::schema()->create(
'review_form_elements',
function (Blueprint $table) {
47 $table->bigInteger(
'review_form_element_id')->autoIncrement();
48 $table->bigInteger(
'review_form_id');
49 $table->float(
'seq', 8, 2)->nullable();
50 $table->bigInteger(
'element_type')->nullable();
51 $table->smallInteger(
'required')->nullable();
52 $table->smallInteger(
'included')->nullable();
53 $table->index([
'review_form_id'],
'review_form_elements_review_form_id');
57 Capsule::schema()->create(
'review_form_element_settings',
function (Blueprint $table) {
58 $table->bigInteger(
'review_form_element_id');
59 $table->string(
'locale', 14)->
default(
'');
60 $table->string(
'setting_name', 255);
61 $table->text(
'setting_value')->nullable();
62 $table->string(
'setting_type', 6);
63 $table->index([
'review_form_element_id'],
'review_form_element_settings_review_form_element_id');
64 $table->unique([
'review_form_element_id',
'locale',
'setting_name'],
'review_form_element_settings_pkey');
68 Capsule::schema()->create(
'review_form_responses',
function (Blueprint $table) {
69 $table->bigInteger(
'review_form_element_id');
70 $table->bigInteger(
'review_id');
71 $table->string(
'response_type', 6)->nullable();
72 $table->text(
'response_value')->nullable();
73 $table->index([
'review_form_element_id',
'review_id'],
'review_form_responses_pkey');
82 Capsule::schema()->drop(
'review_form_responses');
83 Capsule::schema()->drop(
'review_form_element_settings');
84 Capsule::schema()->drop(
'review_form_elements');
85 Capsule::schema()->drop(
'review_form_settings');
86 Capsule::schema()->drop(
'review_forms');