Hi Gene,

The schema looks healthy at first glance. It seems like a normal 2.0.x
schema, and one that would be safe to upgrade to 2.5.x.

I don't know what the original error was that you hit (the one in the
original post here was due to a subsequent attempt at upgrading a database
that already failed in a way we couldn't recover from), but one possible
cause of failures would be the table engine type.

Old versions of MySQL used MyISAM as the table type (the ENGINE= lines in
the schema). Newer MySQL versions (from the past several years onward)
default to InnoDB for any new tables (and 2.5.x would introduce new
tables). If you have a mix of table types, MySQL can end up throwing
confusing errors when attempting to create any relations between those
tables. It's something I'd love for us to be able to catch, but it's pretty
much a MySQL responsibility.

While I don't know if you hit an error related to that, what you might want
to try doing is converting your schema to use InnoDB for all tables. You
can do a full database dump from the production server, change all
ENGINE=MyISAM entries to ENGINE=InnoDB, and then load the database into the
test server. Then attempt an upgrade, and see if it goes through
successfully.

If it doesn't succeed, show me the full output, and I'll probably be able
to narrow it down.

Christian

On Sun, Aug 20, 2017 at 6:25 PM, Gene Paul Quevedo <gene.quev...@gmail.com>
wrote:

> Oops looks like you might be right. Anyway here's our schema direct coming
> from our production site.
>
> Previously we were running 2.0.20, and the upgrade went smooth if I
> recall.
>
> On Monday, 21 August 2017 10:23:03 UTC+10, Gene Paul Quevedo wrote:
>>
>> hi Christian
>>
>> The schema is from 2.0.25. It was from a snapshot of our test server
>> before the upgrade was performed. If there's a suspicion I could generate
>> again the schema coming from ou production server, which runs 2.0.25
>>
>> On Tuesday, 15 August 2017 09:49:09 UTC+10, Christian Hammond wrote:
>>>
>>> Hi Gene,
>>>
>>> Looks like there was a partial attempt at an evolution that failed once
>>> before. The "visibility" column was applied and then something apparently
>>> went wrong, or upgrading was cancelled. Deleting the duplicates and running
>>> again would lead to this, unless carefully handled in a way compatible with
>>> django-evolution's internals.
>>>
>>> Is this database schema the initial one applied from 2.0.25, or what you
>>> have on the test server after the upgrade attempts?
>>>
>>> Christian
>>>
>>> On Sun, Aug 13, 2017 at 8:40 PM, Gene Paul Quevedo <gene.q...@gmail.com>
>>> wrote:
>>>
>>>> Hi,
>>>>
>>>> I'ts my first time to post here, and I hope someone can point me to the
>>>> right way of solving this issue, even though it seems like there were
>>>> issues like this before
>>>>
>>>> I'm trying to do a DB upgrade of Review from 2.0.25 to 2.5.15 on a test
>>>> server with a copy of our Database, and seems like it has bumped into this
>>>> issue
>>>>
>>>> Rebuilding directory structure
>>>> Upgrading site settings_local.py
>>>> Updating database. This may take a while.
>>>>
>>>> The log output below, including warnings and errors,
>>>> can be ignored unless upgrade fails.
>>>>
>>>> ------------------ <begin log output> ------------------
>>>> Creating tables ...
>>>> There are unapplied evolutions for accounts.
>>>> There are unapplied evolutions for attachments.
>>>> There are unapplied evolutions for diffviewer.
>>>> There are unapplied evolutions for reviews.
>>>> There are unapplied evolutions for webapi.
>>>> Project signature has changed - an evolution is required
>>>> Installing custom SQL ...
>>>> Installing indexes ...
>>>> Installed 0 object(s) from 0 fixture(s)
>>>>
>>>> This may take a while. Please be patient, and do not cancel the upgrade!
>>>>
>>>> Applying database evolutions for accounts...
>>>> Database evolutions for accounts failed!
>>>> The SQL statement was: (u'ALTER TABLE `accounts_reviewrequestvisit` ADD
>>>> COLUMN `visibility` varchar(1) NOT NULL DEFAULT %s;', [u'V'])
>>>>
>>>>
>>>>
>>>> *The database error was: (1060, "Duplicate column name
>>>> 'visibility'")CommandError: Error applying evolution for accounts: (1060,
>>>> "Duplicate column name 'visibility'")*
>>>> There are probably 4 variations of that 'duplicate column' error, and
>>>> the other one is a 'duplicate index' .
>>>> My initial solution was to delete the duplicates and run the upgrade
>>>> procedure again, but seems like the duplication seems to be repeating (!),
>>>> as if Django Evolution is creating those duplicate columns/indices
>>>>
>>>> Any ideas on how to debug this further? I'm attaching our DB schema here
>>>>
>>>> thank you!
>>>> - Gene
>>>>
>>>> --
>>>> Supercharge your Review Board with Power Pack:
>>>> https://www.reviewboard.org/powerpack/
>>>> Want us to host Review Board for you? Check out RBCommons:
>>>> https://rbcommons.com/
>>>> Happy user? Let us know! https://www.reviewboard.org/users/
>>>> ---
>>>> You received this message because you are subscribed to the Google
>>>> Groups "reviewboard" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to reviewboard...@googlegroups.com.
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>
>>>
>>> --
>>> Christian Hammond
>>> President/CEO of Beanbag <https://www.beanbaginc.com/>
>>> Makers of Review Board <https://www.reviewboard.org/>
>>>
>> --
> Supercharge your Review Board with Power Pack:
> https://www.reviewboard.org/powerpack/
> Want us to host Review Board for you? Check out RBCommons:
> https://rbcommons.com/
> Happy user? Let us know! https://www.reviewboard.org/users/
> ---
> You received this message because you are subscribed to the Google Groups
> "reviewboard" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to reviewboard+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Christian Hammond
President/CEO of Beanbag <https://www.beanbaginc.com/>
Makers of Review Board <https://www.reviewboard.org/>

-- 
Supercharge your Review Board with Power Pack: 
https://www.reviewboard.org/powerpack/
Want us to host Review Board for you? Check out RBCommons: 
https://rbcommons.com/
Happy user? Let us know! https://www.reviewboard.org/users/
--- 
You received this message because you are subscribed to the Google Groups 
"reviewboard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to