0
使用预先存在的数据库创建应用程序,我设置了database.yml以使用数据库。生成使用数据库中预先存在的数据的模型
的database.yml
development:
adapter: mysql2
encoding: utf8
# database: ttlem_demo_development
database: ttle
pool: 5
username: root
password:
socket: /tmp/mysql.sock
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
adapter: mysql2
encoding: utf8
database: ttlem_demo_test
pool: 5
username: root
password:
socket: /tmp/mysql.sock
production:
adapter: mysql2
encoding: utf8
database: ttlem_demo_production
pool: 5
username: root
password:
socket: /tmp/mysql.sock
我只想要一个表出来它被称为的意见数据库的,我尝试生成此与所有正确的字段的支架,但它告诉我,我需要迁移时(当我在浏览器中渲染它),如果我迁移我不会能够使用现有的数据,这是正确的吗?我如何制作一个将使用现有数据和字段的模型?
感谢您对所有您的帮助:)
它是从一个预先存在的Rails应用程序的分贝,或只是预先存在的数据? – trh
它只是预先存在的数据 –