Heroku运行rake db:migrate error:citext extension

时间:2017-10-22 02:09:51

标签: ruby-on-rails postgresql ruby-on-rails-4 heroku

我正在尝试heroku run rake db:migrate,但在下面给出了这个错误。 Rails版本是4.2.1(不需要" activerecord-postgresql-citext" gem)。我还添加了citext扩展名。在postgres表中,citext搜索正常,但heroku上传无效。

在我的本地服务器上,rails app工作正常,应用程序本身也已上传到heroku服务器。

  ActiveRecord::SchemaMigration Load (1.2ms)  SELECT "schema_migrations".* FROM "schema_migrations"
Migrating to CreateCosingAnnexIis (20170315005057)
   (1.1ms)  BEGIN
== 20170315005057 CreateCosingAnnexIis: migrating =============================
-- create_table(:cosing_annex_iis)
   (1.6ms)  CREATE TABLE "cosing_annex_iis" ("id" serial primary key, "reference_number" integer, "chemical_name_inn" citext, "cas_number" text, "ec_number" text, "regulation" text, "regulated_by" text, "other_directives_regulations" text, "sccs_opinions" text, "chemical_iupac_name" citext, "identified_ingredients_or_substances" citext, "cmr" text, "update_date" timestamp, "created_at" timestamp DEFAULT 'now()' NOT NULL, "updated_at" timestamp DEFAULT 'now()' NOT NULL) 
PG::UndefinedObject: ERROR:  type "citext" does not exist
LINE 1: ..., "reference_number" integer, "chemical_name_inn" citext, "c...
                                                             ^
: CREATE TABLE "cosing_annex_iis" ("id" serial primary key, "reference_number" integer, "chemical_name_inn" citext, "cas_number" text, "ec_number" text, "regulation" text, "regulated_by" text, "other_directives_regulations" text, "sccs_opinions" text, "chemical_iupac_name" citext, "identified_ingredients_or_substances" citext, "cmr" text, "update_date" timestamp, "created_at" timestamp DEFAULT 'now()' NOT NULL, "updated_at" timestamp DEFAULT 'now()' NOT NULL) 
   (1.0ms)  ROLLBACK
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:

PG::UndefinedObject: ERROR:  type "citext" does not exist
LINE 1: ..., "reference_number" integer, "chemical_name_inn" citext, "c...
                                                             ^
: CREATE TABLE "cosing_annex_iis" ("id" serial primary key, "reference_number" integer, "chemical_name_inn" citext, "cas_number" text, "ec_number" text, "regulation" text, "regulated_by" text, "other_directives_regulations" text, "sccs_opinions" text, "chemical_iupac_name" citext, "identified_ingredients_or_substances" citext, "cmr" text, "update_date" timestamp, "created_at" timestamp DEFAULT 'now()' NOT NULL, "updated_at" timestamp DEFAULT 'now()' NOT NULL) 
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/postgresql/database_statements.rb:155:in `async_exec'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/postgresql/database_statements.rb:155:in `block in execute'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:473:in `block in log'
/app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.1/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:467:in `log'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/postgresql/database_statements.rb:154:in `execute'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:208:in `create_table'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:662:in `block in method_missing'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:632:in `block in say_with_time'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:632:in `say_with_time'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:652:in `method_missing'
/app/db/migrate/20170315005057_create_cosing_annex_iis.rb:3:in `change'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:606:in `exec_migration'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:590:in `block (2 levels) in migrate'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:589:in `block in migrate'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:292:in `with_connection'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:588:in `migrate'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:765:in `migrate'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:995:in `block in execute_migration_in_transaction'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:1041:in `block in ddl_transaction'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `block in transaction'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract/transaction.rb:188:in `within_new_transaction'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `transaction'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/transactions.rb:220:in `transaction'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:1041:in `ddl_transaction'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:994:in `execute_migration_in_transaction'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:956:in `block in migrate'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:952:in `each'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:952:in `migrate'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:820:in `up'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:798:in `migrate'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/tasks/database_tasks.rb:137:in `migrate'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/railties/databases.rake:44:in `block (2 levels) in <top (required)>'
/app/vendor/bundle/ruby/2.2.0/gems/rake-12.1.0/exe/rake:27:in `<top (required)>'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/lib/bundler/cli/exec.rb:74:in `load'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/lib/bundler/cli/exec.rb:74:in `kernel_load'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/lib/bundler/cli/exec.rb:27:in `run'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/lib/bundler/cli.rb:360:in `exec'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor.rb:369:in `dispatch'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/lib/bundler/cli.rb:20:in `dispatch'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor/base.rb:444:in `start'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/lib/bundler/cli.rb:10:in `start'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/exe/bundle:30:in `block in <top (required)>'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/lib/bundler/friendly_errors.rb:121:in `with_friendly_errors'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/exe/bundle:22:in `<top (required)>'
/app/bin/bundle:3:in `load'
/app/bin/bundle:3:in `<main>'
ActiveRecord::StatementInvalid: PG::UndefinedObject: ERROR:  type "citext" does not exist
LINE 1: ..., "reference_number" integer, "chemical_name_inn" citext, "c...
                                                             ^
