Skip to content

Instantly share code, notes, and snippets.

@juliend2
Created November 14, 2013 21:56
Show Gist options
  • Save juliend2/7475004 to your computer and use it in GitHub Desktop.
Save juliend2/7475004 to your computer and use it in GitHub Desktop.
== CreateBrandCategories: migrating ==========================================
-- create_table(:brand_categories, {:primary_key=>:category_code})
(565.2ms) CREATE TABLE "brand_categories" ("category_code" serial primary key, "category_id" text NOT NULL, FOREIGN KEY ("category_id") REFERENCES "categories" ("id"))
PG::DatatypeMismatch: ERROR: foreign key constraint "brand_categories_category_id_fkey" cannot be implemented
DETAIL: Key columns "category_id" and "id" are of incompatible types: text and integer.
: CREATE TABLE "brand_categories" ("category_code" serial primary key, "category_id" text NOT NULL, FOREIGN KEY ("category_id") REFERENCES "categories" ("id"))
(0.9ms) ROLLBACK
rake aborted!
An error has occurred, this and all later migrations canceled:
PG::DatatypeMismatch: ERROR: foreign key constraint "brand_categories_category_id_fkey" cannot be implemented
DETAIL: Key columns "category_id" and "id" are of incompatible types: text and integer.
: CREATE TABLE "brand_categories" ("category_code" serial primary key, "category_id" text NOT NULL, FOREIGN KEY ("category_id") REFERENCES "categories" ("id")) /home/deploy/www/www-admin/development/shared/vendor/gems/ruby/1.9.1/gems/activerecord-3.2.14/lib/active_record/connection_adapters/postgresql_adapter.rb:650:in `exec'
/home/deploy/www/www-admin/development/shared/vendor/gems/ruby/1.9.1/gems/activerecord-3.2.14/lib/active_record/connection_adapters/postgresql_adapter.rb:650:in `block in execute'
/home/deploy/www/www-admin/development/shared/vendor/gems/ruby/1.9.1/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstract_adapter.rb:280:in `block in log'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment