Fixes some sqlite issues

This commit is contained in:
Berkay Güre 2018-07-18 22:10:30 +03:00
parent 2a1252e6fc
commit 4dea986ecb
2 changed files with 21 additions and 9 deletions

View File

@ -28,11 +28,13 @@ class AddCurrencyColumns extends Migration
public function down() public function down()
{ {
Schema::table('currencies', function ($table) { Schema::table('currencies', function ($table) {
$table->dropColumn('precision'); $table->dropColumn([
$table->dropColumn('symbol'); 'precision',
$table->dropColumn('symbol_first'); 'symbol',
$table->dropColumn('decimal_mark'); 'symbol_first',
$table->dropColumn('thousands_separator'); 'decimal_mark',
'thousands_separator',
]);
}); });
} }
} }

View File

@ -11,12 +11,22 @@ class AddCategoryColumnInvoicesBills extends Migration
*/ */
public function up() public function up()
{ {
Schema::table('invoices', function ($table) { $driver = Schema::connection($this->getConnection())->getConnection()->getDriverName();
$table->integer('category_id');
Schema::table('invoices', function ($table) use($driver) {
if($driver === 'sqlite'){
$table->integer('category_id')->default();
}else{
$table->integer('category_id');
}
}); });
Schema::table('bills', function ($table) { Schema::table('bills', function ($table) use($driver) {
$table->integer('category_id'); if($driver === 'sqlite'){
$table->integer('category_id')->default();
}else{
$table->integer('category_id');
}
}); });
} }