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()
{
Schema::table('currencies', function ($table) {
$table->dropColumn('precision');
$table->dropColumn('symbol');
$table->dropColumn('symbol_first');
$table->dropColumn('decimal_mark');
$table->dropColumn('thousands_separator');
$table->dropColumn([
'precision',
'symbol',
'symbol_first',
'decimal_mark',
'thousands_separator',
]);
});
}
}

View File

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