[OSM-dev] How do I build the latest db schema?

Tom Hughes tom at compton.nu
Wed Jun 27 08:20:18 BST 2007

In message <4681E99B.6070202 at bretth.com>
        Brett Henderson <brett at bretth.com> wrote:

> Is there a script somewhere for building the current database schema?

Yes, and by the sounds of things you have found it.

> The database schema wiki page at 
> http://wiki.openstreetmap.org/index.php/Database_schema links to 
> http://trac.openstreetmap.org/browser/sites/rails_port/db/create_database.sql 
> but this link is broken.

That is out of date. I removed that file the other day because it
is no longer current.

> Checking the sites\rails_port\db directory in svn, I found a file named 
> readme stating to use a ruby rake tool.

Exactly. That is the correct way to do things now.

> In addition, there is a file in a migrate subdirectory called 
> 001_create_osm_db.rb that seems to contain a complete schema, not just a 
> migration from an older schema.  Given that it is 001, perhaps this is 
> intended to be the first such script.

The first migration migrates from an empty database which is the
baseline to where we are now. There will be a second one shortly
to tidy some things up.

> Is rake the preferred method for building the latest schema?  If so, 
> I'll try to get it running.

It is, yes. Please shout if you have any problems with it as it
should work and produce something matches the live system.


Tom Hughes (tom at compton.nu)

More information about the dev mailing list