source: database/migrations/2019_05_03_000002_create_subscriptions_table.php

Last change on this file was dfae77e, checked in by Igor Danilovski <igor_danilovski@…>, 2 years ago
  • Initial commit;
  • Property mode set to 100644
File size: 1.1 KB
RevLine 
[dfae77e]1<?php
2
3use Illuminate\Database\Migrations\Migration;
4use Illuminate\Database\Schema\Blueprint;
5use Illuminate\Support\Facades\Schema;
6
7class 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.