# Pleas Help Me regarding rake db:migrate

**URL:** <https://www.ruby-forum.com/t/pleas-help-me-regarding-rake-db-migrate/189352>\
**Category:** Rails\
**Created:** [May 29, 2010, 9:52am UTC](https://www.ruby-forum.com/t/pleas-help-me-regarding-rake-db-migrate/189352 "2010-05-29T09:52:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mundrakrishna](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/73ab20/32.png) [@mundrakrishna](https://www.ruby-forum.com/u/mundrakrishna)\
**Post date:** [May 29, 2010, 9:52am UTC](https://www.ruby-forum.com/t/pleas-help-me-regarding-rake-db-migrate/189352/1 "2010-05-29T09:52:35Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mundrakrishna](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/73ab20/32.png) [@mundrakrishna](https://www.ruby-forum.com/u/mundrakrishna)\
**Post date:** [May 29, 2010, 2:19pm UTC](https://www.ruby-forum.com/t/pleas-help-me-regarding-rake-db-migrate/189352/2 "2010-05-29T14:19:43Z")

</div>

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](http://www.marnen.org)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![mundrakrishna](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/73ab20/32.png) [@mundrakrishna](https://www.ruby-forum.com/u/mundrakrishna)\
**Post date:** [May 29, 2010, 7:37pm UTC](https://www.ruby-forum.com/t/pleas-help-me-regarding-rake-db-migrate/189352/3 "2010-05-29T19:37:16Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mundrakrishna](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/73ab20/32.png) [@mundrakrishna](https://www.ruby-forum.com/u/mundrakrishna)\
**Post date:** [May 29, 2010, 7:39pm UTC](https://www.ruby-forum.com/t/pleas-help-me-regarding-rake-db-migrate/189352/4 "2010-05-29T19:39:37Z")

</div>

I mean delete books table manually from Database if you don’t have two  
migration files creating books table.

---

<div class="post-metadata">

**Author:** ![mundrakrishna](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/73ab20/32.png) [@mundrakrishna](https://www.ruby-forum.com/u/mundrakrishna)\
**Post date:** [June 21, 2010, 3:01am UTC](https://www.ruby-forum.com/t/pleas-help-me-regarding-rake-db-migrate/189352/5 "2010-06-21T03:01:34Z")

</div>

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  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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
