Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: DBMail: users

Simple test for database schema version?

 

 

DBMail users RSS feed   Index | Next | Previous | View Threaded


rcsheets at picosecond

Feb 5, 2009, 8:22 PM

Post #1 of 12 (2330 views)
Permalink
Simple test for database schema version?

I have just reinstalled dbmail, after testing it out several months ago,
and it would be very convenient to use the same database tables I was
using when I tried it out before. I'm not entirely sure which version I
was using before, though, and I'd like to determine if I need to make
any schema changes.

Given just the database tables, is there a way to tell whether any
updates are needed to get up to the current schema?
--
Robert C. Sheets
Picosecond Software
_______________________________________________
DBmail mailing list
DBmail [at] dbmail
https://mailman.fastxs.nl/mailman/listinfo/dbmail


paul at nfg

Feb 5, 2009, 11:56 PM

Post #2 of 12 (2233 views)
Permalink
Re: Simple test for database schema version? [In reply to]

Did you run a stable (2.2) version or a development (2.3) version?

In case of the first: no schema changes have happened in the stable series.

In case of the latter: I'd need to see a schema dump.


Robert C. Sheets wrote:
> I have just reinstalled dbmail, after testing it out several months ago,
> and it would be very convenient to use the same database tables I was
> using when I tried it out before. I'm not entirely sure which version I
> was using before, though, and I'd like to determine if I need to make
> any schema changes.
>
> Given just the database tables, is there a way to tell whether any
> updates are needed to get up to the current schema?


--
________________________________________________________________
Paul Stevens paul at nfg.nl
NET FACILITIES GROUP GPG/PGP: 1024D/11F8CD31
The Netherlands________________________________http://www.nfg.nl
_______________________________________________
DBmail mailing list
DBmail [at] dbmail
https://mailman.fastxs.nl/mailman/listinfo/dbmail


rcsheets at picosecond

Feb 6, 2009, 12:04 AM

Post #3 of 12 (2229 views)
Permalink
Re: Simple test for database schema version? [In reply to]

Paul J Stevens wrote:
> Did you run a stable (2.2) version or a development (2.3) version?

I'm almost certain it would've been a 2.2 version, but the servers are
long since gone so I can't actually check.

> In case of the first: no schema changes have happened in the stable series.

Cool. If I happen to get it horribly wrong and attempt to run a 2.2
version against a 2.3.x database schema, would you expect everything to
fail in some very obvious way, or might things seem to work fine for a
while and then catch fire later?
--
Robert C. Sheets
Picosecond Software
_______________________________________________
DBmail mailing list
DBmail [at] dbmail
https://mailman.fastxs.nl/mailman/listinfo/dbmail


paul at nfg

Feb 6, 2009, 12:09 AM

Post #4 of 12 (2228 views)
Permalink
Re: Simple test for database schema version? [In reply to]

Robert C. Sheets wrote:
> Paul J Stevens wrote:
>> Did you run a stable (2.2) version or a development (2.3) version?
>
> I'm almost certain it would've been a 2.2 version, but the servers are
> long since gone so I can't actually check.
>
>> In case of the first: no schema changes have happened in the stable
>> series.
>
> Cool. If I happen to get it horribly wrong and attempt to run a 2.2
> version against a 2.3.x database schema, would you expect everything to
> fail in some very obvious way, or might things seem to work fine for a
> while and then catch fire later?


I don't know. I've never tried that. The other way around won't work. If
you run 2.3 on a 2.2 schema, sanity checks will kick in. But those are
rather crude and will only check for the presence of some new table or
other. Those checks will *not* verify smaller changes like the width of
a field, the presence of a index, and stuff like that.

--
________________________________________________________________
Paul Stevens paul at nfg.nl
NET FACILITIES GROUP GPG/PGP: 1024D/11F8CD31
The Netherlands________________________________http://www.nfg.nl
_______________________________________________
DBmail mailing list
DBmail [at] dbmail
https://mailman.fastxs.nl/mailman/listinfo/dbmail


michael.monnerie at is

Feb 6, 2009, 2:12 AM

Post #5 of 12 (2229 views)
Permalink
Re: Simple test for database schema version? [In reply to]

On Freitag 06 Februar 2009 Robert C. Sheets wrote:
> I'm almost certain it would've been a 2.2 version, but the servers
> are long since gone so I can't actually check.

Restore the DB then show us which tables exist now. Then it's possible
to see which version was used.

BTW Paul: Wouldn't it be good to create a table "version" with two
columns "name" & "version" where you write schema=2.2.10 or whatever? So
the scripts that upgrade the schema could verify what version we are on
and what to do to upgrade (to any desired version)?

