1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
use Illuminate\Database\Migrations\Migration; |
4
|
|
|
use Illuminate\Database\Schema\Blueprint; |
5
|
|
|
|
6
|
|
|
class CreateCommitFilesTable extends Migration |
7
|
|
|
{ |
8
|
|
|
/** |
9
|
|
|
* Run the migrations. |
10
|
|
|
*/ |
11
|
|
|
public function up() |
12
|
|
|
{ |
13
|
|
|
Schema::create('commit_files', function (Blueprint $table) { |
14
|
|
|
$table->increments('id'); |
15
|
|
|
$table->integer('commit_id')->unsigned()->nullable()->index('fk_commit_files_commit_id_idx'); |
16
|
|
|
$table->string('sha')->nullable(); |
17
|
|
|
$table->string('filename')->nullable(); |
18
|
|
|
$table->string('status')->nullable(); |
19
|
|
|
$table->integer('additions')->unsigned()->nullable(); |
20
|
|
|
$table->integer('deletions')->unsigned()->nullable(); |
21
|
|
|
$table->integer('changes')->unsigned()->nullable(); |
22
|
|
|
$table->string('raw_url')->nullable(); |
23
|
|
|
$table->text('raw')->nullable(); |
24
|
|
|
$table->text('phpcs')->nullable(); |
25
|
|
|
$table->text('patch')->nullable(); |
26
|
|
|
$table->integer('phploc_size')->nullable(); |
27
|
|
|
$table->integer('phploc_lines_of_code')->nullable(); |
28
|
|
|
$table->decimal('phploc_lines_of_code_percent', 10)->nullable(); |
29
|
|
|
$table->integer('phploc_comment_lines_of_code')->nullable(); |
30
|
|
|
$table->decimal('phploc_comment_lines_of_code_percent', 10)->nullable(); |
31
|
|
|
$table->integer('phploc_non-comment_lines_of_code')->nullable(); |
32
|
|
|
$table->decimal('phploc_non-comment_lines_of_code_percent', 10)->nullable(); |
33
|
|
|
$table->integer('phploc_logical_lines_of_code')->nullable(); |
34
|
|
|
$table->decimal('phploc_logical_lines_of_code_percent', 10)->nullable(); |
35
|
|
|
$table->integer('phploc_namespaces')->nullable(); |
36
|
|
|
$table->integer('phploc_interfaces')->nullable(); |
37
|
|
|
$table->integer('phploc_traits')->nullable(); |
38
|
|
|
$table->integer('phploc_classes')->nullable(); |
39
|
|
|
$table->integer('phploc_scope_non-static')->nullable(); |
40
|
|
|
$table->integer('phploc_scope_static')->nullable(); |
41
|
|
|
$table->integer('phploc_visibility_public')->nullable(); |
42
|
|
|
$table->decimal('phploc_visibility_public_percent', 10)->nullable(); |
43
|
|
|
$table->integer('phploc_visibility_non-public')->nullable(); |
44
|
|
|
$table->decimal('phploc_visibility_non-public_percent', 10)->nullable(); |
45
|
|
|
$table->integer('phploc_named_functions')->nullable(); |
46
|
|
|
$table->decimal('phploc_named_functions_percent', 10)->nullable(); |
47
|
|
|
$table->integer('phploc_anonymous_functions')->nullable(); |
48
|
|
|
$table->integer('phploc_constants_global')->nullable(); |
49
|
|
|
$table->decimal('phploc_constants_global_percent', 10)->nullable(); |
50
|
|
|
$table->integer('phploc_constants_class')->nullable(); |
51
|
|
|
$table->decimal('phploc_constants_class_percent', 10)->nullable(); |
52
|
|
|
$table->timestamps(); |
53
|
|
|
$table->softDeletes(); |
54
|
|
|
}); |
55
|
|
|
} |
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* Reverse the migrations. |
59
|
|
|
*/ |
60
|
|
|
public function down() |
61
|
|
|
{ |
62
|
|
|
Schema::drop('commit_files'); |
63
|
|
|
} |
64
|
|
|
} |
65
|
|
|
|