This project is archived and is in readonly mode.

#1605 ✓stale
Jim Gay

[PATCH] Create schema during 'rake db:create' from schema_search_path if it does not exist for PostgreSQL

Reported by Jim Gay | December 20th, 2008 @ 05:47 AM | in 3.0.2

Setting a non-existent schema name for the schema_search_path will cause errors when trying to migrate:

PGError: ERROR:  schema "products" does not exist
: SET search_path TO products, public (UPDATED commit) adds methods to the postgresql_adapter:

  • create_schema(name, username) (creating the schema for the given user)
  • all_schemas (returning an array of schema names)
  • has_schema?(name) (returns boolean based on the existence of the given schema)

With this patch, the message "Schema products has been created." will be output when the schema is first created.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href=""></a>