add ei and edo field to invoices

This commit is contained in:
Edmond Teh
2020-09-14 13:43:54 +08:00
parent 5821fd2f57
commit 56f9ce4348
4 changed files with 101 additions and 3 deletions
@@ -14,8 +14,8 @@ class AddEiEdoEpoToInvoice extends Migration
public function up()
{
Schema::table('invoices', function (Blueprint $table) {
$table->string('edo')->unique();
$table->string('ei')->unique();
$table->string('edo');
$table->string('ei');
});
}
@@ -27,7 +27,7 @@ class AddEiEdoEpoToInvoice extends Migration
public function down()
{
Schema::table('invoices', function (Blueprint $table) {
//
$table->dropColumn(['edo', 'ei']);
});
}
}
@@ -0,0 +1,33 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddDefaultNullToEdoEiAndNullable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('invoices', function (Blueprint $table) {
$table->string('edo')->default(null)->nullable()->change();
$table->string('ei')->default(null)->nullable()->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('invoices', function (Blueprint $table) {
//
});
}
}
@@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class RemoveEdoEi extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('invoices', function (Blueprint $table) {
$table->dropColumn(['edo', 'ei']);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('invoices', function (Blueprint $table) {
//
});
}
}
@@ -0,0 +1,33 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateEdoEi extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('invoices', function (Blueprint $table) {
$table->string('ei')->default(null)->nullable()->unique();
$table->string('edo')->default(null)->nullable()->unique();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('invoices', function (Blueprint $table) {
//
});
}
}