Last change
on this file was dfae77e, checked in by Igor Danilovski <igor_danilovski@…>, 2 years ago |
|
-
Property mode
set to
100644
|
File size:
1.1 KB
|
Line | |
---|
1 | <?php
|
---|
2 |
|
---|
3 | use Illuminate\Database\Migrations\Migration;
|
---|
4 | use Illuminate\Database\Schema\Blueprint;
|
---|
5 | use Illuminate\Support\Facades\Schema;
|
---|
6 |
|
---|
7 | class CreateSubscriptionsTable extends Migration
|
---|
8 | {
|
---|
9 | /**
|
---|
10 | * Run the migrations.
|
---|
11 | *
|
---|
12 | * @return void
|
---|
13 | */
|
---|
14 | public function up()
|
---|
15 | {
|
---|
16 | Schema::create('subscriptions', function (Blueprint $table) {
|
---|
17 | $table->bigIncrements('id');
|
---|
18 | $table->unsignedBigInteger('user_id');
|
---|
19 | $table->string('name');
|
---|
20 | $table->string('stripe_id')->unique();
|
---|
21 | $table->string('stripe_status');
|
---|
22 | $table->string('stripe_price')->nullable();
|
---|
23 | $table->integer('quantity')->nullable();
|
---|
24 | $table->timestamp('trial_ends_at')->nullable();
|
---|
25 | $table->timestamp('ends_at')->nullable();
|
---|
26 | $table->timestamps();
|
---|
27 |
|
---|
28 | $table->index(['user_id', 'stripe_status']);
|
---|
29 | });
|
---|
30 | }
|
---|
31 |
|
---|
32 | /**
|
---|
33 | * Reverse the migrations.
|
---|
34 | *
|
---|
35 | * @return void
|
---|
36 | */
|
---|
37 | public function down()
|
---|
38 | {
|
---|
39 | Schema::dropIfExists('subscriptions');
|
---|
40 | }
|
---|
41 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.