Skip to content

A free open source IT asset/license management system

Only try to create the licenses table if it doesn't exist

snipe8719b3d3e96d
diff --git a/database/migrations/2013_11_15_190357_create_temp_licenses_table.php b/database/migrations/2013_11_15_190357_create_temp_licenses_table.php
index afb6d05402..85f4e7c95e 100755
--- a/database/migrations/2013_11_15_190357_create_temp_licenses_table.php
+++ b/database/migrations/2013_11_15_190357_create_temp_licenses_table.php
@@ -6,30 +6,15 @@ class CreateTempLicensesTable extends Migration
{
/**
* Run the migrations.
+ *
+ * This migration is overwritten by a later migration - 2013_11_25_recreate_licenses_table.php
*
* @return void
*/
public function up()
{
- if (!Schema::hasTable('licenses')) {
- Schema::create('licenses', function ($table) {
- $table->increments('id');
- $table->string('name');
- $table->integer('model_id');
- $table->text('serial');
- $table->string('license_email');
- $table->string('license_name');
- $table->date('purchase_date')->nullable();
- $table->decimal('purchase_cost', 8, 2)->nullable();
- $table->string('order_number');
- $table->integer('assigned_to');
- $table->text('notes');
- $table->integer('user_id')->nullable();
- $table->timestamps();
- $table->engine = 'InnoDB';
- });
- }
+ //
}
@@ -41,6 +26,6 @@ class CreateTempLicensesTable extends Migration
*/
public function down()
{
- Schema::dropIfExists('licenses');
+ // Schema::dropIfExists('licenses');
}
}
diff --git a/database/migrations/2013_11_25_013244_recreate_licenses_table.php b/database/migrations/2013_11_25_013244_recreate_licenses_table.php
index 404a37228b..fb18452794 100755
--- a/database/migrations/2013_11_25_013244_recreate_licenses_table.php
+++ b/database/migrations/2013_11_25_013244_recreate_licenses_table.php
@@ -11,22 +11,23 @@ class ReCreateLicensesTable extends Migration
*/
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')->nullable();
- $table->integer('depreciation_id');
- $table->timestamps();
- $table->softDeletes();
- $table->engine = 'InnoDB';
- });
+ if (!Schema::hasTable('licenses')) {
+ 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')->nullable();
+ $table->integer('depreciation_id');
+ $table->timestamps();
+ $table->softDeletes();
+ $table->engine = 'InnoDB';
+ });
+ }
}
/**