Commit ed6f1e55daa94988304ce13bead172785d4d9160

Authored by Chris Bellas
1 parent 971ec84953

Added migration for od, mltd relations

Showing 1 changed file with 42 additions and 0 deletions

api/database/migrations/2021_07_26_070122_create_od_mltd_relations.php View file @ ed6f1e5
  1 +<?php
  2 +
  3 +use Illuminate\Database\Migrations\Migration;
  4 +use Illuminate\Database\Schema\Blueprint;
  5 +use Illuminate\Support\Facades\DB;
  6 +use Illuminate\Support\Facades\Schema;
  7 +
  8 +class CreateOdMltdRelations extends Migration
  9 +{
  10 + /**
  11 + * Run the migrations.
  12 + *
  13 + * @return void
  14 + */
  15 + public function up()
  16 + {
  17 + DB::statement('CREATE TABLE IF NOT EXISTS od(' .
  18 + 'uuid serial PRIMARY KEY,' .
  19 + 'asset_id VARCHAR (100) NOT NULL,' .
  20 + 'value REAL NOT NULL,' .
  21 + 'incident_date TIMESTAMP NOT NULL,' .
  22 + 'timeframe VARCHAR (355) NOT NULL,' .
  23 + 'created_on TIMESTAMP NOT NULL)');
  24 + DB::statement('CREATE TABLE IF NOT EXISTS od(' .
  25 + 'uuid serial PRIMARY KEY,' .
  26 + 'asset_id VARCHAR (100) NOT NULL,' .
  27 + 'probability REAL NOT NULL,' .
  28 + 'timeframe VARCHAR (355) NOT NULL,' .
  29 + 'created_on TIMESTAMP NOT NULL)');
  30 + }
  31 +
  32 + /**
  33 + * Reverse the migrations.
  34 + *
  35 + * @return void
  36 + */
  37 + public function down()
  38 + {
  39 + Schema::dropIfExists('od');
  40 + Schema::dropIfExists('mltd');
  41 + }
  42 +}