I am beginner for this Rails from the past 2 days I am working hard
to fix the following error
C:\Murali Rubby\demo\library>rake db:migrate
(in C:/Murali Rubby/demo/library)
== CreateBooks: migrating
– create_table(:books)
rake aborted!
An error has occurred, all later migrations canceled:
Mysql::Error: Table ‘books’ already exists: CREATE TABLE books
(id
int(11) D
EFAULT NULL auto_increment PRIMARY KEY, created_at
datetime,
updated_at
date
time) ENGINE=InnoDB
(See full trace by running task with --trace)
I spend almost like 20 hrs but I didn’t find the way to fix it.
I am working on the example given in the tutorialpoint website…
Please help me … Thanks in advance for your time.
Krishna Venkata wrote:
I am beginner for this Rails from the past 2 days I am working hard
to fix the following error
C:\Murali Rubby\demo\library>rake db:migrate
(in C:/Murali Rubby/demo/library)
== CreateBooks: migrating
– create_table(:books)
rake aborted!
An error has occurred, all later migrations canceled:
Mysql::Error: Table ‘books’ already exists: CREATE TABLE books
(id
int(11) D
EFAULT NULL auto_increment PRIMARY KEY, created_at
datetime,
updated_at
date
time) ENGINE=InnoDB
(See full trace by running task with --trace)
I spend almost like 20 hrs but I didn’t find the way to fix it.
I am working on the example given in the tutorialpoint website…
Please help me … Thanks in advance for your time.
You’ve already started one thread on this topic. Please refrain from
repeating yourself.
Best,
Marnen Laibow-Koser
http://www.marnen.org
[email protected]
Hi,
Can you just check once again that you don’t have two migration files
creating books table? If not then you can choose books tables manually.
Thanks,
–Haribhau
I mean delete books table manually from Database if you don’t have two
migration files creating books table.
Haribhau Ingale <hari31582@…> writes:
I mean delete books table manually from Database if you don’t have two
migration files creating books table.
On Sat, May 29, 2010 at 3:49 PM, Haribhau Ingale
[email protected] wrote:Hi, Can you just
check once again that you don’t have two migration files creating books
table?
If not then you can choose books tables manually.Thanks,–Haribhau
On Sat, May 29, 2010 at 3:24 AM, DVM
[email protected] wrote:
I am beginner for this Rails from the past 2 days I am working hard
to fix the following error
C:\Murali Rubby\demo\library>rake db:migrate
(in C:/Murali Rubby/demo/library)
== CreateBooks: migrating
Hi,
For this issue, I see the solution below on the internet, Can you try
it:
** Add “:force => true” to your code.
example:
…
create_table :books, :force => true do |t|
t.string :title, :limit => 32, :null => false
…
** Try again: rake db:migrate --trace, then look at the Database to see
the changes.
** This issue will be resolved by the logic in:
- We have the logic to handle this in:
ruby\gems\1.8\gems\activerecord-2.3.8\lib\active_record\connection_adapters
\abstract\schema_statements.rb
Regards,
THuynh