<commit_before><?php

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

class CreateIssuesTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('issues', function(Blueprint $table)
		{
			$table->increments('id');
			// Hidden from client
			$table->boolean('hidden');
            // Author
			$table->integer('author_id')->unsigned();
			$table->foreign('author_id')->references('id')->on('users')->onDelete('cascade');
            // Assigned to a group
			$table->integer('assigned_to_id')->unsigned();
			$table->foreign('assigned_to_id')->references('id')->on('groups')->onDelete('cascade');
			// Claimed by user
			$table->integer('claimed_by_id')->unsigned()->nullable();
			$table->foreign('claimed_by_id')->references('id')->on('users')->onDelete('cascade');
            // Project
			$table->integer('project_id')->unsigned();
			$table->foreign('project_id')->references('id')->on('projects')->onDelete('cascade');
            // Project version
			$table->string('version');
            // Page reference
			$table->string('reference');
            // Issue type
			$table->string('summary');
            // Description
			$table->text('description');
            // Status
			$table->integer('status_id')->unsigned();
			$table->foreign('status_id')->references('id')->on('issue_status');
            // Priority
			$table->string('priority');
            // Timestamps
			$table->timestamps();
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('issues');<commit_msg>Changed to SET NULL if claimed_user is deleted<commit_after><?php

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

class CreateIssuesTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('issues', function(Blueprint $table)
		{
			$table->increments('id');
			// Hidden from client
			$table->boolean('hidden');
            // Author
			$table->integer('author_id')->unsigned();
			$table->foreign('author_id')->references('id')->on('users')->onDelete('cascade');
            // Assigned to a group
			$table->integer('assigned_to_id')->unsigned();
			$table->foreign('assigned_to_id')->references('id')->on('groups')->onDelete('cascade');
			// Claimed by user
			$table->integer('claimed_by_id')->unsigned()->nullable();
			$table->foreign('claimed_by_id')->references('id')->on('users')->onDelete('set null');
            // Project
			$table->integer('project_id')->unsigned();
			$table->foreign('project_id')->references('id')->on('projects')->onDelete('cascade');
            // Project version
			$table->string('version');
            // Page reference
			$table->string('reference');
            // Issue type
			$table->string('summary');
            // Description
			$table->text('description');
            // Status
			$table->integer('status_id')->unsigned();
			$table->foreign('status_id')->references('id')->on('issue_status');
            // Priority
			$table->string('priority');
            // Timestamps
			$table->timestamps();
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('issues');
{'fraction_non_alphanumeric': 0.20083932853717026, 'fraction_numerical': 0.0, 'mean_word_length': 3.2836970474967906, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 79, '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': '6344449', 'n_tokens_mistral': 1072, 'n_tokens_neox': 961, 'n_words': 145}