Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- use Illuminate\Database\Schema\Blueprint;
- use Illuminate\Database\Migrations\Migration;
- class CreateBalanceTable extends Migration {
- /**
- * Run the migrations.
- *
- * @return void
- */
- public function up()
- {
- Schema::create('balance', function(Blueprint $table)
- {
- $table->increments('id');
- $table->timestamps();
- $table->integer('client_id');
- $table->foreign('client_id')->references('id')->on('clients');
- $table->double("amount");
- $table->boolean("is_positive");
- }
- );
- }
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::drop('balance');
- }
- }
- use Illuminate\Database\Schema\Blueprint;
- use Illuminate\Database\Migrations\Migration;
- class CreateClientsTable extends Migration {
- /**
- * Run the migrations.
- *
- * @return void
- */
- public function up()
- {
- Schema::create('clients', function(Blueprint $table)
- {
- $table->increments('id');
- $table->timestamps();
- $table->string('name');
- });
- }
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::drop('clients');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement