Advertisement
refda21

create_workshops_table.php

Mar 11th, 2021
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.69 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 CreateWorkshopsTable extends Migration
  8. {
  9.     /**
  10.      * Run the migrations.
  11.      *
  12.      * @return void
  13.      */
  14.     public function up()
  15.     {
  16.         Schema::create('workshops', function (Blueprint $table) {
  17.             $table->id();
  18.             $table->string('title')->nullable();
  19.             $table->string('flyer')->nullable();
  20.             $table->string('date')->nullable();
  21.             $table->string('status')->nullable();
  22.             $table->string('status_icon')->nullable();
  23.             $table->string('type')->nullable();
  24.             $table->string('admission')->nullable();
  25.             $table->string('time_start')->nullable();
  26.             $table->string('time_finish')->nullable();
  27.             $table->string('platform')->nullable();
  28.             $table->string('refundable')->nullable();
  29.             $table->string('reschedule')->nullable();
  30.             $table->string('description')->nullable();
  31.             $table->string('class_type')->nullable();
  32.             $table->json('requirement')->nullable();
  33.             $table->json('ticket_include')->nullable();
  34.             $table->string('capacity')->nullable();
  35.             $table->string('media_type')->nullable();
  36.             $table->string('location')->nullable();
  37.             $table->json('content')->nullable();
  38.             $table->string('link_workshop')->nullable();
  39.             $table->integer('price_workshop')->nullable();
  40.             $table->longText('address')->nullable();
  41.             $table->string('category_workshop')->nullable();
  42.  
  43.             $table->string('workshop_certificate_title')->nullable();
  44.             $table->string('workshop_certificate_type')->nullable();
  45.             $table->string('workshop_certificate_shape')->nullable();
  46.             $table->string('workshop_certificate_file')->nullable();
  47.             $table->date('workshop_certificate_date')->nullable();
  48.             $table->string('workshop_certificate_present')->nullable();
  49.  
  50.             $table->unsignedBigInteger('rate_workshop_id')->nullable();
  51.             $table->unsignedBigInteger('user_id');
  52.  
  53.             $table->foreign('rate_workshop_id')->references('id')->on('rate_workshops')
  54.                 ->onUpdate('cascade')->onDelete('cascade');
  55.             $table->foreign('user_id')->references('id')->on('users')
  56.                 ->onUpdate('cascade')->onDelete('cascade');
  57.             $table->timestamps();
  58.         });
  59.     }
  60.  
  61.     /**
  62.      * Reverse the migrations.
  63.      *
  64.      * @return void
  65.      */
  66.     public function down()
  67.     {
  68.         Schema::dropIfExists('workshops');
  69.     }
  70. }
  71.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement