所以,我使用的是mysql2psql gem,我得到了以下代码:
mysql:
hostname: localhost
port: 3306
socket: /tmp/mysql.sock
username: root
password: root
database: hello_development
destination:
# if file is given, output goes to file, else postgres
file:
postgres:
hostname: localhost
port: 5432
username: root
password: root
database: hello_development
# if tables is given, only the listed tables will be converted. leave empty to convert all tables.
#tables:
#- table1
#- table2
# if exclude_tables is given, exclude the listed tables from the conversion.
#exclude_tables:
#- table3
#- table4
# if supress_data is true, only the schema definition will be exported/migrated, and not the data
supress_data: false
# if supress_ddl is true, only the data will be exported/imported, and not the schema
supress_ddl: false
# if force_truncate is true, forces a table truncate before table loading
force_truncate: false不过我有点困惑,我不知道如何转换我所有的表,例如测试和生产。目前,看起来我只是在转换hello_development。
请多多指教!
发布于 2014-05-20 02:55:27
您指定了要使用的数据库- database: hello_development -这就是为什么它只在您的开发环境中运行的原因。您还需要为测试和生产环境中的mysql2pgsql创建配置文件。
过去使用过mysql2pgsql,请记住,mysql和postgres的工作方式可能有很多不同-在生产环境中运行此脚本之前,请确保您已经在开发环境中完全测试了您的应用程序。
https://stackoverflow.com/questions/23744988
复制相似问题