Mike Bailey

First Post(gresql)!

Filed under: postgresql — mbailey @ 2:43 am on April 21, 2009

Update: DB Table permissions don’t belong in migrations and aren’t added to schema.rb. I’ve added them to the bootstrap rake tasks.

I’m a postgresql newbie and suspect there will be a few more of us now that Oracle has brought Mysql. I’ve heard Ruby on Rails is a bit mysql centric. I know I have been for a few years. So I think it’s time to dust off the old blog and put it to use.

Postgresql permissions on a table appear to be removed when the table is removed.

I’ve added the following Rails migration to grant an outside user access to a single table in the schema:

class SetupRecipePerms < ActiveRecord::Migration
  def self.up
    ActiveRecord::Base.connection.execute "grant select,update,insert,delete on recipes to eggs_recipes;"
    if ActiveRecord::Base.connection.adapter_name == 'PostgreSQL'
      ActiveRecord::Base.connection.execute "grant select,update on sequence recipes_id_seq to eggs_recipes;"
    end
  end
  ...

This doesn’t get added to schema.rb so doesn’t get run by “rake db:schema:load”

Will it get added to schema.rb if I’m running postgres locally (making it db dependent)?
How else might I add permissions as part of the standard Rails db setup?

growing your Xen guest disks with xen-resize-guest

Filed under: Uncategorized — mbailey @ 6:23 am on August 29, 2008

cherry picking git commits

Filed under: deprec, git, development — mbailey @ 2:27 pm on August 20, 2008

How to use deprec-1 when deprec-2 gem is released

Filed under: ruby on rails, capistrano, deprec — mbailey @ 2:16 pm on June 9, 2008

Getting monit to restart mongrel after a crash

Filed under: ruby on rails, deployment — mbailey @ 4:27 am on May 6, 2008

OmniFocus - GTD for OSX

Filed under: productivity — Mike Bailey @ 4:33 am on October 24, 2007

capistrano and rake

Filed under: ruby on rails, capistrano, deprec — Mike Bailey @ 3:30 am on October 8, 2007

Using rails-1.2.3 with Rails 2.0 Preview release installed

Filed under: ruby on rails — Mike Bailey @ 2:42 pm on October 3, 2007

Slides from my talk on Jester

Filed under: ruby on rails, javascript — Mike Bailey @ 7:28 am on

Good summary of DHH Keynote at RailsConf Europe 2007

Filed under: ruby on rails — Mike Bailey @ 9:20 am on September 21, 2007
Next Page »
Copyright 2007 Mike Bailey. All Rights Reserved