2019_04_19_030442_create_payments_table.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. // Copyright 2019 Hackware SpA <human@hackware.cl>
  3. // This file is part of "Hackware Web Services Payment" 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 CreatePaymentsTable extends Migration
  11. {
  12. /**
  13. * Run the migrations.
  14. *
  15. * @return void
  16. */
  17. public function up()
  18. {
  19. Schema::create('payments', function (Blueprint $table) {
  20. $table->uuid('uuid')->primary();
  21. $table->string('user_uid', 100);
  22. $table->string('gateway', 100);
  23. $table->char('currency', 3);
  24. $table->integer('amount');
  25. $table->string('description', 255)->nullable();
  26. $table->text('detail')->nullable();
  27. $table->string('status', 9); // pending|completed|aborted
  28. $table->timestamps();
  29. });
  30. }
  31. /**
  32. * Reverse the migrations.
  33. *
  34. * @return void
  35. */
  36. public function down()
  37. {
  38. Schema::dropIfExists('payments');
  39. }
  40. }