-
-
Notifications
You must be signed in to change notification settings - Fork 51
/
Copy path2023_01_16_000003_create_orders_table.php
39 lines (36 loc) · 1.28 KB
/
2023_01_16_000003_create_orders_table.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('lemon_squeezy_orders', function (Blueprint $table) {
$table->id();
$table->morphs('billable');
$table->string('lemon_squeezy_id')->unique();
$table->string('customer_id');
$table->uuid('identifier')->unique();
$table->string('product_id')->index();
$table->string('variant_id')->index();
$table->integer('order_number')->unique();
$table->string('currency');
$table->integer('subtotal');
$table->integer('discount_total');
$table->integer('tax');
$table->integer('total');
$table->string('tax_name')->nullable();
$table->string('status');
$table->string('receipt_url')->nullable();
$table->boolean('refunded');
$table->timestamp('refunded_at')->nullable();
$table->timestamp('ordered_at');
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('lemon_squeezy_orders');
}
};