2023-07-23 05:57:06 +00:00
|
|
|
<?php namespace RainLab\User\Updates;
|
|
|
|
|
|
|
|
|
|
use Schema;
|
|
|
|
|
use October\Rain\Database\Updates\Migration;
|
|
|
|
|
|
|
|
|
|
class UsersAddIpAddress extends Migration
|
|
|
|
|
{
|
|
|
|
|
public function up()
|
|
|
|
|
{
|
|
|
|
|
Schema::table('users', function($table)
|
|
|
|
|
{
|
|
|
|
|
$table->string('created_ip_address')->nullable();
|
|
|
|
|
$table->string('last_ip_address')->nullable();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function down()
|
|
|
|
|
{
|
|
|
|
|
if (Schema::hasColumn('users', 'created_ip_address')) {
|
2023-07-24 11:45:53 +00:00
|
|
|
Schema::table('users', function($table) {
|
2023-07-23 05:57:06 +00:00
|
|
|
$table->dropColumn('created_ip_address');
|
2023-07-24 11:45:53 +00:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (Schema::hasColumn('users', 'last_ip_address')) {
|
|
|
|
|
Schema::table('users', function($table) {
|
2023-07-23 05:57:06 +00:00
|
|
|
$table->dropColumn('last_ip_address');
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|