| @@ 48-63 (lines=16) @@ | ||
| 45 | ||
| 46 | }); |
|
| 47 | ||
| 48 | Schema::create('plan_features', function(Blueprint $table) { |
|
| 49 | $table->engine = 'InnoDB'; |
|
| 50 | ||
| 51 | $table->increments('id'); |
|
| 52 | $table->integer('plan_id')->unsigned(); |
|
| 53 | $table->string('code', 100); |
|
| 54 | $table->integer('value')->default(0); |
|
| 55 | $table->integer('sort_order'); |
|
| 56 | $table->boolean('is_consumable')->default(0); |
|
| 57 | ||
| 58 | $table->foreign('plan_id') |
|
| 59 | ->references('id')->on('plans'); |
|
| 60 | ||
| 61 | $table->timestamps(); |
|
| 62 | ||
| 63 | }); |
|
| 64 | ||
| 65 | Schema::create('subscriptions', function(Blueprint $table) { |
|
| 66 | $table->engine = 'InnoDB'; |
|
| @@ 85-100 (lines=16) @@ | ||
| 82 | ||
| 83 | }); |
|
| 84 | ||
| 85 | Schema::create('subscriber_consumables', function(Blueprint $table) { |
|
| 86 | $table->engine = 'InnoDB'; |
|
| 87 | ||
| 88 | $table->increments('id'); |
|
| 89 | $table->integer('plan_feature_id')->unsigned(); |
|
| 90 | $table->string('subscriber_type'); |
|
| 91 | $table->integer('subscriber_id'); |
|
| 92 | $table->integer('available')->nullable(); |
|
| 93 | $table->integer('used')->nullable(); |
|
| 94 | ||
| 95 | $table->foreign('plan_feature_id') |
|
| 96 | ->references('id')->on('plans_features'); |
|
| 97 | ||
| 98 | $table->timestamps(); |
|
| 99 | ||
| 100 | }); |
|
| 101 | } |
|
| 102 | ||
| 103 | /** |
|