Rails(PostgreSQL?)隐式序列/索引警告

Mel*_*emi 4 migration postgresql ruby-on-rails database-migration

可能重复:
在postgresql应用程序的rails中运行迁移后序列的注释

使用PostgreSQL进行开发和测试数据库(以及生产).当rake db:test:prepare我的PostgreSQL theapp_test数据库中,我为每个表获取这些消息:

NOTICE:  CREATE TABLE will create implicit sequence "events_id_seq" for serial column "events.id"
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "events_pkey" for table "events"
NOTICE:  CREATE TABLE will create implicit sequence "users_id_seq" for serial column "users.id"
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "users_pkey" for table "users"
...
Run Code Online (Sandbox Code Playgroud)

我不把这些通知rake db:migratetheapp_development.而且我没有注意到它们的制作.它是什么意思,我应该努力摆脱它们?

仅供参考 - 过去当我使用MySQL(或SQLite3)进行测试时,这种情况并未发生......

Bra*_*dan 11

您可以通过添加(或取消注释)一行来使这些消息静音config/database.yml:

# config/database.yml
development:
  adapter: postgresql
  min_messages: WARNING  # this line silences those NOTICE messages
Run Code Online (Sandbox Code Playgroud)