invoiceninja/database/migrations/2020_10_12_204517_project_number_column.php

49 lines
1 KiB
PHP
Raw Normal View History

2020-10-13 08:27:42 +11:00
<?php
/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://opensource.org/licenses/AAL
*/
2020-10-13 08:27:42 +11:00
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\Schema;
class ProjectNumberColumn extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
2020-11-25 15:19:52 +01:00
Schema::table('projects', function ($table) {
2020-10-13 08:27:42 +11:00
$table->string('number')->nullable();
2021-04-08 19:50:27 +10:00
$table->unique(['company_id', 'number']);
2020-10-13 08:27:42 +11:00
});
2020-10-13 15:08:56 +11:00
2020-11-25 15:19:52 +01:00
Schema::table('expenses', function ($t) {
2020-10-13 15:08:56 +11:00
$t->renameColumn('expense_date', 'date');
});
2020-10-13 15:14:13 +11:00
2020-11-25 15:19:52 +01:00
Schema::table('expense_categories', function ($t) {
2020-10-13 15:14:13 +11:00
$t->boolean('is_deleted')->default(false);
});
2020-10-13 08:27:42 +11:00
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}