Advertisement
Guest User

Untitled

a guest
Dec 7th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. <?php
  2.  
  3. use Illuminate\Database\Migrations\Migration;
  4. use Illuminate\Database\Schema\Blueprint;
  5. use Illuminate\Support\Facades\Schema;
  6.  
  7. class AddTableVendas extends Migration
  8. {
  9. /**
  10. * Run the migrations.
  11. *
  12. * @return void
  13. */
  14. public function up()
  15. {
  16. Schema::create('vendas', function (Blueprint $table) {
  17. $table->bigIncrements('id');
  18. $table->string('url_pagamento');
  19. $table->string('tipo_pagamento');
  20. $table->string('status');
  21. $table->integer('user_id');
  22. $table->integer('plano_id')->unsignedBigInteger();
  23. $table->integer('cupon_id')->unsignedBigInteger();
  24. $table->foreign('plano_id')
  25. ->references('id')->on('planos')
  26. ->onDelete('cascade');
  27. $table->foreign('cupon_id')
  28. ->references('id')->on('cupons')
  29. ->onDelete('cascade');
  30.  
  31.  
  32. $table->timestamps();
  33. });
  34. }
  35.  
  36. /**
  37. * Reverse the migrations.
  38. *
  39. * @return void
  40. */
  41. public function down()
  42. {
  43. Schema::dropIfExists('vendas');
  44. }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement