Opened 16 years ago

Closed 15 years ago

Last modified 13 years ago

#715 closed Task (fixed)

Keeping track of applied database updates

Reported by: Eric Myers Owned by: davea
Priority: Undetermined Milestone: Undetermined
Component: Server - Other Version:
Keywords: database update Cc:

Description

I suspect many projects don't upgrade because it is not easy to do, and one thing that takes time and attention is doing the database updates. You have to sort out by hand which ones you've already applied and only apply the new ones. It would be very useful if a log was kept of which updates had been applied. Even better, when running the update script have it check this log and decline to apply the updates which have already been applied.

The attached file, db_update_util.php, contains a modified version of the do_query() function which does all that. It can handle updates which consist of more than one mySQL request. The log file db_update.log is kept in the project log directory, and while the lines written to it by do_query() have a timestamp, one can also add lines by hand with just the names of previously applied updates.

Attachments (1)

db_update_util.php (4.1 KB) - added by Eric Myers 16 years ago.
Modified do_query() to keep a log of applied database updates.

Download all attachments as: .zip

Change History (13)

Changed 16 years ago by Eric Myers

Attachment: db_update_util.php added

Modified do_query() to keep a log of applied database updates.

comment:1 Changed 16 years ago by Nicolas

Type: EnhancementTask

comment:2 Changed 16 years ago by davea

Resolution: wontfix
Status: newclosed

This seems like a lot of code for little gain; It's easy to see if an update has been applied (e.g., "explain app" in mysql) and it's a no-op if you try to apply an update twice.

What I'd rather see is for "upgrade" to do the needed updates automatically (after a y/n confirmation)

comment:3 Changed 16 years ago by Nicolas

Resolution: wontfix
Status: closedreopened

#597, #600, and #602 also look like a lot of code for little gain (compared to other more important tasks). That's why they were marked as "complex" in DevProjects.

To have "upgrade" do the needed updates automatically, you need to keep track of them so this isn't useless.

Keeping track of database updates is important. Maybe Eric's script isn't the best to do it. Tickets don't necessarily need to be closed with the suggested fix.

comment:4 in reply to:  2 Changed 16 years ago by Eric Myers

Replying to davea:

This seems like a lot of code for little gain;

It is lot of code, but not all that much. That point is irrelevant. It was very useful for me, and hopefully will be to others. The polite and correct response is "Thank You". Or "no thank you".

It's easy to see if an update has been applied (e.g., "explain app" in mysql)

But that is manual. You have to do that for each one. Many people running projects just won't bother. This makes it easier.

and it's a no-op if you try to apply an update twice.

Maybe. Depends on what the update does. And when you run an update twice you do get error messages that can make it seem there is a problem. Just run it once.

What I'd rather see is for "upgrade" to do the needed updates automatically (after a y/n confirmation)

Then I'll add that next to the upgrade script, which I've also just been working on. Dead easy, given this bit.

comment:5 Changed 16 years ago by davea

Um, the correct way to contribute code to BOINC is to propose and discuss the design (with me and boinc_dev) first, program second.

comment:6 in reply to:  5 Changed 16 years ago by Eric Myers

Replying to davea:

Um, the correct way to contribute code to BOINC is to propose and discuss the design (with me and boinc_dev) first, program second.

Sorry, I did not mean to be snippy. I'm just frustrated you don't see the utility of my idea. I realize I need to convince you. I will. :-)

I'm trying to find the right way to contribute things. I recently sent you and Rom some notes on small problems I found and got no response, so it seems those are more appropriate for tickets. I will file them. I coded this enhancement because I really wanted it (otherwise I'd never update my project) and thought I'd share it. I thought I'd file that as a ticket too. I guess that was wrong.

There are so many different channels of communication available that it's not always clear which one is the correct one for the particular message. Sorry.

comment:7 in reply to:  5 Changed 16 years ago by Nicolas

Replying to davea:

Um, the correct way to contribute code to BOINC is to propose and discuss the design (with me and boinc_dev) first, program second.

When have official devs done that? I've yet to see the design proposal of the multithreaded GUI RPCs.

comment:8 in reply to:  5 Changed 16 years ago by Didactylos

Replying to davea:

Um, the correct way to contribute code to BOINC is to propose and discuss the design (with me and boinc_dev) first, program second.

Tried that. Wasted a year of my life. Thanks for that!

The process has to go both ways, or it doesn't work.

comment:9 Changed 16 years ago by Nicolas

Related (duplicate?): #745.

comment:10 Changed 15 years ago by Nicolas

Keywords: from-devprojects added

comment:11 Changed 15 years ago by Nicolas

Keywords: from-devprojects removed

oops

comment:12 Changed 15 years ago by davea

Resolution: fixed
Status: reopenedclosed

This is implemented by html/ops/db_update.php

Note: See TracTickets for help on using tickets.