1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-12 22:22:32 +01:00

Added early_access field

This commit is contained in:
Hillel Coren 2016-01-07 13:09:21 +02:00
parent 4549643fdc
commit ecaf31ec95
3 changed files with 64 additions and 72 deletions

View File

@ -1,78 +1,70 @@
<?php <?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
class AddInvoiceFontSupport extends Migration { class AddInvoiceFontSupport extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::dropIfExists('fonts');
/** Schema::create('fonts', function ($t) {
* Run the migrations. $t->increments('id');
*
* @return void
*/
public function up()
{
Schema::dropIfExists('fonts');
Schema::create('fonts', function($t) $t->string('name');
{ $t->string('folder');
$t->increments('id'); $t->string('css_stack');
$t->smallInteger('css_weight')->default(400);
$t->string('name'); $t->string('google_font');
$t->string('folder'); $t->string('normal');
$t->string('css_stack'); $t->string('bold');
$t->smallInteger('css_weight')->default(400); $t->string('italics');
$t->string('google_font'); $t->string('bolditalics');
$t->string('normal'); $t->boolean('early_access');
$t->string('bold'); $t->unsignedInteger('sort_order')->default(10000);
$t->string('italics'); });
$t->string('bolditalics');
$t->unsignedInteger('sort_order')->default(10000);
});
// Create fonts
$seeder = new FontsSeeder();
$seeder->run();
Schema::table('accounts', function($table) // Create fonts
{ $seeder = new FontsSeeder();
$table->unsignedInteger('header_font_id')->default(1); $seeder->run();
$table->unsignedInteger('body_font_id')->default(1);
});
Schema::table('accounts', function($table) Schema::table('accounts', function ($table) {
{ $table->unsignedInteger('header_font_id')->default(1);
$table->foreign('header_font_id')->references('id')->on('fonts'); $table->unsignedInteger('body_font_id')->default(1);
$table->foreign('body_font_id')->references('id')->on('fonts'); });
});
}
/** Schema::table('accounts', function ($table) {
* Reverse the migrations. $table->foreign('header_font_id')->references('id')->on('fonts');
* $table->foreign('body_font_id')->references('id')->on('fonts');
* @return void });
*/ }
public function down()
{
if (Schema::hasColumn('accounts', 'header_font_id'))
{
Schema::table('accounts', function($table)
{
$table->dropForeign('accounts_header_font_foreign');
$table->dropColumn('header_font_id');
});
}
if (Schema::hasColumn('accounts', 'body_font_id'))
{
Schema::table('accounts', function($table)
{
$table->dropForeign('accounts_body_font_foreign');
$table->dropColumn('body_font_id');
});
}
Schema::dropIfExists('fonts'); /**
} * Reverse the migrations.
*
} * @return void
*/
public function down()
{
if (Schema::hasColumn('accounts', 'header_font_id')) {
Schema::table('accounts', function ($table) {
$table->dropForeign('accounts_header_font_foreign');
$table->dropColumn('header_font_id');
});
}
if (Schema::hasColumn('accounts', 'body_font_id')) {
Schema::table('accounts', function ($table) {
$table->dropForeign('accounts_body_font_foreign');
$table->dropColumn('body_font_id');
});
}
Schema::dropIfExists('fonts');
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long