Advertisement
Guest User

Untitled

a guest
Apr 29th, 2015
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.16 KB | None | 0 0
  1. <?php
  2.  
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5.  
  6. class CreateBalanceTable extends Migration {
  7.  
  8.     /**
  9.      * Run the migrations.
  10.      *
  11.      * @return void
  12.      */
  13.     public function up()
  14.     {
  15.         Schema::create('balance', function(Blueprint $table)
  16.         {
  17.             $table->increments('id');
  18.             $table->timestamps();
  19.             $table->integer('client_id');
  20.             $table->foreign('client_id')->references('id')->on('clients');
  21.             $table->double("amount");
  22.             $table->boolean("is_positive");
  23.         }
  24.         );
  25.     }
  26.  
  27.     /**
  28.      * Reverse the migrations.
  29.      *
  30.      * @return void
  31.      */
  32.     public function down()
  33.     {
  34.         Schema::drop('balance');
  35.     }
  36.  
  37. }
  38.  
  39.  
  40.  
  41. use Illuminate\Database\Schema\Blueprint;
  42. use Illuminate\Database\Migrations\Migration;
  43.  
  44. class CreateClientsTable extends Migration {
  45.  
  46.     /**
  47.      * Run the migrations.
  48.      *
  49.      * @return void
  50.      */
  51.     public function up()
  52.     {
  53.         Schema::create('clients', function(Blueprint $table)
  54.         {
  55.             $table->increments('id');
  56.             $table->timestamps();
  57.             $table->string('name');
  58.         });
  59.     }
  60.  
  61.     /**
  62.      * Reverse the migrations.
  63.      *
  64.      * @return void
  65.      */
  66.     public function down()
  67.     {
  68.         Schema::drop('clients');
  69.     }
  70.  
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement