# Synatx error while running migration

**URL:** <https://www.ruby-forum.com/t/synatx-error-while-running-migration/172451>\
**Category:** Rails\
**Created:** [July 21, 2009, 7:39pm UTC](https://www.ruby-forum.com/t/synatx-error-while-running-migration/172451 "2009-07-21T19:39:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![virendra](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/e68b1a/32.png) [@virendra](https://www.ruby-forum.com/u/virendra)\
**Post date:** [July 21, 2009, 7:39pm UTC](https://www.ruby-forum.com/t/synatx-error-while-running-migration/172451/1 "2009-07-21T19:39:49Z")

</div>

hello to all,  
i am getting weird syntax error while running the rake db:migrate  
syntax error, unexpected tSYMBEG, expecting kDO or ‘{’ or ‘(’

Apparently i am creating an engine in my main application using  
‘ruby script/generate plugin’ command in rails 2.3.0 with engine having  
its own separate database define in database.yml of main application  
something like this  
#database of my main application  
development:  
adapter: mysql  
encoding: utf8  
database: user\_development  
pool: 5  
username: root  
password: root123  
host: localhost

#database of the engine  
PMS:  
adapter: mysql  
database: pms  
username: root  
password: root123  
host: localhost

i have also define the necessary code inside my all engine models and  
migration files  
like this  
code of  
project.rb

class Project \< ActiveRevcord::Base  
self.establish\_connection :pms  
end

/db/migrate/20090715172542\_create\_projects.rb

```
class CreateProjects < ActiveRecord::Migration
  def self.connection

```

Project.connection  
end

```
   def self.up
     create_table :projects do |t|
      t.string :name
      t.text :description
      t.integer :manager_id

       t.timestamps
    end
   end

    def self.down
      drop_table :projects
    end
   end

```

and one finale thing is that i have also setup many-to-many association  
between Model of my main application and Model of my engine  
i.e between User model of main application and Project Model of engine

The point of telling all this is i am starting to think whether i done  
something wrong somewhere cuz the databases is created but i always get  
the error define above while running migrations

---

<div class="post-metadata">

**Author:** ![virendra](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/e68b1a/32.png) [@virendra](https://www.ruby-forum.com/u/virendra)\
**Post date:** [July 21, 2009, 11:02pm UTC](https://www.ruby-forum.com/t/synatx-error-while-running-migration/172451/2 "2009-07-21T23:02:31Z")

</div>

Hey Virendra,

Run `rake db:migrate --trace` to see what line in what source file the  
error  
is.

Regards,  
Gustav P.

On Tue, Jul 21, 2009 at 7:39 PM, Virendra N. \<
