-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed license structure to use join table to handle multiple seats
- Loading branch information
Showing
15 changed files
with
398 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
app/database/migrations/2013_11_25_013244_create_licenses_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
|
||
class ReCreateLicensesTable extends Migration { | ||
|
||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
// | ||
Schema::create('licenses', function($table) | ||
{ | ||
$table->increments('id'); | ||
$table->string('name'); | ||
$table->string('serial'); | ||
$table->date('purchase_date')->nullable(); | ||
$table->decimal('purchase_cost', 8, 2)->nullable(); | ||
$table->string('order_number'); | ||
$table->integer('seats'); | ||
$table->text('notes'); | ||
$table->integer('user_id'); | ||
$table->integer('depreciation_id'); | ||
$table->timestamps(); | ||
$table->softDeletes(); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
// | ||
Schema::drop('licenses'); | ||
} | ||
|
||
} |
37 changes: 37 additions & 0 deletions
37
app/database/migrations/2013_11_25_031458_create_license_seats_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
|
||
class CreateLicenseSeatsTable extends Migration { | ||
|
||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
// | ||
Schema::create('license_seats', function($table) | ||
{ | ||
$table->increments('id'); | ||
$table->integer('license_id'); | ||
$table->integer('assigned_to'); | ||
$table->text('notes'); | ||
$table->integer('user_id'); | ||
$table->timestamps(); | ||
$table->softDeletes(); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
// | ||
} | ||
|
||
} |
35 changes: 35 additions & 0 deletions
35
app/database/migrations/2013_11_25_032022_add_type_to_actionlog_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
|
||
class AddTypeToActionlogTable extends Migration { | ||
|
||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
// | ||
Schema::table('asset_logs', function($table) | ||
{ | ||
$table->enum('asset_type', array('software', 'hardware')); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
// | ||
Schema::table('asset_logs', function($table) | ||
{ | ||
$table->dropColumn('asset_type'); | ||
}); | ||
} | ||
|
||
} |
27 changes: 27 additions & 0 deletions
27
app/database/migrations/2013_11_25_033008_delete_bad_licenses_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
|
||
class DeleteBadLicensesTable extends Migration { | ||
|
||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::drop('licenses'); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
// | ||
} | ||
|
||
} |
43 changes: 43 additions & 0 deletions
43
app/database/migrations/2013_11_25_033131_create_new_licenses_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
|
||
class CreateNewLicensesTable extends Migration { | ||
|
||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
// | ||
Schema::create('licenses', function($table) | ||
{ | ||
$table->increments('id'); | ||
$table->string('name'); | ||
$table->string('serial'); | ||
$table->date('purchase_date')->nullable(); | ||
$table->decimal('purchase_cost', 8, 2)->nullable(); | ||
$table->string('order_number'); | ||
$table->integer('seats')->default(1); | ||
$table->text('notes'); | ||
$table->integer('user_id'); | ||
$table->integer('depreciation_id'); | ||
$table->timestamps(); | ||
$table->softDeletes(); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
// | ||
Schema::drop('licenses'); | ||
} | ||
|
||
} |
37 changes: 37 additions & 0 deletions
37
app/database/migrations/2013_11_25_033534_add_licensed_to_licenses_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
|
||
class AddLicensedToLicensesTable extends Migration { | ||
|
||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
// | ||
Schema::table('licenses', function($table) | ||
{ | ||
$table->string('license_name'); | ||
$table->string('license_email'); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
// | ||
Schema::table('licenses', function($table) | ||
{ | ||
$table->dropColumn('license_name'); | ||
$table->dropColumn('license_email'); | ||
}); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -112,45 +112,6 @@ public function run() | |
'status_id' => 0, | ||
); | ||
|
||
// Deployed (status_id =0, assigned_to > 0) | ||
$asset[] = array( | ||
'name' => 'Photoshop CS6', | ||
'asset_tag' => 'NNY65756756775', | ||
'model_id' => 8, | ||
'serial' => 'OMG-WTF-SRSLY-BBQ', | ||
'purchase_date' => '2012-01-02', | ||
'purchase_cost' => '1999.99', | ||
'order_number' => '657756', | ||
'created_at' => $date->modify('-10 day'), | ||
'updated_at' => $date->modify('-3 day'), | ||
'user_id' => 2, | ||
'assigned_to' => 2, | ||
'physical' => 0, | ||
'archived' => 0, | ||
'license_name' => 'Alison Giasnotto', | ||
'license_email' => '[email protected]', | ||
'status_id' => 0, | ||
); | ||
|
||
// Deployed (status_id =0, assigned_to > 0) | ||
$asset[] = array( | ||
'name' => 'Git Tower', | ||
'asset_tag' => 'NNY65756756775', | ||
'model_id' => 7, | ||
'serial' => 'OMG-WTF-SRSLY-BBQ', | ||
'purchase_date' => '2012-01-02', | ||
'purchase_cost' => '1999.99', | ||
'order_number' => '657756', | ||
'created_at' => $date->modify('-10 day'), | ||
'updated_at' => $date->modify('-3 day'), | ||
'user_id' => 2, | ||
'assigned_to' => 2, | ||
'physical' => 0, | ||
'archived' => 0, | ||
'license_name' => 'Alison Giasnotto', | ||
'license_email' => '[email protected]', | ||
'status_id' => 0, | ||
); | ||
|
||
// Deployed (status_id =0, assigned_to > 0) | ||
$asset[] = array( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.