04
Jul
12

creating a postgresql schema from inside a rails migration


If you ever need to create a schema from inside a migration, write this:


def up
  execute "CREATE SCHEMA some_schema"
end

def down
  execute "DROP SCHEMA some_schema"
end
Advertisements

0 Responses to “creating a postgresql schema from inside a rails migration”



  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Blog Stats

  • 226,721 hits

%d bloggers like this: