public function up()
{
Schema::table('accounts', function ($table) {
$table->string('page_size')->default('A4');
$table->boolean('live_preview')->default(true);
$table->smallInteger('invoice_number_padding')->default(4);
});
Schema::table('fonts', function ($table) {
$table->dropColumn('is_early_access');
});
Schema::create('expense_categories', function ($table) {
$table->increments('id');
$table->unsignedInteger('user_id');
$table->unsignedInteger('account_id')->index();
$table->timestamps();
$table->softDeletes();
$table->string('name')->nullable();
$table->unsignedInteger('public_id')->index();
});
Schema::table('expense_categories', function ($table) {
$table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade');
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
$table->unique(array('account_id', 'public_id'));
});
Schema::table('expenses', function ($table) {
$table->unsignedInteger('expense_category_id')->nullable()->index();
});
Schema::table('expenses', function ($table) {
$table->foreign('expense_category_id')->references('id')->on('expense_categories')->onDelete('cascade');
});
}