| @@ 6-32 (lines=27) @@ | ||
| 3 | use Illuminate\Database\Migrations\Migration; |
|
| 4 | use Illuminate\Database\Schema\Blueprint; |
|
| 5 | ||
| 6 | class CreateItemsTable extends Migration { |
|
| 7 | ||
| 8 | public function up() |
|
| 9 | { |
|
| 10 | Schema::create('items', function(Blueprint $table) { |
|
| 11 | $table->increments('id'); |
|
| 12 | $table->uuid('uuid', 191)->unique(); |
|
| 13 | $table->string('keterangan', 191)->nullable(); |
|
| 14 | $table->double('tarif'); |
|
| 15 | $table->integer('jumlah'); |
|
| 16 | $table->double('subtotal'); |
|
| 17 | $table->integer('transaksi_id')->unsigned()->nullable()->index(); |
|
| 18 | $table->integer('tarif_id')->unsigned()->nullable()->index(); |
|
| 19 | $table->integer('rekening_id')->unsigned()->nullable()->index(); |
|
| 20 | $table->uuid('transaksi_uuid', 191)->index(); |
|
| 21 | $table->uuid('tarif_uuid', 191)->index(); |
|
| 22 | $table->uuid('rekening_uuid', 191)->index(); |
|
| 23 | $table->timestamps(); |
|
| 24 | $table->softDeletes(); |
|
| 25 | }); |
|
| 26 | } |
|
| 27 | ||
| 28 | public function down() |
|
| 29 | { |
|
| 30 | Schema::drop('items'); |
|
| 31 | } |
|
| 32 | } |
|
| 33 | ||
| @@ 6-33 (lines=28) @@ | ||
| 3 | use Illuminate\Database\Migrations\Migration; |
|
| 4 | use Illuminate\Database\Schema\Blueprint; |
|
| 5 | ||
| 6 | class CreateTransaksiesTable extends Migration { |
|
| 7 | ||
| 8 | public function up() |
|
| 9 | { |
|
| 10 | Schema::create('transaksies', function(Blueprint $table) { |
|
| 11 | $table->increments('id'); |
|
| 12 | $table->uuid('uuid', 191)->unique(); |
|
| 13 | $table->string('nomor', 191)->unique(); |
|
| 14 | $table->double('total'); |
|
| 15 | $table->double('grandtotal')->nullable(); |
|
| 16 | $table->double('denda')->default('0.00'); |
|
| 17 | $table->double('potongan'); |
|
| 18 | $table->integer('admin_id')->unsigned()->nullable()->index(); |
|
| 19 | $table->integer('customer_transaksi_id')->unsigned()->nullable()->index(); |
|
| 20 | $table->integer('tarif_id')->unsigned()->nullable(); |
|
| 21 | $table->uuid('admin_uuid', 191)->index(); |
|
| 22 | $table->uuid('customer_transaksi_uuid', 191)->index(); |
|
| 23 | $table->uuid('tarif_uuid')->index(); |
|
| 24 | $table->timestamps(); |
|
| 25 | $table->softDeletes(); |
|
| 26 | }); |
|
| 27 | } |
|
| 28 | ||
| 29 | public function down() |
|
| 30 | { |
|
| 31 | Schema::drop('transaksies'); |
|
| 32 | } |
|
| 33 | } |
|
| 34 | ||