mfg zmi
--
// Michael Monnerie, Ing.BSc ----- http://it-management.at
// Tel: 0660 / 415 65 31 .network.your.ideas.
// PGP Key: "curl -s http://zmi.at/zmi.asc | gpg --import"
// Fingerprint: AC19 F9D5 36ED CD8A EF38 500E CE14 91F7 1C12 09B4
// Keyserver: wwwkeys.eu.pgp.net Key-ID: 1C1209B4

_______________________________________________
DBmail mailing list
DBmail [at] dbmail
https://mailman.fastxs.nl/mailman/listinfo/dbmail


paul at nfg

Feb 6, 2009, 2:29 AM

Post #6 of 12 (2226 views)
Permalink
Re: Simple test for database schema version? [In reply to]

Michael Monnerie wrote:
> On Freitag 06 Februar 2009 Robert C. Sheets wrote:
>> I'm almost certain it would've been a 2.2 version, but the servers
>> are long since gone so I can't actually check.
>
> Restore the DB then show us which tables exist now. Then it's possible
> to see which version was used.
>
> BTW Paul: Wouldn't it be good to create a table "version" with two
> columns "name" & "version" where you write schema=2.2.10 or whatever? So
> the scripts that upgrade the schema could verify what version we are on
> and what to do to upgrade (to any desired version)?

Since schema changes in mysql are not atomic, I don't see how that could
be done reliably.



--
________________________________________________________________
Paul Stevens paul at nfg.nl
NET FACILITIES GROUP GPG/PGP: 1024D/11F8CD31
The Netherlands________________________________http://www.nfg.nl
_______________________________________________
DBmail mailing list
DBmail [at] dbmail
https://mailman.fastxs.nl/mailman/listinfo/dbmail


michael.monnerie at is

Feb 6, 2009, 2:52 AM

Post #7 of 12 (2225 views)
Permalink
Re: Simple test for database schema version? [In reply to]

On Freitag 06 Februar 2009 Paul J Stevens wrote:
> Since schema changes in mysql are not atomic, I don't see how that
> could be done reliably.

insert (name,value) = 'go_to_version','2.3.5'
before the script starts, and remove that if everything went OK. And if
something broke, you can see both old and new versions to debug.

Because anyway, if it's not atomic and the script breaks, you'll have a
mess in case of problems. That can't be solved automatically, right?

mfg zmi
--
// Michael Monnerie, Ing.BSc ----- http://it-management.at
// Tel: 0660 / 415 65 31 .network.your.ideas.
// PGP Key: "curl -s http://zmi.at/zmi.asc | gpg --import"
// Fingerprint: AC19 F9D5 36ED CD8A EF38 500E CE14 91F7 1C12 09B4
// Keyserver: wwwkeys.eu.pgp.net Key-ID: 1C1209B4

_______________________________________________
DBmail mailing list
DBmail [at] dbmail
https://mailman.fastxs.nl/mailman/listinfo/dbmail


jake at vapourforge

Feb 6, 2009, 3:05 AM

Post #8 of 12 (2228 views)
Permalink
Re: Simple test for database schema version? [In reply to]

Michael Monnerie wrote:
> On Freitag 06 Februar 2009 Paul J Stevens wrote:
>
>> Since schema changes in mysql are not atomic, I don't see how that
>> could be done reliably.
>>
>
> insert (name,value) = 'go_to_version','2.3.5'
> before the script starts, and remove that if everything went OK. And if
> something broke, you can see both old and new versions to debug.
>
> Because anyway, if it's not atomic and the script breaks, you'll have a
> mess in case of problems. That can't be solved automatically, right?
>
> mfg zmi
>
I'm for it, perhaps even a "general info" table.
It wouldn't be absolutely guaranteed but it would be helpful when
looking at old dumps and the like.


michael.monnerie at is

Feb 6, 2009, 5:23 AM

Post #9 of 12 (2222 views)
Permalink
Re: Simple test for database schema version? [In reply to]

On Freitag 06 Februar 2009 Jake Anderson wrote:
> It wouldn't be absolutely guaranteed but it would be helpful when
> looking at old dumps and the like.

You could then use it as history:
date,name,value
1.1.2002 version_hist 2.0.0
15.10.2005 version_hist 2.2.7
17.10.2005 version_hist 2.2.9
1.1.2009 version 2.3.5

And on upgrade, version becomes version_hist.

mfg zmi
--
// Michael Monnerie, Ing.BSc ----- http://it-management.at
// Tel: 0660 / 415 65 31 .network.your.ideas.
// PGP Key: "curl -s http://zmi.at/zmi.asc | gpg --import"
// Fingerprint: AC19 F9D5 36ED CD8A EF38 500E CE14 91F7 1C12 09B4
// Keyserver: wwwkeys.eu.pgp.net Key-ID: 1C1209B4

