opennetadmin / ona

OpenNetAdmin IP Address Management (IPAM) system
opennetadmin.com
GNU General Public License v2.0
136 stars 35 forks source link

Install fails with parent_id default value error #86

Closed mattpascoe closed 4 years ago

mattpascoe commented 9 years ago

When installing an error about parent_id is displayed. You may also see the following in error logs:

ERROR => SQL INSERT failed: Field parent_id doesnt have a default value

The issue is that newer versions of mysql are enforcing STRICT_TRANS_TABLES and is causing blank/null values to no longer get converted to 0 automatically. More info here: http://www.garethalexander.co.uk/tech/mysql-5-incorrect-integer-value-column-id-row-1

What needs to be done is to update code to no longer use '' values but to actually use 0 or other appropriate action.

mattpascoe commented 9 years ago

This needs more testing.. I went through some of the major areas but I'm sure I will have missed something. Help me out to test and ensure things work. Its possible some of the plugins will have issues as well? Test using the miradbfix branch (horrible name but its what I called it)

As a workaround, users can set mysql to not use STRICT_TRANS_TABLES as the link above mentions.

mattpascoe commented 4 years ago

closing as testing seems to show its fine..