38 lines
739 B
PHP
38 lines
739 B
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
class AddCodeToSoftware extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function up()
|
|
{
|
|
Schema::table('software', function (Blueprint $table) {
|
|
$table->integer('code')->nullable(); // Mailer/Tosser Product Code
|
|
$table->integer('type'); // Mailer/Tosser
|
|
|
|
$table->unique(['code','type']);
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::table('software', function (Blueprint $table) {
|
|
$table->dropUnique(['code','type']);
|
|
$table->dropColumn('code');
|
|
$table->dropColumn('type');
|
|
});
|
|
}
|
|
}
|