Skip to content

Commit

Permalink
Fix findmymac migration
Browse files Browse the repository at this point in the history
  • Loading branch information
abn290 committed Feb 14, 2018
1 parent a56e8f6 commit ec98fbd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion app/helpers/site_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use munkireport\models\Machine_group, munkireport\lib\Modules;

// Munkireport version (last number is number of commits)
$GLOBALS['version'] = '3.0.2.3303';
$GLOBALS['version'] = '3.0.2.3304';

// Return version without commit count
function get_version()
Expand Down
21 changes: 12 additions & 9 deletions app/modules/findmymac/migrations/2017_02_09_234321_findmymac.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,12 @@ public function up()

$capsule::schema()->create($this->tableName, function (Blueprint $table) {
$table->increments('id');
$table->string('serial_number')->unique();
$table->string('serial_number');
$table->string('status');
$table->string('ownerdisplayname')->nullable();
$table->string('email')->nullable();
$table->string('personid')->nullable();
$table->string('hostname')->nullable();


$table->index('serial_number');
$table->index('status');
$table->index('ownerdisplayname');
$table->index('email');
$table->index('personid');
$table->index('hostname');
});

if ($migrateData) {
Expand All @@ -54,7 +46,18 @@ public function up()
hostname
FROM
$this->tableNameV2");
$capsule::schema()->drop($this->tableNameV2);
}

// (Re)create indexes
$capsule::schema()->table($this->tableName, function (Blueprint $table) {
$table->unique('serial_number');
$table->index('status');
$table->index('ownerdisplayname');
$table->index('email');
$table->index('personid');
$table->index('hostname');
});
}

public function down()
Expand Down

0 comments on commit ec98fbd

Please sign in to comment.