mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for initial setup
This commit is contained in:
parent
3202d2480f
commit
6c4009d1ef
@ -9,37 +9,37 @@ class ConfideSetupUsersTable extends Migration {
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::dropIfExists('payment_terms');
|
Schema::dropIfExists('payment_terms');
|
||||||
Schema::dropIfExists('themes');
|
Schema::dropIfExists('themes');
|
||||||
Schema::dropIfExists('credits');
|
Schema::dropIfExists('credits');
|
||||||
Schema::dropIfExists('activities');
|
Schema::dropIfExists('activities');
|
||||||
Schema::dropIfExists('invitations');
|
Schema::dropIfExists('invitations');
|
||||||
Schema::dropIfExists('payments');
|
Schema::dropIfExists('payments');
|
||||||
Schema::dropIfExists('account_gateways');
|
Schema::dropIfExists('account_gateways');
|
||||||
Schema::dropIfExists('invoice_items');
|
Schema::dropIfExists('invoice_items');
|
||||||
Schema::dropIfExists('products');
|
Schema::dropIfExists('products');
|
||||||
Schema::dropIfExists('tax_rates');
|
Schema::dropIfExists('tax_rates');
|
||||||
Schema::dropIfExists('contacts');
|
Schema::dropIfExists('contacts');
|
||||||
Schema::dropIfExists('invoices');
|
Schema::dropIfExists('invoices');
|
||||||
Schema::dropIfExists('password_reminders');
|
Schema::dropIfExists('password_reminders');
|
||||||
Schema::dropIfExists('clients');
|
Schema::dropIfExists('clients');
|
||||||
Schema::dropIfExists('users');
|
Schema::dropIfExists('users');
|
||||||
Schema::dropIfExists('accounts');
|
Schema::dropIfExists('accounts');
|
||||||
Schema::dropIfExists('currencies');
|
Schema::dropIfExists('currencies');
|
||||||
Schema::dropIfExists('invoice_statuses');
|
Schema::dropIfExists('invoice_statuses');
|
||||||
Schema::dropIfExists('countries');
|
Schema::dropIfExists('countries');
|
||||||
Schema::dropIfExists('timezones');
|
Schema::dropIfExists('timezones');
|
||||||
Schema::dropIfExists('frequencies');
|
Schema::dropIfExists('frequencies');
|
||||||
Schema::dropIfExists('date_formats');
|
Schema::dropIfExists('date_formats');
|
||||||
Schema::dropIfExists('datetime_formats');
|
Schema::dropIfExists('datetime_formats');
|
||||||
Schema::dropIfExists('sizes');
|
Schema::dropIfExists('sizes');
|
||||||
Schema::dropIfExists('industries');
|
Schema::dropIfExists('industries');
|
||||||
Schema::dropIfExists('gateways');
|
Schema::dropIfExists('gateways');
|
||||||
Schema::dropIfExists('payment_types');
|
Schema::dropIfExists('payment_types');
|
||||||
|
|
||||||
Schema::create('countries', function($table)
|
Schema::create('countries', function($table)
|
||||||
{
|
{
|
||||||
$table->increments('id');
|
$table->increments('id');
|
||||||
$table->string('capital', 255)->nullable();
|
$table->string('capital', 255)->nullable();
|
||||||
$table->string('citizenship', 255)->nullable();
|
$table->string('citizenship', 255)->nullable();
|
||||||
@ -53,7 +53,7 @@ class ConfideSetupUsersTable extends Migration {
|
|||||||
$table->string('name', 255)->default('');
|
$table->string('name', 255)->default('');
|
||||||
$table->string('region_code', 3)->default('');
|
$table->string('region_code', 3)->default('');
|
||||||
$table->string('sub_region_code', 3)->default('');
|
$table->string('sub_region_code', 3)->default('');
|
||||||
$table->boolean('eea')->default(0);
|
$table->boolean('eea')->default(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
Schema::create('themes', function($t)
|
Schema::create('themes', function($t)
|
||||||
@ -85,21 +85,21 @@ class ConfideSetupUsersTable extends Migration {
|
|||||||
Schema::create('date_formats', function($t)
|
Schema::create('date_formats', function($t)
|
||||||
{
|
{
|
||||||
$t->increments('id');
|
$t->increments('id');
|
||||||
$t->string('format');
|
$t->string('format');
|
||||||
$t->string('picker_format');
|
$t->string('picker_format');
|
||||||
$t->string('label');
|
$t->string('label');
|
||||||
});
|
});
|
||||||
|
|
||||||
Schema::create('datetime_formats', function($t)
|
Schema::create('datetime_formats', function($t)
|
||||||
{
|
{
|
||||||
$t->increments('id');
|
$t->increments('id');
|
||||||
$t->string('format');
|
$t->string('format');
|
||||||
$t->string('label');
|
$t->string('label');
|
||||||
});
|
});
|
||||||
|
|
||||||
Schema::create('currencies', function($t)
|
Schema::create('currencies', function($t)
|
||||||
{
|
{
|
||||||
$t->increments('id');
|
$t->increments('id');
|
||||||
|
|
||||||
$t->string('name');
|
$t->string('name');
|
||||||
$t->string('symbol');
|
$t->string('symbol');
|
||||||
@ -107,20 +107,20 @@ class ConfideSetupUsersTable extends Migration {
|
|||||||
$t->string('thousand_separator');
|
$t->string('thousand_separator');
|
||||||
$t->string('decimal_separator');
|
$t->string('decimal_separator');
|
||||||
$t->string('code');
|
$t->string('code');
|
||||||
});
|
});
|
||||||
|
|
||||||
Schema::create('sizes', function($t)
|
Schema::create('sizes', function($t)
|
||||||
{
|
{
|
||||||
$t->increments('id');
|
$t->increments('id');
|
||||||
$t->string('name');
|
$t->string('name');
|
||||||
});
|
});
|
||||||
|
|
||||||
Schema::create('industries', function($t)
|
Schema::create('industries', function($t)
|
||||||
{
|
{
|
||||||
$t->increments('id');
|
$t->increments('id');
|
||||||
$t->string('name');
|
$t->string('name');
|
||||||
});
|
});
|
||||||
|
|
||||||
Schema::create('accounts', function($t)
|
Schema::create('accounts', function($t)
|
||||||
{
|
{
|
||||||
$t->increments('id');
|
$t->increments('id');
|
||||||
@ -136,13 +136,13 @@ class ConfideSetupUsersTable extends Migration {
|
|||||||
$t->string('ip');
|
$t->string('ip');
|
||||||
$t->string('account_key')->unique();
|
$t->string('account_key')->unique();
|
||||||
$t->timestamp('last_login')->nullable();
|
$t->timestamp('last_login')->nullable();
|
||||||
|
|
||||||
$t->string('address1')->nullable();
|
$t->string('address1')->nullable();
|
||||||
$t->string('address2')->nullable();
|
$t->string('address2')->nullable();
|
||||||
$t->string('city')->nullable();
|
$t->string('city')->nullable();
|
||||||
$t->string('state')->nullable();
|
$t->string('state')->nullable();
|
||||||
$t->string('postal_code')->nullable();
|
$t->string('postal_code')->nullable();
|
||||||
$t->unsignedInteger('country_id')->nullable();
|
$t->unsignedInteger('country_id')->nullable();
|
||||||
$t->text('invoice_terms')->nullable();
|
$t->text('invoice_terms')->nullable();
|
||||||
$t->text('email_footer')->nullable();
|
$t->text('email_footer')->nullable();
|
||||||
$t->unsignedInteger('industry_id')->nullable();
|
$t->unsignedInteger('industry_id')->nullable();
|
||||||
@ -158,17 +158,17 @@ class ConfideSetupUsersTable extends Migration {
|
|||||||
$t->foreign('currency_id')->references('id')->on('currencies');
|
$t->foreign('currency_id')->references('id')->on('currencies');
|
||||||
$t->foreign('industry_id')->references('id')->on('industries');
|
$t->foreign('industry_id')->references('id')->on('industries');
|
||||||
$t->foreign('size_id')->references('id')->on('sizes');
|
$t->foreign('size_id')->references('id')->on('sizes');
|
||||||
});
|
});
|
||||||
|
|
||||||
Schema::create('gateways', function($t)
|
Schema::create('gateways', function($t)
|
||||||
{
|
{
|
||||||
$t->increments('id');
|
$t->increments('id');
|
||||||
$t->timestamps();
|
$t->timestamps();
|
||||||
|
|
||||||
$t->string('name');
|
$t->string('name');
|
||||||
$t->string('provider');
|
$t->string('provider');
|
||||||
$t->boolean('visible')->default(true);
|
$t->boolean('visible')->default(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
Schema::create('users', function($t)
|
Schema::create('users', function($t)
|
||||||
{
|
{
|
||||||
@ -206,31 +206,31 @@ class ConfideSetupUsersTable extends Migration {
|
|||||||
$t->unsignedInteger('gateway_id');
|
$t->unsignedInteger('gateway_id');
|
||||||
$t->timestamps();
|
$t->timestamps();
|
||||||
$t->softDeletes();
|
$t->softDeletes();
|
||||||
|
|
||||||
$t->text('config');
|
$t->text('config');
|
||||||
|
|
||||||
$t->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade');
|
$t->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade');
|
||||||
$t->foreign('gateway_id')->references('id')->on('gateways');
|
$t->foreign('gateway_id')->references('id')->on('gateways');
|
||||||
$t->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
$t->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||||
|
|
||||||
$t->unsignedInteger('public_id')->index();
|
$t->unsignedInteger('public_id')->index();
|
||||||
$t->unique( array('account_id','public_id') );
|
$t->unique( array('account_id','public_id') );
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
Schema::create('password_reminders', function($t)
|
Schema::create('password_reminders', function($t)
|
||||||
{
|
{
|
||||||
$t->string('email');
|
$t->string('email');
|
||||||
$t->timestamps();
|
$t->timestamps();
|
||||||
|
|
||||||
$t->string('token');
|
$t->string('token');
|
||||||
});
|
});
|
||||||
|
|
||||||
Schema::create('clients', function($t)
|
Schema::create('clients', function($t)
|
||||||
{
|
{
|
||||||
$t->increments('id');
|
$t->increments('id');
|
||||||
$t->unsignedInteger('user_id');
|
$t->unsignedInteger('user_id');
|
||||||
$t->unsignedInteger('account_id')->index();
|
$t->unsignedInteger('account_id')->index();
|
||||||
$t->unsignedInteger('currency_id')->nullable();
|
$t->unsignedInteger('currency_id')->nullable();
|
||||||
$t->timestamps();
|
$t->timestamps();
|
||||||
$t->softDeletes();
|
$t->softDeletes();
|
||||||
@ -255,14 +255,14 @@ class ConfideSetupUsersTable extends Migration {
|
|||||||
|
|
||||||
$t->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade');
|
$t->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade');
|
||||||
$t->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
$t->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||||
$t->foreign('country_id')->references('id')->on('countries');
|
$t->foreign('country_id')->references('id')->on('countries');
|
||||||
$t->foreign('industry_id')->references('id')->on('industries');
|
$t->foreign('industry_id')->references('id')->on('industries');
|
||||||
$t->foreign('size_id')->references('id')->on('sizes');
|
$t->foreign('size_id')->references('id')->on('sizes');
|
||||||
$t->foreign('currency_id')->references('id')->on('currencies');
|
$t->foreign('currency_id')->references('id')->on('currencies');
|
||||||
|
|
||||||
$t->unsignedInteger('public_id')->index();
|
$t->unsignedInteger('public_id')->index();
|
||||||
$t->unique( array('account_id','public_id') );
|
$t->unique( array('account_id','public_id') );
|
||||||
});
|
});
|
||||||
|
|
||||||
Schema::create('contacts', function($t)
|
Schema::create('contacts', function($t)
|
||||||
{
|
{
|
||||||
@ -279,14 +279,14 @@ class ConfideSetupUsersTable extends Migration {
|
|||||||
$t->string('last_name')->nullable();
|
$t->string('last_name')->nullable();
|
||||||
$t->string('email')->nullable();
|
$t->string('email')->nullable();
|
||||||
$t->string('phone')->nullable();
|
$t->string('phone')->nullable();
|
||||||
$t->timestamp('last_login')->nullable();
|
$t->timestamp('last_login')->nullable();
|
||||||
|
|
||||||
$t->foreign('client_id')->references('id')->on('clients')->onDelete('cascade');
|
$t->foreign('client_id')->references('id')->on('clients')->onDelete('cascade');
|
||||||
$t->foreign('user_id')->references('id')->on('users')->onDelete('cascade');;
|
$t->foreign('user_id')->references('id')->on('users')->onDelete('cascade');;
|
||||||
|
|
||||||
$t->unsignedInteger('public_id')->nullable();
|
$t->unsignedInteger('public_id')->nullable();
|
||||||
$t->unique( array('account_id','public_id') );
|
$t->unique( array('account_id','public_id') );
|
||||||
});
|
});
|
||||||
|
|
||||||
Schema::create('invoice_statuses', function($t)
|
Schema::create('invoice_statuses', function($t)
|
||||||
{
|
{
|
||||||
@ -325,15 +325,15 @@ class ConfideSetupUsersTable extends Migration {
|
|||||||
$t->timestamp('last_sent_date')->nullable();
|
$t->timestamp('last_sent_date')->nullable();
|
||||||
$t->unsignedInteger('recurring_invoice_id')->index()->nullable();
|
$t->unsignedInteger('recurring_invoice_id')->index()->nullable();
|
||||||
|
|
||||||
$t->string('tax_name');
|
$t->string('tax_name1');
|
||||||
$t->decimal('tax_rate', 13, 2);
|
$t->decimal('tax_rate1', 13, 3);
|
||||||
|
|
||||||
$t->decimal('amount', 13, 2);
|
$t->decimal('amount', 13, 2);
|
||||||
$t->decimal('balance', 13, 2);
|
$t->decimal('balance', 13, 2);
|
||||||
|
|
||||||
$t->foreign('client_id')->references('id')->on('clients')->onDelete('cascade');
|
$t->foreign('client_id')->references('id')->on('clients')->onDelete('cascade');
|
||||||
$t->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade');
|
$t->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade');
|
||||||
$t->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
$t->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||||
$t->foreign('invoice_status_id')->references('id')->on('invoice_statuses');
|
$t->foreign('invoice_status_id')->references('id')->on('invoice_statuses');
|
||||||
$t->foreign('recurring_invoice_id')->references('id')->on('invoices')->onDelete('cascade');
|
$t->foreign('recurring_invoice_id')->references('id')->on('invoices')->onDelete('cascade');
|
||||||
|
|
||||||
@ -375,11 +375,11 @@ class ConfideSetupUsersTable extends Migration {
|
|||||||
$t->softDeletes();
|
$t->softDeletes();
|
||||||
|
|
||||||
$t->string('name');
|
$t->string('name');
|
||||||
$t->decimal('rate', 13, 2);
|
$t->decimal('rate', 13, 3);
|
||||||
|
|
||||||
$t->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade');
|
$t->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade');
|
||||||
$t->foreign('user_id')->references('id')->on('users')->onDelete('cascade');;
|
$t->foreign('user_id')->references('id')->on('users')->onDelete('cascade');;
|
||||||
|
|
||||||
$t->unsignedInteger('public_id');
|
$t->unsignedInteger('public_id');
|
||||||
$t->unique( array('account_id','public_id') );
|
$t->unique( array('account_id','public_id') );
|
||||||
});
|
});
|
||||||
@ -396,10 +396,10 @@ class ConfideSetupUsersTable extends Migration {
|
|||||||
$t->text('notes');
|
$t->text('notes');
|
||||||
$t->decimal('cost', 13, 2);
|
$t->decimal('cost', 13, 2);
|
||||||
$t->decimal('qty', 13, 2)->nullable();
|
$t->decimal('qty', 13, 2)->nullable();
|
||||||
|
|
||||||
$t->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade');
|
$t->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade');
|
||||||
$t->foreign('user_id')->references('id')->on('users')->onDelete('cascade');;
|
$t->foreign('user_id')->references('id')->on('users')->onDelete('cascade');;
|
||||||
|
|
||||||
$t->unsignedInteger('public_id');
|
$t->unsignedInteger('public_id');
|
||||||
$t->unique( array('account_id','public_id') );
|
$t->unique( array('account_id','public_id') );
|
||||||
});
|
});
|
||||||
@ -420,8 +420,8 @@ class ConfideSetupUsersTable extends Migration {
|
|||||||
$t->decimal('cost', 13, 2);
|
$t->decimal('cost', 13, 2);
|
||||||
$t->decimal('qty', 13, 2)->nullable();
|
$t->decimal('qty', 13, 2)->nullable();
|
||||||
|
|
||||||
$t->string('tax_name')->nullable();
|
$t->string('tax_name1')->nullable();
|
||||||
$t->decimal('tax_rate', 13, 2)->nullable();
|
$t->decimal('tax_rate1', 13, 3)->nullable();
|
||||||
|
|
||||||
$t->foreign('invoice_id')->references('id')->on('invoices')->onDelete('cascade');
|
$t->foreign('invoice_id')->references('id')->on('invoices')->onDelete('cascade');
|
||||||
$t->foreign('product_id')->references('id')->on('products')->onDelete('cascade');
|
$t->foreign('product_id')->references('id')->on('products')->onDelete('cascade');
|
||||||
@ -458,10 +458,10 @@ class ConfideSetupUsersTable extends Migration {
|
|||||||
$t->foreign('account_gateway_id')->references('id')->on('account_gateways')->onDelete('cascade');
|
$t->foreign('account_gateway_id')->references('id')->on('account_gateways')->onDelete('cascade');
|
||||||
$t->foreign('user_id')->references('id')->on('users')->onDelete('cascade');;
|
$t->foreign('user_id')->references('id')->on('users')->onDelete('cascade');;
|
||||||
$t->foreign('payment_type_id')->references('id')->on('payment_types');
|
$t->foreign('payment_type_id')->references('id')->on('payment_types');
|
||||||
|
|
||||||
$t->unsignedInteger('public_id')->index();
|
$t->unsignedInteger('public_id')->index();
|
||||||
$t->unique( array('account_id','public_id') );
|
$t->unique( array('account_id','public_id') );
|
||||||
});
|
});
|
||||||
|
|
||||||
Schema::create('credits', function($t)
|
Schema::create('credits', function($t)
|
||||||
{
|
{
|
||||||
@ -471,21 +471,21 @@ class ConfideSetupUsersTable extends Migration {
|
|||||||
$t->unsignedInteger('user_id');
|
$t->unsignedInteger('user_id');
|
||||||
$t->timestamps();
|
$t->timestamps();
|
||||||
$t->softDeletes();
|
$t->softDeletes();
|
||||||
|
|
||||||
$t->boolean('is_deleted')->default(false);
|
$t->boolean('is_deleted')->default(false);
|
||||||
$t->decimal('amount', 13, 2);
|
$t->decimal('amount', 13, 2);
|
||||||
$t->decimal('balance', 13, 2);
|
$t->decimal('balance', 13, 2);
|
||||||
$t->date('credit_date')->nullable();
|
$t->date('credit_date')->nullable();
|
||||||
$t->string('credit_number')->nullable();
|
$t->string('credit_number')->nullable();
|
||||||
$t->text('private_notes');
|
$t->text('private_notes');
|
||||||
|
|
||||||
$t->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade');
|
$t->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade');
|
||||||
$t->foreign('client_id')->references('id')->on('clients')->onDelete('cascade');
|
$t->foreign('client_id')->references('id')->on('clients')->onDelete('cascade');
|
||||||
$t->foreign('user_id')->references('id')->on('users')->onDelete('cascade');;
|
$t->foreign('user_id')->references('id')->on('users')->onDelete('cascade');;
|
||||||
|
|
||||||
$t->unsignedInteger('public_id')->index();
|
$t->unsignedInteger('public_id')->index();
|
||||||
$t->unique( array('account_id','public_id') );
|
$t->unique( array('account_id','public_id') );
|
||||||
});
|
});
|
||||||
|
|
||||||
Schema::create('activities', function($t)
|
Schema::create('activities', function($t)
|
||||||
{
|
{
|
||||||
@ -500,13 +500,13 @@ class ConfideSetupUsersTable extends Migration {
|
|||||||
$t->unsignedInteger('invoice_id')->nullable();
|
$t->unsignedInteger('invoice_id')->nullable();
|
||||||
$t->unsignedInteger('credit_id')->nullable();
|
$t->unsignedInteger('credit_id')->nullable();
|
||||||
$t->unsignedInteger('invitation_id')->nullable();
|
$t->unsignedInteger('invitation_id')->nullable();
|
||||||
|
|
||||||
$t->text('message')->nullable();
|
$t->text('message')->nullable();
|
||||||
$t->text('json_backup')->nullable();
|
$t->text('json_backup')->nullable();
|
||||||
$t->integer('activity_type_id');
|
$t->integer('activity_type_id');
|
||||||
$t->decimal('adjustment', 13, 2)->nullable();
|
$t->decimal('adjustment', 13, 2)->nullable();
|
||||||
$t->decimal('balance', 13, 2)->nullable();
|
$t->decimal('balance', 13, 2)->nullable();
|
||||||
|
|
||||||
$t->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade');
|
$t->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade');
|
||||||
$t->foreign('client_id')->references('id')->on('clients')->onDelete('cascade');
|
$t->foreign('client_id')->references('id')->on('clients')->onDelete('cascade');
|
||||||
});
|
});
|
||||||
@ -519,9 +519,9 @@ class ConfideSetupUsersTable extends Migration {
|
|||||||
*/
|
*/
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::dropIfExists('payment_terms');
|
Schema::dropIfExists('payment_terms');
|
||||||
Schema::dropIfExists('themes');
|
Schema::dropIfExists('themes');
|
||||||
Schema::dropIfExists('credits');
|
Schema::dropIfExists('credits');
|
||||||
Schema::dropIfExists('activities');
|
Schema::dropIfExists('activities');
|
||||||
Schema::dropIfExists('invitations');
|
Schema::dropIfExists('invitations');
|
||||||
Schema::dropIfExists('payments');
|
Schema::dropIfExists('payments');
|
||||||
@ -535,16 +535,16 @@ class ConfideSetupUsersTable extends Migration {
|
|||||||
Schema::dropIfExists('clients');
|
Schema::dropIfExists('clients');
|
||||||
Schema::dropIfExists('users');
|
Schema::dropIfExists('users');
|
||||||
Schema::dropIfExists('accounts');
|
Schema::dropIfExists('accounts');
|
||||||
Schema::dropIfExists('currencies');
|
Schema::dropIfExists('currencies');
|
||||||
Schema::dropIfExists('invoice_statuses');
|
Schema::dropIfExists('invoice_statuses');
|
||||||
Schema::dropIfExists('countries');
|
Schema::dropIfExists('countries');
|
||||||
Schema::dropIfExists('timezones');
|
Schema::dropIfExists('timezones');
|
||||||
Schema::dropIfExists('frequencies');
|
Schema::dropIfExists('frequencies');
|
||||||
Schema::dropIfExists('date_formats');
|
Schema::dropIfExists('date_formats');
|
||||||
Schema::dropIfExists('datetime_formats');
|
Schema::dropIfExists('datetime_formats');
|
||||||
Schema::dropIfExists('sizes');
|
Schema::dropIfExists('sizes');
|
||||||
Schema::dropIfExists('industries');
|
Schema::dropIfExists('industries');
|
||||||
Schema::dropIfExists('gateways');
|
Schema::dropIfExists('gateways');
|
||||||
Schema::dropIfExists('payment_types');
|
Schema::dropIfExists('payment_types');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ class CreateVendorsTable extends Migration
|
|||||||
$table->foreign('vendor_id')->references('id')->on('vendors')->onDelete('cascade');
|
$table->foreign('vendor_id')->references('id')->on('vendors')->onDelete('cascade');
|
||||||
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||||
$table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade');
|
$table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade');
|
||||||
|
|
||||||
$table->unsignedInteger('public_id')->nullable();
|
$table->unsignedInteger('public_id')->nullable();
|
||||||
$table->unique(array('account_id', 'public_id'));
|
$table->unique(array('account_id', 'public_id'));
|
||||||
});
|
});
|
||||||
@ -79,7 +79,7 @@ class CreateVendorsTable extends Migration
|
|||||||
$table->date('expense_date')->nullable();
|
$table->date('expense_date')->nullable();
|
||||||
$table->text('private_notes');
|
$table->text('private_notes');
|
||||||
$table->text('public_notes');
|
$table->text('public_notes');
|
||||||
$table->unsignedInteger('currency_id')->nullable();
|
$table->unsignedInteger('invoice_currency_id')->nullable(false);
|
||||||
$table->boolean('should_be_invoiced')->default(true);
|
$table->boolean('should_be_invoiced')->default(true);
|
||||||
|
|
||||||
// Relations
|
// Relations
|
||||||
|
@ -35,13 +35,13 @@ class AddBankSubaccounts extends Migration {
|
|||||||
|
|
||||||
Schema::table('expenses', function($table)
|
Schema::table('expenses', function($table)
|
||||||
{
|
{
|
||||||
$table->string('transaction_id');
|
$table->string('transaction_id')->nullable();
|
||||||
$table->unsignedInteger('bank_id');
|
$table->unsignedInteger('bank_id')->nullable();
|
||||||
});
|
});
|
||||||
|
|
||||||
Schema::table('vendors', function($table)
|
Schema::table('vendors', function($table)
|
||||||
{
|
{
|
||||||
$table->string('transaction_name');
|
$table->string('transaction_name')->nullable();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -53,7 +53,7 @@ class AddBankSubaccounts extends Migration {
|
|||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::drop('bank_subaccounts');
|
Schema::drop('bank_subaccounts');
|
||||||
|
|
||||||
Schema::table('expenses', function($table)
|
Schema::table('expenses', function($table)
|
||||||
{
|
{
|
||||||
$table->dropColumn('transaction_id');
|
$table->dropColumn('transaction_id');
|
||||||
|
@ -25,20 +25,24 @@ class AddHeaderFooterOption extends Migration {
|
|||||||
$table->boolean('is_offsite');
|
$table->boolean('is_offsite');
|
||||||
$table->boolean('is_secure');
|
$table->boolean('is_secure');
|
||||||
});
|
});
|
||||||
|
|
||||||
Schema::table('expenses', function($table)
|
Schema::table('expenses', function($table)
|
||||||
{
|
{
|
||||||
$table->string('transaction_id')->nullable()->change();
|
if (Schema::hasColumn('expenses', 'transaction_id')) {
|
||||||
$table->unsignedInteger('bank_id')->nullable()->change();
|
$table->string('transaction_id')->nullable()->change();
|
||||||
});
|
$table->unsignedInteger('bank_id')->nullable()->change();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
Schema::table('vendors', function($table)
|
Schema::table('vendors', function($table)
|
||||||
{
|
{
|
||||||
$table->string('transaction_name')->nullable()->change();
|
if (Schema::hasColumn('vendors', 'transaction_name')) {
|
||||||
});
|
$table->string('transaction_name')->nullable()->change();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reverse the migrations.
|
* Reverse the migrations.
|
||||||
*
|
*
|
||||||
|
@ -16,10 +16,12 @@ class AddSourceCurrencyToExpenses extends Migration
|
|||||||
|
|
||||||
$table->dropColumn('foreign_amount');
|
$table->dropColumn('foreign_amount');
|
||||||
|
|
||||||
$table->unsignedInteger('currency_id')->nullable(false)->change();
|
if (Schema::hasColumn('expenses', 'currency_id')) {
|
||||||
$table->renameColumn('currency_id', 'invoice_currency_id');
|
$table->unsignedInteger('currency_id')->nullable(false)->change();
|
||||||
$table->unsignedInteger('expense_currency_id');
|
$table->renameColumn('currency_id', 'invoice_currency_id');
|
||||||
|
}
|
||||||
|
|
||||||
|
$table->unsignedInteger('expense_currency_id');
|
||||||
});
|
});
|
||||||
|
|
||||||
Schema::table('expenses', function (Blueprint $table) {
|
Schema::table('expenses', function (Blueprint $table) {
|
||||||
|
@ -11,7 +11,9 @@ class AddSupportThreeDecimalTaxes extends Migration {
|
|||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::table('tax_rates', function($table) {
|
Schema::table('tax_rates', function($table) {
|
||||||
$table->decimal('rate', 13, 3)->change();
|
if (Schema::hasColumn('tax_rates', 'rate')) {
|
||||||
|
$table->decimal('rate', 13, 3)->change();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
@ -13,30 +13,38 @@ class SupportMultipleTaxRates extends Migration
|
|||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::table('invoices', function($table) {
|
Schema::table('invoices', function($table) {
|
||||||
$table->decimal('tax_rate', 13, 3)->change();
|
if (Schema::hasColumn('invoices', 'tax_rate')) {
|
||||||
});
|
$table->decimal('tax_rate', 13, 3)->change();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
Schema::table('invoice_items', function($table) {
|
Schema::table('invoice_items', function($table) {
|
||||||
$table->decimal('tax_rate', 13, 3)->change();
|
if (Schema::hasColumn('invoice_items', 'tax_rate')) {
|
||||||
});
|
$table->decimal('tax_rate', 13, 3)->change();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
Schema::table('invoices', function($table) {
|
Schema::table('invoices', function($table) {
|
||||||
|
if (Schema::hasColumn('invoices', 'tax_rate')) {
|
||||||
$table->renameColumn('tax_rate', 'tax_rate1');
|
$table->renameColumn('tax_rate', 'tax_rate1');
|
||||||
$table->renameColumn('tax_name', 'tax_name1');
|
$table->renameColumn('tax_name', 'tax_name1');
|
||||||
$table->string('tax_name2')->nullable();
|
}
|
||||||
$table->decimal('tax_rate2', 13, 3);
|
$table->string('tax_name2')->nullable();
|
||||||
|
$table->decimal('tax_rate2', 13, 3);
|
||||||
});
|
});
|
||||||
|
|
||||||
Schema::table('invoice_items', function($table) {
|
Schema::table('invoice_items', function($table) {
|
||||||
|
if (Schema::hasColumn('invoice_items', 'tax_rate')) {
|
||||||
$table->renameColumn('tax_rate', 'tax_rate1');
|
$table->renameColumn('tax_rate', 'tax_rate1');
|
||||||
$table->renameColumn('tax_name', 'tax_name1');
|
$table->renameColumn('tax_name', 'tax_name1');
|
||||||
$table->string('tax_name2')->nullable();
|
}
|
||||||
$table->decimal('tax_rate2', 13, 3);
|
$table->string('tax_name2')->nullable();
|
||||||
|
$table->decimal('tax_rate2', 13, 3);
|
||||||
});
|
});
|
||||||
|
|
||||||
Schema::table('accounts', function($table) {
|
Schema::table('accounts', function($table) {
|
||||||
$table->boolean('enable_client_portal_dashboard')->default(true);
|
$table->boolean('enable_client_portal_dashboard')->default(true);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Reverse the migrations.
|
* Reverse the migrations.
|
||||||
@ -65,4 +73,4 @@ class SupportMultipleTaxRates extends Migration
|
|||||||
$table->dropColumn('enable_client_portal_dashboard');
|
$table->dropColumn('enable_client_portal_dashboard');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user