我已經與朋友一起啓動了Rails Spree項目,並且我們使用GitHub進行版本控制。Rails Spree項目 - 無法從Git上的其他貢獻者訪問數據庫
我在我的機器上創建了示例項目,並在其上安裝了Spree功能。這將創建產品樣本數據庫,像這樣:
當我的朋友在克隆他的機器和進口它的項目,運行rails server
失敗,MigrationException
,並要求他跑rake db:migrate
。
運行rake db:migrate
在非現有數據庫列上進行了一些遷移後失敗。
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
SQLite3::SQLException: no such column: spree_calculators.deleted_at: SELECT "spree_calculators".* FROM "spree_calculators" WHERE "spree_calculators"."deleted_at" IS NULL ORDER BY "spree_calculators"."id" ASC LIMIT 1000C:in `find_each'
C:/Users/User/xylino/xylino_serena/db/migrate/20151011115236_migrate_old_preferences.spree.rb:15:in `migrate_preferences'
C:/Users/User/xylino/xylino_serena/db/migrate/20151011115236_migrate_old_preferences.spree.rb:4:in `up'
C:in `migrate'
ActiveRecord::StatementInvalid: SQLite3::SQLException: no such column: spree_calculators.deleted_at: SELECT "spree_calculators".* FROM "spree_calculators" WHERE "spree_calculators"."deleted_at" IS NULL ORDER BY "spree_calculators"."id" ASC LIMIT 1000
C:in `find_each'
C:/Users/User/xylino/xylino_serena/db/migrate/20151011115236_migrate_old_preferences.spree.rb:15:in `migrate_preferences'
C:/Users/User/xylino/xylino_serena/db/migrate/20151011115236_migrate_old_preferences.spree.rb:4:in `up'
C:in `migrate'
SQLite3::SQLException: no such column: spree_calculators.deleted_at
C:in `find_each'
C:/Users/User/xylino/xylino_serena/db/migrate/20151011115236_migrate_old_preferences.spree.rb:15:in `migrate_preferences'
C:/Users/User/xylino/xylino_serena/db/migrate/20151011115236_migrate_old_preferences.spree.rb:4:in `up'
C:in `migrate'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
之後,再次運行rails server
是成功的,但沒有產品或其他物品可以在他的樣本頁面可以看到,像這樣:
必須有一些錯誤數據庫。部分或全部無法訪問,可能是由於安全問題,因爲我們共享數據庫,但我找不到解決方案。或者,也許這只是一個拙劣的遷移問題
任何想法?
你是不是應該有一個在開發中的共享數據庫,種子是要走的路 – apneadiving