<commit_before><?php

use Silber\Bouncer\Database\Models;

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateBouncerTables extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create(Models::table('abilities'), function (Blueprint $table) {
            $table->increments('id');
            $table->string('name');
            $table->integer('entity_id')->unsigned()->nullable();
            $table->string('entity_type')->nullable();
            $table->timestamps();

            $table->unique(['name', 'entity_id', 'entity_type']);
        });

        Schema::create(Models::table('roles'), function (Blueprint $table) {
            $table->increments('id');
            $table->string('name')->unique();
            $table->timestamps();
        });

        Schema::create(Models::table('user_roles'), function (Blueprint $table) {
            $table->integer('role_id')->unsigned()->index();
            $table->integer('user_id')->unsigned()->index();

            $table->primary(['role_id', 'user_id']);

            $table->foreign('role_id')->references('id')->on(Models::table('roles'))
                  ->onUpdate('cascade')->onDelete('cascade');

            $table->foreign('user_id')->references('id')->on(Models::table('users'))
                  ->onUpdate('cascade')->onDelete('cascade');
        });

        Schema::create(Models::table('user_abilities'), function (Blueprint $table) {
            $table->integer('ability_id')->unsigned()->index();
            $table->integer('user_id')->unsigned()->index();

            $table->primary(['ability_id', 'user_id']);

            $table->foreign('ability_id')->references('id')->on(Models::table('abilities'))
                  ->onUpdate('cascade')->onDelete('cascade');

            $table->foreign('user_id')->references('id')->on(Models::table('users'))
                  ->onUpdate('cascade')->onDelete('cascade');
        });

        Schema::create(Models::table('role_abilities'), function (Blueprint $table) {
            $table->integer('ability_id')->unsigned()->index();
            $table->integer('role_id')->unsigned()->index();
<commit_msg>Added timestamps and soft delete to bouncer tables<commit_after><?php

use Silber\Bouncer\Database\Models;

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateBouncerTables extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create(Models::table('abilities'), function (Blueprint $table) {
            $table->increments('id');
            $table->string('name');
            $table->integer('entity_id')->unsigned()->nullable();
            $table->string('entity_type')->nullable();
            $table->timestamps();
            $table->softDeletes();

            $table->unique(['name', 'entity_id', 'entity_type']);
        });

        Schema::create(Models::table('roles'), function (Blueprint $table) {
            $table->increments('id');
            $table->string('name')->unique();
            $table->timestamps();
            $table->softDeletes();
        });

        Schema::create(Models::table('user_roles'), function (Blueprint $table) {
            $table->integer('role_id')->unsigned()->index();
            $table->integer('user_id')->unsigned()->index();
            $table->timestamps();
            $table->softDeletes();

            $table->primary(['role_id', 'user_id']);

            $table->foreign('role_id')->references('id')->on(Models::table('roles'))
                  ->onUpdate('cascade')->onDelete('cascade');

            $table->foreign('user_id')->references('id')->on(Models::table('users'))
                  ->onUpdate('cascade')->onDelete('cascade');
        });

        Schema::create(Models::table('user_abilities'), function (Blueprint $table) {
            $table->integer('ability_id')->unsigned()->index();
            $table->integer('user_id')->unsigned()->index();
            $table->timestamps();
            $table->softDeletes();

            $table->primary(['ability_id', 'user_id']);

            $table->foreign('ability_id')->references('id')->on(Models::table('abilities'))
                  ->onUpdate('cascade')->onDelete('cascade');

            $table->foreign('user_id')->references('id')->on(Models::table('users'))
                  ->onUpdate('cascade')->onDelete('cascade');
        });

        Schema::create(Models::table('role_abilities'), function (Blueprint $table) {
            $table->integer('ability_id')->unsigned()->index();
            $table->integer('role_id')->unsigned()->index();
            $table->timestamps();
            $table->softDeletes();

{'fraction_non_alphanumeric': 0.2042079207920792, 'fraction_numerical': 0.0, 'mean_word_length': 2.7242703533026114, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 117, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '137358', 'n_tokens_mistral': 1323, 'n_tokens_neox': 1291, 'n_words': 151}