Conditions | 1 |
Paths | 1 |
Total Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
15 | public function up(): void |
||
16 | { |
||
17 | Schema::create(config('rinvex.subscriptions.tables.plan_subscription_usage'), function (Blueprint $table) { |
||
18 | $table->increments('id'); |
||
19 | $table->integer('subscription_id')->unsigned(); |
||
20 | $table->integer('feature_id')->unsigned(); |
||
21 | $table->smallInteger('used')->unsigned(); |
||
22 | $table->dateTime('valid_until')->nullable(); |
||
23 | $table->string('timezone')->nullable(); |
||
24 | $table->timestamps(); |
||
25 | $table->softDeletes(); |
||
26 | |||
27 | $table->unique(['subscription_id', 'feature_id']); |
||
28 | $table->foreign('subscription_id')->references('id')->on(config('rinvex.subscriptions.tables.plan_subscriptions')) |
||
29 | ->onDelete('cascade')->onUpdate('cascade'); |
||
30 | $table->foreign('feature_id')->references('id')->on(config('rinvex.subscriptions.tables.plan_features')) |
||
31 | ->onDelete('cascade')->onUpdate('cascade'); |
||
32 | }); |
||
33 | } |
||
34 | |||
45 |