Adds default for category_id bills and invoices tables.
This commit is contained in:
parent
4dea986ecb
commit
1e4fe88735
@ -11,22 +11,12 @@ class AddCategoryColumnInvoicesBills extends Migration
|
|||||||
*/
|
*/
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
$driver = Schema::connection($this->getConnection())->getConnection()->getDriverName();
|
Schema::table('invoices', function ($table) {
|
||||||
|
$table->integer('category_id')->default();
|
||||||
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) use($driver) {
|
Schema::table('bills', function ($table) {
|
||||||
if($driver === 'sqlite'){
|
$table->integer('category_id')->default();
|
||||||
$table->integer('category_id')->default();
|
|
||||||
}else{
|
|
||||||
$table->integer('category_id');
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user