This will be the first release!

This commit is contained in:
James Cole
2014-08-28 07:53:54 +02:00
parent c7f070a2d1
commit c4f42a604f
75 changed files with 1043 additions and 618 deletions

View File

@@ -1,40 +1,42 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreatePiggyEvents extends Migration {
class CreatePiggyEvents extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('piggybank_events', function(Blueprint $table)
{
$table->increments('id');
$table->timestamps();
$table->integer('piggybank_id')->unsigned();
$table->date('date');
$table->decimal('amount', 10, 2);
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create(
'piggybank_events', function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
$table->integer('piggybank_id')->unsigned();
$table->date('date');
$table->decimal('amount', 10, 2);
// connect instance to piggybank.
$table->foreign('piggybank_id')
->references('id')->on('piggybanks')
->onDelete('cascade');
});
}
// connect instance to piggybank.
$table->foreign('piggybank_id')
->references('id')->on('piggybanks')
->onDelete('cascade');
}
);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('piggybank_events');
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('piggybank_events');
}
}

View File

@@ -1,9 +1,20 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateRemindersTable extends Migration {
class CreateRemindersTable extends Migration
{
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('reminders');
}
/**
* Run the migrations.
@@ -16,8 +27,9 @@ class CreateRemindersTable extends Migration {
'reminders', function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
$table->string('class', 30);
$table->string('class', 40);
$table->integer('piggybank_id')->unsigned()->nullable();
$table->integer('recurring_transaction_id')->unsigned()->nullable();
$table->integer('user_id')->unsigned();
$table->date('startdate');
$table->date('enddate');
@@ -29,6 +41,12 @@ class CreateRemindersTable extends Migration {
->references('id')->on('piggybanks')
->onDelete('set null');
// connect reminders to recurring transactions.
$table->foreign('recurring_transaction_id')
->references('id')->on('recurring_transactions')
->onDelete('set null');
// connect reminders to users
$table->foreign('user_id')
->references('id')->on('users')
@@ -37,14 +55,4 @@ class CreateRemindersTable extends Migration {
);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('reminders');
}
}