# Conflict between before\_create with db:migrate

**URL:** <https://www.ruby-forum.com/t/conflict-between-before-create-with-db-migrate/157800>\
**Category:** Rails\
**Created:** [January 15, 2009, 1:12pm UTC](https://www.ruby-forum.com/t/conflict-between-before-create-with-db-migrate/157800 "2009-01-15T13:12:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rubyernewbie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/9dc877/32.png) [@rubyernewbie](https://www.ruby-forum.com/u/rubyernewbie)\
**Post date:** [January 15, 2009, 1:12pm UTC](https://www.ruby-forum.com/t/conflict-between-before-create-with-db-migrate/157800/1 "2009-01-15T13:12:39Z")

</div>

I have a User and Folder model  
class User  
has\_many :folders  
before\_create :make\_box

def make\_box  
folders.build(:name =\> “red”)  
end

# when I run db:migrate, the got a error!

# Mysql::Error: Table ‘kaixin2009\_development.folders’ doesn’t exist: SHOW FIELDS FROM `folders`

so what’s wrong with my operation?

---

<div class="post-metadata">

**Author:** ![rubyernewbie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/9dc877/32.png) [@rubyernewbie](https://www.ruby-forum.com/u/rubyernewbie)\
**Post date:** [January 15, 2009, 1:15pm UTC](https://www.ruby-forum.com/t/conflict-between-before-create-with-db-migrate/157800/2 "2009-01-15T13:15:56Z")

</div>

Hi,

Do you have a migration for creating folders table?

NAYAK

On Thu, Jan 15, 2009 at 5:42 PM, Zhenning G. \<  
removed\_email\_address@domain.invalid\> wrote:

> # when I run db:migrate, the got a error!
> 
> # Mysql::Error: Table ‘kaixin2009\_development.folders’ doesn’t exist: SHOW FIELDS FROM `folders`
> 
> ## so what’s wrong with my operation?
> 
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> >

–

- NAYAK