: CREATE TABLE "cosing_annex_iis" ("id" serial primary key, "reference_number" integer, "chemical_name_inn" citext, "cas_number" text, "ec_number" text, "regulation" text, "regulated_by" text, "other_directives_regulations" text, "sccs_opinions" text, "chemical_iupac_name" citext, "identified_ingredients_or_substances" citext, "cmr" text, "update_date" timestamp, "created_at" timestamp DEFAULT 'now()' NOT NULL, "updated_at" timestamp DEFAULT 'now()' NOT NULL) 
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/postgresql/database_statements.rb:155:in `async_exec'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/postgresql/database_statements.rb:155:in `block in execute'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:473:in `block in log'
/app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.1/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:467:in `log'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/postgresql/database_statements.rb:154:in `execute'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:208:in `create_table'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:662:in `block in method_missing'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:632:in `block in say_with_time'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:632:in `say_with_time'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:652:in `method_missing'
/app/db/migrate/20170315005057_create_cosing_annex_iis.rb:3:in `change'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:606:in `exec_migration'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:590:in `block (2 levels) in migrate'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:589:in `block in migrate'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:292:in `with_connection'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:588:in `migrate'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:765:in `migrate'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:995:in `block in execute_migration_in_transaction'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:1041:in `block in ddl_transaction'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `block in transaction'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract/transaction.rb:188:in `within_new_transaction'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `transaction'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/transactions.rb:220:in `transaction'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:1041:in `ddl_transaction'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:994:in `execute_migration_in_transaction'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:956:in `block in migrate'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:952:in `each'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:952:in `migrate'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:820:in `up'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:798:in `migrate'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/tasks/database_tasks.rb:137:in `migrate'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/railties/databases.rake:44:in `block (2 levels) in <top (required)>'
/app/vendor/bundle/ruby/2.2.0/gems/rake-12.1.0/exe/rake:27:in `<top (required)>'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/lib/bundler/cli/exec.rb:74:in `load'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/lib/bundler/cli/exec.rb:74:in `kernel_load'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/lib/bundler/cli/exec.rb:27:in `run'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/lib/bundler/cli.rb:360:in `exec'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor.rb:369:in `dispatch'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/lib/bundler/cli.rb:20:in `dispatch'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor/base.rb:444:in `start'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/lib/bundler/cli.rb:10:in `start'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/exe/bundle:30:in `block in <top (required)>'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/lib/bundler/friendly_errors.rb:121:in `with_friendly_errors'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/exe/bundle:22:in `<top (required)>'
/app/bin/bundle:3:in `load'
/app/bin/bundle:3:in `<main>'
PG::UndefinedObject: ERROR:  type "citext" does not exist
LINE 1: ..., "reference_number" integer, "chemical_name_inn" citext, "c...
                                                             ^
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/postgresql/database_statements.rb:155:in `async_exec'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/postgresql/database_statements.rb:155:in `block in execute'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:473:in `block in log'
/app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.1/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:467:in `log'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/postgresql/database_statements.rb:154:in `execute'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:208:in `create_table'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:662:in `block in method_missing'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:632:in `block in say_with_time'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:632:in `say_with_time'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:652:in `method_missing'
/app/db/migrate/20170315005057_create_cosing_annex_iis.rb:3:in `change'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:606:in `exec_migration'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:590:in `block (2 levels) in migrate'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:589:in `block in migrate'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:292:in `with_connection'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:588:in `migrate'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:765:in `migrate'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:995:in `block in execute_migration_in_transaction'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:1041:in `block in ddl_transaction'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `block in transaction'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract/transaction.rb:188:in `within_new_transaction'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `transaction'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/transactions.rb:220:in `transaction'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:1041:in `ddl_transaction'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:994:in `execute_migration_in_transaction'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:956:in `block in migrate'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:952:in `each'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:952:in `migrate'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:820:in `up'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/migration.rb:798:in `migrate'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/tasks/database_tasks.rb:137:in `migrate'
/app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.1/lib/active_record/railties/databases.rake:44:in `block (2 levels) in <top (required)>'
/app/vendor/bundle/ruby/2.2.0/gems/rake-12.1.0/exe/rake:27:in `<top (required)>'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/lib/bundler/cli/exec.rb:74:in `load'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/lib/bundler/cli/exec.rb:74:in `kernel_load'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/lib/bundler/cli/exec.rb:27:in `run'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/lib/bundler/cli.rb:360:in `exec'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor.rb:369:in `dispatch'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/lib/bundler/cli.rb:20:in `dispatch'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/lib/bundler/vendor/thor/lib/thor/base.rb:444:in `start'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/lib/bundler/cli.rb:10:in `start'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/exe/bundle:30:in `block in <top (required)>'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/lib/bundler/friendly_errors.rb:121:in `with_friendly_errors'
/app/vendor/bundle/ruby/2.2.0/gems/bundler-1.15.2/exe/bundle:22:in `<top (required)>'
/app/bin/bundle:3:in `load'
/app/bin/bundle:3:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)

此迁移文件没有问题:

class CreateIngredients < ActiveRecord::Migration
def change
  enable_extension 'citext'

  create_table :ingredients do |t|
    t.citext :name
    t.string :name_href
    t.string :overall_hazard
    t.string :cancer
    t.string :developmental
    t.string :allergies
    t.string :restrictions
    t.string :other_concerns
    t.string :animals
    t.string :score
    t.citext :synonyms, array: true, default: []
    t.timestamps null: false
  end
end

此迁移文件导致问题:

class CreateCosingAnnexIis < ActiveRecord::Migration
def change
  create_table :cosing_annex_iis do |t|
    t.integer :reference_number
    t.citext :chemical_name_inn
    t.text :cas_number
    t.text :ec_number
    t.text :regulation
    t.text :regulated_by
    t.text :other_directives_regulations
    t.text :sccs_opinions
    t.citext :chemical_iupac_name
    t.citext :identified_ingredients_or_substances
    t.text :cmr
    t.datetime :update_date

    t.timestamps null: false, default: "now()"
  end
end

0 个答案:

没有答案