Edgewall Software
Modify

Opened 17 years ago

Closed 15 years ago

Last modified 15 years ago

#273 closed enhancement (worksforme)

Perform automatic upgrade of Trac DB on install

Reported by: manu.blot@… Owned by: osimons
Priority: minor Milestone:
Component: Infrastructure Version: 0.5.3
Keywords: Cc:
Operating System: BSD

Description

  1. If a new Trac env is created and inherit from a .ini file that enables Bitten, it fails on the first start because Bitten has not yet created the required tables in Trac DB
  2. Bitten cannot be installed from the WebAdmin interface, since as soon as it is activated, it throws up an error because of the required Trac DB update.

It would be nice that Bitten automatically upgrades the Trac DB at deployment time.

Attachments (0)

Change History (6)

comment:1 Changed 16 years ago by anonymous

I wonder if this is diserable when you host several Trac projects and you only want to use Bitten for example 1 of those.

When you enable Bitten it should automatic perform the upgrade if this is possible.

comment:2 follow-up: Changed 15 years ago by osimons

  • Owner changed from cmlenz to osimons

See trac:ticket:7082 for a long discussion about auto-upgrading Trac.

However, for your first point: Passing --inherit=/path/to/inherited/trac.ini as a final trac-admin initenv option should really enable Bitten and create the tables automatically (if Bitten was enabled in that shared config)? What is it that don't work about this?

Personally I think it is best that Bitten follows the practice from all other plugins, and don't automatically upgrade the database. However, for my own needs it may be necessary to split the IEnvironmentSetupParticipant (main.py) into its own class or module so that it can be enabled independently of all the actual features (and thereby allow automatic upgrade via a shared config file).

comment:3 in reply to: ↑ 2 Changed 15 years ago by eblot

Replying to osimons:

However, for your first point: Passing --inherit=/path/to/inherited/trac.ini as a final trac-admin initenv option should really enable Bitten and create the tables automatically (if Bitten was enabled in that shared config)? What is it that don't work about this?

I never tried this option, I should start doing so ;-)

Personally I think it is best that Bitten follows the practice from all other plugins, and don't automatically upgrade the database.

See my second point: when you enable this plugin from the web interface, it screws the whole project until the admin takes control over the command line to fix up the issue. At the very least, it should not prevent from using the project. What if the command-line is not available for some reason?

comment:4 Changed 15 years ago by osimons

  • Milestone 0.6 deleted

comment:5 Changed 15 years ago by osimons

  • Resolution set to worksforme
  • Status changed from new to closed

In [727] I've split the IEnvironmentSetupParticipant implementation into its own class. This makes it easier to manage multi-project install and keeping the database up-to-date across many projects.

Enable in a shared trac.ini config to keep database up-to-date without any other Bitten-related components enabled.

[components]
bitten.main.BuildSetup = enabled

As for the auto-upgrade, I don't see that being done by Bitten as it contradicts with "The Trac Way" of doing things. Some have looked into ways of changing this behaviour, such as trac-hacks:AutoUpgradePlugin.

The original request is not really fulfilled, but there are now ways of achieving similar behaviour so I'm closing as worksforme.

comment:6 Changed 15 years ago by osimons

And, just today a prime example of why upgrades cannot really be reliably be automated: #214

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain osimons.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.