invoiceninja/database/migrations/2014_04_17_145108_add_custom_fields.php
Jeramy Simpson 04c392136e Add Files
2015-03-17 07:45:25 +10:00

61 lines
1.2 KiB
PHP

<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddCustomFields extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('accounts', function($table)
{
$table->string('custom_label1')->nullable();
$table->string('custom_value1')->nullable();
$table->string('custom_label2')->nullable();
$table->string('custom_value2')->nullable();
$table->string('custom_client_label1')->nullable();
$table->string('custom_client_label2')->nullable();
});
Schema::table('clients', function($table)
{
$table->string('custom_value1')->nullable();
$table->string('custom_value2')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('accounts', function($table)
{
$table->dropColumn('custom_label1');
$table->dropColumn('custom_value1');
$table->dropColumn('custom_label2');
$table->dropColumn('custom_value2');
$table->dropColumn('custom_client_label1');
$table->dropColumn('custom_client_label2');
});
Schema::table('clients', function($table)
{
$table->dropColumn('custom_value1');
$table->dropColumn('custom_value2');
});
}
}