_______________________________________________
DBmail mailing list
DBmail [at] dbmail
https://mailman.fastxs.nl/mailman/listinfo/dbmail


rcsheets at picosecond

Feb 6, 2009, 7:08 AM

Post #10 of 12 (2224 views)
Permalink
Re: Simple test for database schema version? [In reply to]

Michael Monnerie wrote:
> On Freitag 06 Februar 2009 Robert C. Sheets wrote:
>> I'm almost certain it would've been a 2.2 version, but the servers
>> are long since gone so I can't actually check.
>
> Restore the DB then show us which tables exist now. Then it's possible
> to see which version was used.

Here's the list:

List of relations
Schema | Name | Type | Owner
--------+---------------------------+-------+--------
public | dbmail_acl | table | dbmail
public | dbmail_aliases | table | dbmail
public | dbmail_auto_notifications | table | dbmail
public | dbmail_auto_replies | table | dbmail
public | dbmail_ccfield | table | dbmail
public | dbmail_datefield | table | dbmail
public | dbmail_envelope | table | dbmail
public | dbmail_fromfield | table | dbmail
public | dbmail_headername | table | dbmail
public | dbmail_headervalue | table | dbmail
public | dbmail_mailboxes | table | dbmail
public | dbmail_messageblks | table | dbmail
public | dbmail_messages | table | dbmail
public | dbmail_pbsp | table | dbmail
public | dbmail_physmessage | table | dbmail
public | dbmail_referencesfield | table | dbmail
public | dbmail_replycache | table | dbmail
public | dbmail_replytofield | table | dbmail
public | dbmail_sievescripts | table | dbmail
public | dbmail_subjectfield | table | dbmail
public | dbmail_subscription | table | dbmail
public | dbmail_tofield | table | dbmail
public | dbmail_usermap | table | dbmail
public | dbmail_users | table | dbmail
(24 rows)


--
Robert C. Sheets
Picosecond Software
_______________________________________________
DBmail mailing list
DBmail [at] dbmail
https://mailman.fastxs.nl/mailman/listinfo/dbmail


paul at nfg

Feb 6, 2009, 8:07 AM

Post #11 of 12 (2228 views)
Permalink
Re: Simple test for database schema version? [In reply to]

That's a 2.2 schema

Robert C. Sheets wrote:
> Michael Monnerie wrote:
>> On Freitag 06 Februar 2009 Robert C. Sheets wrote:
>>> I'm almost certain it would've been a 2.2 version, but the servers
>>> are long since gone so I can't actually check.
>>
>> Restore the DB then show us which tables exist now. Then it's possible
>> to see which version was used.
>
> Here's the list:
>
> List of relations
> Schema | Name | Type | Owner
> --------+---------------------------+-------+--------
> public | dbmail_acl | table | dbmail
> public | dbmail_aliases | table | dbmail
> public | dbmail_auto_notifications | table | dbmail
> public | dbmail_auto_replies | table | dbmail
> public | dbmail_ccfield | table | dbmail
> public | dbmail_datefield | table | dbmail
> public | dbmail_envelope | table | dbmail
> public | dbmail_fromfield | table | dbmail
> public | dbmail_headername | table | dbmail
> public | dbmail_headervalue | table | dbmail
> public | dbmail_mailboxes | table | dbmail
> public | dbmail_messageblks | table | dbmail
> public | dbmail_messages | table | dbmail
> public | dbmail_pbsp | table | dbmail
> public | dbmail_physmessage | table | dbmail
> public | dbmail_referencesfield | table | dbmail
> public | dbmail_replycache | table | dbmail
> public | dbmail_replytofield | table | dbmail
> public | dbmail_sievescripts | table | dbmail
> public | dbmail_subjectfield | table | dbmail
> public | dbmail_subscription | table | dbmail
> public | dbmail_tofield | table | dbmail
> public | dbmail_usermap | table | dbmail
> public | dbmail_users | table | dbmail
> (24 rows)
>
>


--
________________________________________________________________
Paul Stevens paul at nfg.nl
NET FACILITIES GROUP GPG/PGP: 1024D/11F8CD31
The Netherlands________________________________http://www.nfg.nl
_______________________________________________
DBmail mailing list
DBmail [at] dbmail
https://mailman.fastxs.nl/mailman/listinfo/dbmail


rcsheets at picosecond

Feb 6, 2009, 9:58 AM

Post #12 of 12 (2214 views)
Permalink
Re: Simple test for database schema version? [In reply to]

Paul J Stevens wrote:
> That's a 2.2 schema

Thank you very much!

--
Robert C. Sheets
Picosecond Software
_______________________________________________
DBmail mailing list
DBmail [at] dbmail
https://mailman.fastxs.nl/mailman/listinfo/dbmail

DBMail users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.