This repository has been archived on 2024-06-26. You can view files and clone it, but cannot push or open issues or pull requests.
sakura/database/2016_08_07_150327_record_login_country.php

35 lines
735 B
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Sakura\DB;
class RecordLoginCountry extends Migration
{
/**
* Run the migrations.
* @return void
*/
public function up()
{
$schema = DB::getSchemaBuilder();
$schema->table('sessions', function (Blueprint $table) {
$table->char('session_country', 2)
->default('XX');
});
}
/**
* Reverse the migrations.
* @return void
*/
public function down()
{
$schema = DB::getSchemaBuilder();
$schema->table('sessions', function (Blueprint $table) {
$table->dropColumn('session_country');
});
}
}