Skip Menu |

This queue is for tickets about the DBIx-VersionedDDL CPAN distribution.

Report information
The Basics
Id: 86702
Status: resolved
Priority: 0/
Queue: DBIx-VersionedDDL

People
Owner: Nobody in particular
Requestors: JIRA [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: (no value)
Fixed in: (no value)



Subject: Bug in _get_current_version
Hello,

line 336:  my $sql  = q{select version from schema_version};
should be changed to
my $sql  = q{select max(version) from schema_version};

Right now it returns the lowest number in the version column (at least on postgres).
Hi I'm not really familiar with Postgres, but with most DBs I use, unless you provide an order by clause, you don't know what order the rows will appear in. However, I'm concerned that you have two numbers in your schema's version table. There should only ever be one - the version that the schema is at. Can you tell me how you ended up with two versions? I'd need to replicate that scenario to prevent it from happening On Thu Jul 04 07:34:26 2013, JIRA wrote: Show quoted text
> Hello, > > line 336: my $sql = q{select version from schema_version}; > should be changed to > my $sql = q{select max(version) from schema_version}; > > Right now it returns the lowest number in the version column (at least on > postgres).
On 2013-07-04 17:09:26, DHORNE wrote:

Show quoted text
> However, I'm concerned that you have two numbers in your schema's
> version table. There should only ever be one - the version that the
> schema is at.

Yes I had a row for every version lower than current one. I was maintaining the table manually for some time.
No bug then.