Created
May 26, 2016 12:17
-
-
Save 3h5a9/d34afcc73b8e61e27e5d1a238562655c to your computer and use it in GitHub Desktop.
creating table shows errors in mysql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
smehsan@smehsan:~/one$ rake db:migrate | |
== 20160526120711 CreateArticles: migrating =================================== | |
-- create_table(:articles) | |
rake aborted! | |
StandardError: An error has occurred, all later migrations canceled: | |
Mysql2::Error: Table 'articles' already exists: CREATE TABLE `articles` (`id` int(11) auto_increment PRIMARY KEY, `title` varchar(255)) ENGINE=InnoDB | |
/home/smehsan/one/db/migrate/20160526120711_create_articles.rb:3:in `change' | |
ActiveRecord::StatementInvalid: Mysql2::Error: Table 'articles' already exists: CREATE TABLE `articles` (`id` int(11) auto_increment PRIMARY KEY, `title` varchar(255)) ENGINE=InnoDB | |
/home/smehsan/one/db/migrate/20160526120711_create_articles.rb:3:in `change' | |
Mysql2::Error: Table 'articles' already exists | |
/home/smehsan/one/db/migrate/20160526120711_create_articles.rb:3:in `change' | |
Tasks: TOP => db:migrate | |
(See full trace by running task with --trace) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just drop the database and run migrations again
from the folder (make sure you are in the folder of your new app)
rake db:drop
then rake db:migrate to re-run all your migrations