Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Create a new database for COmanage Registry. You can name the new database whatever you like. Set the configuration information, including the password to connect to the database with, in app/config/database.php.

For COmanage Registry 0.3 and later

Set up the database schema.

Code Block

$ cd cake/console
$ ./cake database
[...]
Database schema update successful
note
Note
titleUpgrading Database Schemas

Upgrading from 0.2 or earlier to 0.3 or later is not supported.

When upgrading the database schema (past 0.3) on Postgres, you may see "Possibly failed to update database schema" instead. This is probably OK. (CO-165)note}

For COmanage Registry 0.1 and 0.2

Set up the database schema. You will need permission to write to the tmp directory (set above) to run this command.

Code Block

$ cd cake/console
$ sudo ./cake schema create -s 4
...
The following table(s) will be dropped.
...
Are you sure you want to drop the table(s)? (y/n)
[n] > n

The following table(s) will be created.
...
Are you sure you want to create the table(s)? (y/n)
[y] > y
...
End create.

If you get the error message /path/to/app/config/schema/schema.php could not be loaded while trying to create the schema, you are running an old version of the PCRE library. See the warning earlier on this page for more information.

Note
Note
titleUpgrading from 0.1 to 0.2

There is not currently an elegant way to upgrade database schemas that involve new tables (see COmanage and CakePHP issue tracking).

To upgrade 0.1 to 0.2, run ./cake schema create -s 4 as above. Be sure to answer no when asked to drop the existing tables, or else you will lose all your existing data. You will also see a bunch of errors about tables already existing – you can safely ignore those.

Code Block
[...]
The following table(s) will be dropped.
[...]
Are you sure you want to drop the table(s)? (y/n)
[n] > n <-- be sure to answer n here!

The following table(s) will be created.
[...]
Are you sure you want to create the table(s)? (y/n)
[y] > y
[lots of warnings about existing tables]

TBD: It's unclear if this will catch ALTER TABLE statements. If not, running ./cake schema update -s 4 afterwards should fix things up.

...