Upgrade database from 2.21 to 2.22 error
-
I was trying to upgrade to the newest version, and when upgrading the database, I get an error ...
C:\NetXMS\bin>nxdbmgr upgrade -t
NetXMS Database Manager Version 0.2.22Configuration file OK
Upgrading database...
Upgrading from version 80 to 81
>>> SELECT item_id,schedule FROM dci_schedules
>>> DELETE FROM dci_schedules
>>> ALTER TABLE dci_schedules ADD schedule_id integer not null
SQL query failed (General SQL Server error: Check messages from the SQL Server.)
:
ALTER TABLE dci_schedules ADD schedule_id integer not null
Rolling back last stage due to upgrade errors...
Database upgrade failedWhen trying to execute the same command from Query analyzer, I get this error back :
ALTER TABLE only allows columns to be added that can contain nulls or have a DEFAULT definition specified. Column 'schedule_id' cannot be added to table 'dci_schedules' because it does not allow nulls and does not specify a DEFAULT definition.
I need ideas ...
-
Looks like a bug in handling MS SQL on upgrade (it works fine on my test system, but I have MS SQL 2005). Try to do an upgrade with attached nxdbmgr.exe.
Best regards,
Victor
-
I tryed again and used the executable that you provided me, and got an error again ... on another step ...
C:\NetXMS\bin>nxdbmgr upgrade -t
NetXMS Database Manager Version 0.2.23-rc1Configuration file OK
Upgrading database...
Upgrading from version 80 to 81
>>> SELECT item_id,schedule FROM dci_schedules
>>> DROP TABLE dci_schedules
>>> CREATE TABLE dci_schedules (schedule_id integer not null,item_id integer not
null,schedule varchar(255) not null,PRIMARY KEY(item_id,schedule_id))
>>> ALTER TABLE address_lists ADD PRIMARY KEY (list_type,community_id,addr_type,
addr1,addr2)
SQL query failed (General SQL Server error: Check messages from the SQL Server.)
:
ALTER TABLE address_lists ADD PRIMARY KEY (list_type,community_id,addr_type,addr
1,addr2)
Rolling back last stage due to upgrade errors...
Database upgrade failedWhen executing the command from query analyzer, the error is bellow .
Server: Msg 8111, Level 16, State 1, Line 1
Cannot define PRIMARY KEY constraint on nullable column in table 'address_lists'.
Server: Msg 1750, Level 16, State 1, Line 1
Could not create constraint. See previous errors.Can you give me the full upgrade script that you´re using on this executable ?
I can try to work on it .. , as seems that I´m the only one having problems to upgrade ... -
Hello!
It's not a plain SQL script. Commands may vary between databases, so it's a set of static and dynamically created SQL queries encoded into nxdbmgr code.
I change the upgrade code to re-create tables instead of adding constraints, hopefully it will work.
Attached is a latest version of nxdbmgr.exe.
Best regards,
Victor
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login