Skip to content

Commit 8fa8ed4

Browse files
committed
default the primary id type to integer
1 parent 3dfaa68 commit 8fa8ed4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

config/tagging.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
// Datatype for primary keys of your models.
66
// used in migrations only
7-
'primary_keys_type' => 'string', // 'string' or 'integer'
7+
'primary_keys_type' => 'integer', // 'string' or 'integer'
88

99
// Value of are passed through this before save of tags
1010
'normalizer' => '\Conner\Tagging\TaggingUtil::slug',

migrations/2014_01_07_073615_create_tagged_table.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ class CreateTaggedTable extends Migration {
88
public function up() {
99
Schema::create('tagging_tagged', function(Blueprint $table) {
1010
$table->increments('id');
11-
if(\Config::get('tagging.primary_keys_type') == 'integer') {
12-
$table->integer('taggable_id')->unsigned()->index();
13-
} else {
11+
if(\Config::get('tagging.primary_keys_type') == 'string') {
1412
$table->string('taggable_id', 36)->index();
13+
} else {
14+
$table->integer('taggable_id')->unsigned()->index();
1515
}
1616
$table->string('taggable_type', 255)->index();
1717
$table->string('tag_name', 255);

0 commit comments

Comments
 (0)