1

I'm not sure how to find what I'm looking for here, but I've cloned a rails app from someone else and they were using sqlite, how do I switch the project over to mysql? There are no migrations but it has a schema. Thanks.

1
  • Or rather is there a way to make a migration from a schema? Commented Feb 23, 2011 at 22:33

3 Answers 3

3

Have you changed the database.yml?

eg:

development: 
  adapter: mysql
  encoding: utf8
  database: <db name here>
  pool: 5
  username: root
  password: <p/w>
  socket: /var/run/mysqld/mysqld.sock
Sign up to request clarification or add additional context in comments.

1 Comment

yah did all this. It's just annoying to have to run schema:load then db:migrate
1

You don't need a migration. rake db:setup (or rake db:schema:load)

EDIT: this is assuming the schema is a schema.rb file. If it's an SQL file you'll have to convert that and then just run it using the mysql client.

Comments

0

hope this will helps you.

If you have some errors in the Database.yml file, you might have to install the mysql gem:

gem install mysql   

Have rake create your database

rake db:create     
rake db:schema:load

Use YamlDb to reload your data into MySql

rake db:load  

You really should use db:schema:load instead of db:migrate for creating new databases

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.