Migration mysql database from 2.8 to 2.9

22 views
Skip to first unread message

Alonso Gómez

unread,
May 6, 2020, 1:04:44 PM5/6/20
to schedulix
Hi,

I have a fresh schedulix 2.9 install running ok... I hava a backup database from 2.8 version. I try to migrate this backup version using sql/mysql_gen/generated-upgrade-2.8-to-2.9.sql. I am getting this error:

ERROR 1051 (42S02) at line 144: Unknown table 'schedulixdb_29.SCI_INTERVAL_DISPATCHER'

In 2.8 database version, not exist the INTERVAL_DISPATCHER table and not exist the view "SCI_INTERVAL_DISPATCHER". It is an error in the script when try to drop de view?

I attach the file I am using to migrate.

Thanks.
generated-upgrade-2.8-to-2.9.sql

Alonso Gómez

unread,
May 6, 2020, 1:15:52 PM5/6/20
to schedulix
Same as previus comment, I found a new DROP statment over a view that not exist in 2.8 database... 

  • DROP VIEW SCI_C_TRIGGER_PARAMETER; (312 line)
  • DROP VIEW SCI_V_TRIGGER_PARAMETER; (313 line)
This view are over TRIGGER_PARAMETER table that no exist en 2.8 database

Ronald Jeninga

unread,
May 7, 2020, 3:22:46 AM5/7/20
to schedulix
Hi Alonso,

as can be derived from the file names, those SQL scripts are generated code.
After schema changes (e.g. added columns, but also added tables) the SCI views have to be (re)created.
It's easy to detect changes, but it's a bit of a hassle to distinguish between a table change and a new table.
Hence if a change is detected, a DROP VIEW and CREATE VIEW is generated, well knowing that the DROP VIEW will fail in case of a new table.
I'd love to have a kind of "EXISTING" keyword here.

But in the end it doesn't make a difference: we want to get rid of the original view and if it doesn't exist (any more) after executing the DROP statement, we're fine.
The important statement, the CREATE VIEW, will be successful afterwards.

Given the fact that those scripts are executed only once, we accept the ugly output but correct behaviour.

Best regards,

Ronald

Alonso Gómez

unread,
May 8, 2020, 5:12:30 AM5/8/20
to schedulix
Thanks you Ronald, all is ok.
Reply all
Reply to author
Forward
0 new messages