所以我有一个稍微不同寻常的Rails 4.2应用程序。没有与您在以下语句中看到的模型相关联的迁移。而是使用db / car.sql来创建数据库表。
但是现在当我运行bundle exec rspec spec/models
时,我得到了以下输出。导致此输出出现的原因是什么?至于我可以告诉schema.rb文件看起来像我使用 rails migration 生成器构建它一样。有一些数据库索引,但就是这样。
rspec输出
ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
(0.4ms) ALTER TABLE "kites" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "tails" DISABLE TRIGGER ALL;ALTER TABLE "cars" DISABLE TRIGGER ALL;ALTER TABLE "car_washes" DISABLE TRIGGER ALL;ALTER TABLE "cars_engines" DISABLE TRIGGER ALL;ALTER TABLE "cities" DISABLE TRIGGER ALL;ALTER TABLE "engines" DISABLE TRIGGER ALL;ALTER TABLE "wheels" DISABLE TRIGGER ALL;ALTER TABLE "cars_wheels" DISABLE TRIGGER ALL
(0.4ms) ALTER TABLE "kites" DISABLE TRIGGER USER;ALTER TABLE "schema_migrations" DISABLE TRIGGER USER;ALTER TABLE "tails" DISABLE TRIGGER USER;ALTER TABLE "cars" DISABLE TRIGGER USER;ALTER TABLE "car_washes" DISABLE TRIGGER USER;ALTER TABLE "cars_engines" DISABLE TRIGGER USER;ALTER TABLE "cities" DISABLE TRIGGER USER;ALTER TABLE "engines" DISABLE TRIGGER USER;ALTER TABLE "wheels" DISABLE TRIGGER USER;ALTER TABLE "cars_wheels" DISABLE TRIGGER USER
(1.0ms) SELECT schemaname || '.' || tablename
FROM pg_tables
WHERE
tablename !~ '_prt_' AND
tablename <> 'schema_migrations' AND
schemaname = ANY (current_schemas(false))
(0.8ms) select table_name from information_schema.views where table_schema = 'automobile_test'
(758.2ms) TRUNCATE TABLE "public"."kites", "public"."tails", "public"."cars", "public"."car_washes", "public"."cars_engines", "public"."cities", "public"."engines", "public"."wheels", "public"."cars_wheels" RESTART IDENTITY CASCADE;
(0.4ms) ALTER TABLE "kites" ENABLE TRIGGER ALL;ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "tails" ENABLE TRIGGER ALL;ALTER TABLE "car_washes" ENABLE TRIGGER ALL;ALTER TABLE "cars_engines" ENABLE TRIGGER ALL;ALTER TABLE "cities" ENABLE TRIGGER ALL;ALTER TABLE "engines" ENABLE TRIGGER ALL;ALTER TABLE "cars" ENABLE TRIGGER ALL;ALTER TABLE "wheels" ENABLE TRIGGER ALL;ALTER TABLE "cars_wheels" ENABLE TRIGGER ALL
(0.5ms) ALTER TABLE "kites" ENABLE TRIGGER USER;ALTER TABLE "schema_migrations" ENABLE TRIGGER USER;ALTER TABLE "tails" ENABLE TRIGGER USER;ALTER TABLE "car_washes" ENABLE TRIGGER USER;ALTER TABLE "cars_engines" ENABLE TRIGGER USER;ALTER TABLE "cities" ENABLE TRIGGER USER;ALTER TABLE "engines" ENABLE TRIGGER USER;ALTER TABLE "cars" ENABLE TRIGGER USER;ALTER TABLE "wheels" ENABLE TRIGGER USER;ALTER TABLE "cars_wheels" ENABLE TRIGGER USER
(0.1ms) BEGIN
(0.1ms) SAVEPOINT active_record_1
(0.1ms) RELEASE SAVEPOINT active_record_1
(0.1ms) SAVEPOINT active_record_1
(0.2ms) ROLLBACK TO SAVEPOINT active_record_1
(0.1ms) ROLLBACK