Removed redundant items, upgraded to laravel 5.6
This commit is contained in:
@@ -3,12 +3,9 @@
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use App\Models\Currency;
|
||||
|
||||
class CreateTableCurrencies extends Migration
|
||||
{
|
||||
private $convert = 'App\Models\Old\Currency';
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -16,7 +13,6 @@ class CreateTableCurrencies extends Migration
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::dropIfExists('currencies');
|
||||
Schema::create('currencies', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->string('name');
|
||||
@@ -24,17 +20,6 @@ class CreateTableCurrencies extends Migration
|
||||
$table->string('threecode',3);
|
||||
$table->boolean('active');
|
||||
});
|
||||
|
||||
if ($this->convert)
|
||||
foreach (($this->convert)::all() as $o)
|
||||
{
|
||||
$oo = new Currency;
|
||||
$oo->name = $o->name;
|
||||
$oo->symbol = $o->symbol;
|
||||
$oo->threecode = $o->three_digit;
|
||||
$oo->active = $o->three_code == 'AUS' ? TRUE : FALSE;
|
||||
$oo->save();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user