Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Commit

Permalink
update database schema
Browse files Browse the repository at this point in the history
  • Loading branch information
FemiNoviaLina committed May 13, 2022
1 parent ad723e3 commit 631a5eb
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 58 deletions.
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"guzzlehttp/guzzle": "^7.2",
"laravel/framework": "^9.11",
"laravel/sanctum": "^2.14.1",
"laravel/tinker": "^2.7",
"midtrans/midtrans-php": "^2.5"
"laravel/tinker": "^2.7"
},
"require-dev": {
"fakerphp/faker": "^1.9.1",
Expand Down
57 changes: 1 addition & 56 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions database/migrations/2022_05_12_130154_create_orders_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,29 @@ public function up()
{
Schema::create('orders', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('user_id')->references('id')->on('users');
$table->unsignedBigInteger('vehicle_id')->references('id')->on('vehicles');
$table->string('phone_1');
$table->string('phone_2');
$table->string('address_id');
$table->string('address_mlg');
$table->time('pickup_time');
$table->date('pickup_date');
$table->string('pickup_address');
$table->time('dropoff_time');
$table->date('dropoff_date');
$table->string('dropoff_address');
$table->string('id_card');
$table->string('id_card_2');
$table->string('driver_license');
$table->float('total_price', 10, 2);
$table->string('note');
$table->enum('order_status', ['PENDING', 'REJECTED', 'WAITING_FOR_PAYMENT', 'PAYMENT_DONE', 'CANCELED', 'COMPLETED']);
$table->string('payment_method')->nullable();
$table->string('transaction_id')->nullable();
$table->string('virtual_account')->nullable();
$table->string('qr_link')->nullable();
$table->string('deep_link')->nullable();
$table->timestamps();
});
}
Expand Down
35 changes: 35 additions & 0 deletions database/migrations/2022_05_13_062551_update_users_table.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function (Blueprint $table) {
$table->string('phone_1');
$table->string('phone_2');
$table->string('address_id');
$table->string('address_mlg');
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn('role');
});
}
};

0 comments on commit 631a5eb

Please sign in to comment.