| @@ 16-29 (lines=14) @@ | ||
| 13 | */ |
|
| 14 | public function up() |
|
| 15 | { |
|
| 16 | Schema::create('plans', function (Blueprint $table) { |
|
| 17 | $table->engine = 'InnoDB'; |
|
| 18 | ||
| 19 | $table->increments('id'); |
|
| 20 | $table->string('name'); |
|
| 21 | $table->text('description')->nullable(); |
|
| 22 | $table->string('group', 100)->nullable(); |
|
| 23 | $table->integer('free_days')->default(0); |
|
| 24 | $table->tinyInteger('sort_order'); |
|
| 25 | $table->boolean('is_enabled')->default(0); |
|
| 26 | $table->boolean('is_default')->default(0); |
|
| 27 | ||
| 28 | $table->timestamps(); |
|
| 29 | }); |
|
| 30 | ||
| 31 | Schema::create('plan_intervals', function (Blueprint $table) { |
|
| 32 | $table->engine = 'InnoDB'; |
|
| @@ 47-62 (lines=16) @@ | ||
| 44 | $table->timestamps(); |
|
| 45 | }); |
|
| 46 | ||
| 47 | Schema::create('plan_features', function (Blueprint $table) { |
|
| 48 | $table->engine = 'InnoDB'; |
|
| 49 | ||
| 50 | $table->increments('id'); |
|
| 51 | $table->integer('plan_id')->unsigned(); |
|
| 52 | $table->string('code', 100); |
|
| 53 | $table->integer('value')->default(0); |
|
| 54 | $table->integer('sort_order')->nullable(); |
|
| 55 | $table->boolean('is_consumable')->default(0); |
|
| 56 | ||
| 57 | $table->foreign('plan_id') |
|
| 58 | ->references('id')->on('plans') |
|
| 59 | ->onDelete('cascade'); |
|
| 60 | ||
| 61 | $table->timestamps(); |
|
| 62 | }); |
|
| 63 | ||
| 64 | Schema::create('subscriptions', function (Blueprint $table) { |
|
| 65 | $table->engine = 'InnoDB'; |
|