rtconner / laravel-tagging

Tag support for Laravel Eloquent models - Taggable Trait
MIT License
882 stars 168 forks source link

Wrong Migrations. config/tagging.php 'primary_keys_type' => 'integer' doesn't work. #54

Closed pechatny closed 9 years ago

pechatny commented 9 years ago

I'm installing rtconner/laravel-tagging by composer. And "laravel-tagging/migrations/2014_01_07_073615_create_tagged_table.php" looks different than on github. GitHub version: Schema::create('tagging_tagged', function(Blueprint $table) { $table->increments('id'); if(\Config::get('tagging.primary_keys_type') == 'integer') { $table->integer('taggable_id')->unsigned()->index(); } else { $table->string('taggable_id', 36)->index(); } $table->string('taggable_type', 255)->index(); $table->string('tag_name', 255); $table->string('tag_slug', 255)->index(); });

Composer version: Schema::create('tagging_tagged', function(Blueprint $table) { $table->increments('id'); $table->string('taggable_id', 36)->index(); $table->string('taggable_type', 255)->index(); //$table->morphs('taggable'); $table->string('tag_name', 255); $table->string('tag_slug', 255)->index(); });

What should I do? Or what shoud you do? ) I would be very thankful if you helped me.

rtconner commented 9 years ago

1.0.7 is the latest stable release. You can browse the code here - https://github.com/rtconner/laravel-tagging/tree/1.0.7

pechatny commented 9 years ago

I'm just wanted to be able to update with composer automatically, not manually.

rtconner commented 9 years ago

Is this what your composer.json file looks like?

"rtconner/laravel-tagging" : "~1.0.7"
pechatny commented 9 years ago

Yes it's looks like this.

rtconner commented 9 years ago

Don't copy migrations from github. Delete your migrations and follow the instructions ..

https://github.com/rtconner/laravel-tagging#install-and-then-run-the-migrations

pechatny commented 9 years ago

Thanks for answer, I will try one more time lately. Even though I did everything step by step following instructions.

pechatny commented 9 years ago

I got the same result. Please compare tagging/migrations/2014_01_07_073615_create_tagged_table.php on laravel-5 branch and tag 1.0.7

shot1 example 1 shot2 example 2

rtconner commented 9 years ago

version 1.1 is released. perhaps delete and reinstall.