# Problem with migrate

**URL:** <https://www.ruby-forum.com/t/problem-with-migrate/105964>\
**Category:** Rails\
**Created:** [June 5, 2007, 12:12am UTC](https://www.ruby-forum.com/t/problem-with-migrate/105964 "2007-06-05T00:12:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jhon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/87869e/32.png) [@jhon](https://www.ruby-forum.com/u/jhon)\
**Post date:** [June 5, 2007, 12:12am UTC](https://www.ruby-forum.com/t/problem-with-migrate/105964/1 "2007-06-05T00:12:46Z")

</div>

I have the following file named 001\_create\_videos.rb under db folder,  
and it contains this:

class CreateVideos \< ActiveRecord::Migration  
def self.up  
create\_table :videos do |t|  
t.column “texto”, :string  
t.column “content\_type”, :string  
t.column “filename”, :string  
t.column “size”, :integer

```
  # used with thumbnails, always required
  t.column "parent_id", :integer
  t.column "thumbnail", :string
end

# only for db-based files
# create_table :db_files, :force => true do |t|
# t.column :data, :binary
# end

```

end

def self.down  
drop\_table :videos

```
# only for db-based files
# drop_table :db_files

```

end  
end

and when I do a db:migrate it tells me this: don’t know how to build  
task ‘001\_create\_videos.rb’  
I also tried with rake db:migrate without luck.  
Can anybody help me?

---

<div class="post-metadata">

**Author:** ![jhon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/87869e/32.png) [@jhon](https://www.ruby-forum.com/u/jhon)\
**Post date:** [June 5, 2007, 12:47am UTC](https://www.ruby-forum.com/t/problem-with-migrate/105964/2 "2007-06-05T00:47:16Z")

</div>

Did you use script/generate migration? Migrations need to be under  
db/migrate.

Jason

---

<div class="post-metadata">

**Author:** ![jhon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/87869e/32.png) [@jhon](https://www.ruby-forum.com/u/jhon)\
**Post date:** [June 5, 2007, 12:50am UTC](https://www.ruby-forum.com/t/problem-with-migrate/105964/3 "2007-06-05T00:50:38Z")

</div>

it is under migrate

---

<div class="post-metadata">

**Author:** ![jhon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/87869e/32.png) [@jhon](https://www.ruby-forum.com/u/jhon)\
**Post date:** [June 6, 2007, 11:24am UTC](https://www.ruby-forum.com/t/problem-with-migrate/105964/4 "2007-06-06T11:24:34Z")

</div>

that migration is perfectly fine, I gather it’s been made my  
acts\_as\_attachment or attachment\_foo plugin??? Anyhow, I have the  
exact same migration(without the “texto” column and it runs no  
problems, so it might be a different problem.

Is your database.yml connected? When you start the sever and go to the  
index page, does rails have the db adapter field filled in? Sounds to  
me like it can’t connect to the db.
