MYSQL迁移到postgreSQL问题
尝试将我的MYSQL数据库转换为postgreSQL,以便与heroku配合使用。我安装了gem mysql2psql并运行它。当我运行它时,我得到MYSQL迁移到postgreSQL问题,mysql,ruby-on-rails,postgresql,Mysql,Ruby On Rails,Postgresql,尝试将我的MYSQL数据库转换为postgreSQL,以便与heroku配合使用。我安装了gem mysql2psql并运行它。当我运行它时,我得到 mysql2psql Creating table breads... Created table breads Creating table sammiches... Created table sammiches Creating table schema_migrations... Created table schema_migration
mysql2psql
Creating table breads...
Created table breads
Creating table sammiches...
Created table sammiches
Creating table schema_migrations...
Created table schema_migrations
Counting rows of breads...
Rows counted
Loading breads...
33 rows loaded in 0min 0s
Counting rows of sammiches...
Rows counted
Loading sammiches...
161 rows loaded in 0min 0s
Counting rows of schema_migrations...
Rows counted
Loading schema_migrations...
4 rows loaded in 0min 0s
Indexing table breads...
Indexed table breads
Indexing table sammiches...
Indexed table sammiches
Indexing table schema_migrations...
Indexed table schema_migrations
Table creation 0 min, loading 0 min, indexing 0 min, total 0 min
如果我在pg:psql中,我可以运行查询,我知道列已正确导入到表中,但没有条目
我试过了-
heroku rake db:migrate
WARNING: `heroku rake` has been deprecated. Please use `heroku run rake` instead.
Running `rake db:migrate` attached to terminal... up, run.6669
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/Rakefile:7)
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/Rakefile:7)
Connecting to database specified by DATABASE_URL
Migrating to CreateSammiches (20130428211616)
有什么想法吗?谢谢
mysql2psql文件-
mysql:
hostname: localhost
port: 3306
socket: /tmp/mysql.sock
username: root
password: ####
database: sandwich_development
destination:
# if file is given, output goes to file, else postgres
file:
postgres:
hostname: localhost
port: 5432
username: root
password:
database: pgmysql_db
# 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
检查database.yaml配置
suppress_data: true
可能没有移动数据,只有模式如果您知道数据结构,什么可以阻止您编写自己的转换器?嗯,设置为false。谢谢我添加了mysqlpsql-yml文件。尝试转储到文件以查看现有数据的insert语句是否存在,而不是直接到postgresHmm,文件转储包含所有信息。我想知道这是否与内容的格式有关?我的一篇文章看起来像135 Smörgåstårta//upload.wikimedia.org/wikipedia/en/thumb/a/a7/Sm%C3%B6rg%C3%A5st%C3%A5rta.jpg/120px Sm%C3%B6rg%C3%A5st%C3%A5rta.jpg瑞典多层白色或淡黑麦面包,内含奶油馅料,如鸡蛋和蛋黄酱、肝酱、橄榄、虾、火腿、各种冷切、鱼子酱、西红柿、,黄瓜、奶酪和熏鲑鱼2013-05-09 22:11:37 2013-05-09 22:11:37现在尝试从命令行将这些转储文件运行到mysql中,看看是否有错误?
suppress_data: true