Hello, On 11/18/2011 11:37 PM, Nelson Brown wrote:
... * Upgrading db Adding Contacts Table Executing CREATE TABLE contact ( id integer PRIMARY KEY, first text, last text, position text, email text, phone text ); Executing CREATE UNIQUE INDEX contact_id_idx ON contact (id); Updating System Table Executing INSERT into system values ('contacts_version', 1) Exception: Intentional ExceptionAnd when I run trac-admin upgrade directly subsequent on the same environment. No installed contacts table. Contacts needs an upgrade * Upgrading db Adding Contacts Table Executing CREATE TABLE contact ( id integer PRIMARY KEY, first text, last text, position text, email text, phone text ); OperationalError: table contact already exists So the system table was the only execute statement to be rolled back in the with block. Otherwise, we wouldn't be in this method. So is that intentional?
It's rather that you can't really avoid it, as some backends (like SQLite) can't rollback changes to the data model (the DDL statements like CREATE TABLE, ALTER TABLE, etc.). One workaround would be to record what you created and at the end, if you detect that a rollback happened, drop the tables and indexes which have been created so far.
-- Christian -- You received this message because you are subscribed to the Google Groups "Trac Development" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/trac-dev?hl=en.
