mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-18 10:16:49 +00:00
Piggy bank can now have a group.
This commit is contained in:
52
database/migrations/2020_06_07_063612_changes_for_v530.php
Normal file
52
database/migrations/2020_06_07_063612_changes_for_v530.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
|
||||
/**
|
||||
* Class ChangesForV530
|
||||
*/
|
||||
class ChangesForV530 extends Migration
|
||||
{
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('object_groupables');
|
||||
Schema::dropIfExists('object_groups');
|
||||
}
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
if (!Schema::hasTable('object_groups')) {
|
||||
Schema::create(
|
||||
'object_groups', static function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->string('title', 255);
|
||||
$table->mediumInteger('order', false, true)->default(0);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
if (!Schema::hasTable('object_groupables')) {
|
||||
Schema::create(
|
||||
'object_groupables', static function (Blueprint $table) {
|
||||
$table->integer('object_group_id');
|
||||
$table->integer('object_groupable_id', false, true);
|
||||
$table->string('object_groupable_type', 255);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user