history table, location table

This commit is contained in:
snipe
2013-11-16 05:51:38 -05:00
parent 0894832e60
commit a62ffa96cf
4 changed files with 130 additions and 0 deletions
@@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
class CreateLocationsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('locations', function($table)
{
$table->increments('id');
$table->string('name');
$table->string('city');
$table->string('state',2);
$table->string('country',2);
$table->timestamps();
$table->integer('user_id');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('locations');
}
}
@@ -0,0 +1,30 @@
<?php
use Illuminate\Database\Migrations\Migration;
class AddLocationIdToAssets extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('assets', function($table)
{
$table->integer('location_id');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
@@ -0,0 +1,30 @@
<?php
use Illuminate\Database\Migrations\Migration;
class AddCheckedoutToToAssets extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('assets', function($table)
{
$table->integer('checkedout_to');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
class CreateHistoryTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('history', function($table)
{
$table->increments('id');
$table->integer('checkedout_to')->nullable;
$table->integer('location_id')->nullable;
$table->timestamps();
$table->integer('user_id');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('history');
}
}