Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- use Illuminate\Database\Migrations\Migration;
- use Illuminate\Database\Schema\Blueprint;
- use Illuminate\Support\Facades\Schema;
- class AddTableVendas extends Migration
- {
- /**
- * Run the migrations.
- *
- * @return void
- */
- public function up()
- {
- Schema::create('vendas', function (Blueprint $table) {
- $table->bigIncrements('id');
- $table->string('url_pagamento');
- $table->string('tipo_pagamento');
- $table->string('status');
- $table->integer('user_id');
- $table->integer('plano_id')->unsignedBigInteger();
- $table->integer('cupon_id')->unsignedBigInteger();
- $table->foreign('plano_id')
- ->references('id')->on('planos')
- ->onDelete('cascade');
- $table->foreign('cupon_id')
- ->references('id')->on('cupons')
- ->onDelete('cascade');
- $table->timestamps();
- });
- }
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::dropIfExists('vendas');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement