mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Lets see if this fixes the database.
This commit is contained in:
parent
1511f75a80
commit
cc55e2acee
@ -42,6 +42,9 @@ class CreatePiggybanksTable extends Migration
|
||||
$table->enum('rep_length', ['day', 'week', 'quarter', 'month', 'year'])->nullable();
|
||||
$table->smallInteger('rep_every')->unsigned();
|
||||
$table->smallInteger('rep_times')->unsigned()->nullable();
|
||||
$table->enum('reminder', ['day', 'week', 'quarter', 'month', 'year'])->nullable();
|
||||
$table->smallInteger('reminder_skip')->unsigned();
|
||||
$table->boolean('remind_me');
|
||||
$table->integer('order')->unsigned();
|
||||
|
||||
// connect account to piggy bank.
|
||||
|
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
|
||||
/**
|
||||
* @SuppressWarnings(PHPMD.ShortMethodName)
|
||||
*
|
||||
* Class CreateRemindersTable
|
||||
*
|
||||
*/
|
||||
class CreateRemindersTable extends Migration
|
||||
{
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::drop('reminders');
|
||||
}
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create(
|
||||
'reminders', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->timestamps();
|
||||
$table->integer('user_id')->unsigned();
|
||||
$table->date('startdate');
|
||||
$table->date('enddate')->nullable();
|
||||
$table->boolean('active');
|
||||
$table->boolean('notnow')->default(0);
|
||||
$table->integer('remindersable_id')->unsigned()->nullable();
|
||||
$table->string('remindersable_type')->nullable();
|
||||
|
||||
// connect reminders to users
|
||||
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
}
|
@ -35,6 +35,15 @@ class ChangesForV332 extends Migration
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
Schema::table(
|
||||
'reminders', function (Blueprint $table) {
|
||||
$table->text('metadata')->nullable();
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -226,6 +226,17 @@ class ChangesForV336 extends Migration
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* REMINDERS
|
||||
*/
|
||||
Schema::table(
|
||||
'reminders', function (Blueprint $table) {
|
||||
$table->smallInteger('encrypted', false, true)->default(0);
|
||||
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
40
database/migrations/2015_06_23_050233_changes_for_v3451.php
Normal file
40
database/migrations/2015_06_23_050233_changes_for_v3451.php
Normal file
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
/**
|
||||
* Class ChangesForV3451
|
||||
*/
|
||||
class ChangesForV3451 extends Migration
|
||||
{
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
DB::statement('UPDATE `piggy_banks` SET `reminder_skip` = 0 WHERE `reminder_skip` IS NULL;');
|
||||
DB::statement('ALTER TABLE `piggy_banks` MODIFY `reminder_skip` SMALLINT UNSIGNED NOT NULL;');
|
||||
|
||||
DB::statement('UPDATE `piggy_banks` SET `remind_me` = 0 WHERE `remind_me` IS NULL;');
|
||||
DB::statement('ALTER TABLE `piggy_banks` MODIFY `remind_me` TINYINT UNSIGNED NOT NULL;');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
|
||||
DB::statement('ALTER TABLE `piggy_banks` MODIFY `reminder_skip` SMALLINT UNSIGNED NULL;');
|
||||
DB::statement('ALTER TABLE `piggy_banks` MODIFY `remind_me` TINYINT UNSIGNED NULL;');
|
||||
|
||||
//'reminder_skip'
|
||||
//'remind_me'
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user