vendor and env first commit
This commit is contained in:
vendor/vanguardapp/activity-log/database/migrations/2015_12_29_224252_create_user_activity_table.php
Vendored
+49
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
|
||||
class CreateUserActivityTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('user_activity', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->text('description');
|
||||
$table->unsignedInteger('user_id');
|
||||
$table->string('ip_address', 45);
|
||||
$table->text('user_agent');
|
||||
$table->timestamp('created_at');
|
||||
});
|
||||
|
||||
Schema::table('user_activity', function (Blueprint $table) {
|
||||
$table->foreign('user_id')
|
||||
->references('id')
|
||||
->on('users')
|
||||
->onDelete('cascade');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
if (DB::getDriverName() != 'sqlite') {
|
||||
Schema::table('user_activity', function (Blueprint $table) {
|
||||
$table->dropForeign('user_activity_user_id_foreign');
|
||||
});
|
||||
}
|
||||
|
||||
Schema::drop('user_activity');
|
||||
|
||||
\DB::table('permissions')->where('name', 'users.activity')->delete();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user