2019_02_21_152407_create_partial_payments_table.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. // Copyright 2019 Hackware SpA <human@hackware.cl>
  3. // This file is part of "Hackware Web Services Wallet" and licensed under
  4. // the terms of the GNU Affero General Public License version 3, or (at your
  5. // option) a later version. You should have received a copy of this license
  6. // along with the software. If not, see <https://www.gnu.org/licenses/>.
  7. use Illuminate\Support\Facades\Schema;
  8. use Illuminate\Database\Schema\Blueprint;
  9. use Illuminate\Database\Migrations\Migration;
  10. class CreatePartialPaymentsTable extends Migration
  11. {
  12. /**
  13. * Run the migrations.
  14. *
  15. * @return void
  16. */
  17. public function up()
  18. {
  19. Schema::create('partial_payments', function (Blueprint $table) {
  20. $table->integer('transaction_id')->unsigned()->primary();
  21. $table->foreign('transaction_id')
  22. ->references('id')
  23. ->on('transactions');
  24. $table->decimal('amount', 16, 8);
  25. $table->timestamps();
  26. });
  27. }
  28. /**
  29. * Reverse the migrations.
  30. *
  31. * @return void
  32. */
  33. public function down()
  34. {
  35. Schema::drop('partial_payments');
  36. }
  37. }