danmed/PStatus

Field 'count' doesn't have a default value

Closed this issue · 8 comments

Hello,

SQL query:
INSERT INTO servers (device, ip, info, purpose) VALUES ('Google', '8.8.8.8', 'Google DNS', '')

MySQL said: Documentatio
#1364 - Field 'count' doesn't have a default value

I'm getting this in 2 separate databases.

I assume this is adding a new server?

I've updated it to add a default value of 0 when the record is created... can you try it now?

Correct, when adding new server.

Now same happens to 'ups' field, so my guess is other fields touched when adding will come back with the same message.

OK, give me a few minutes

I've adjusted the database design to included default values (or NULL) for the date fields.. would you mind testing it?

Retried on fresh 'install':

Error: INSERT INTO servers (device, ip, info, purpose, count) VALUES ('Google', '8.8.8.8', 'Google DNS', '', '0')
Field 'ups' doesn't have a default value

Hey, thanks for testing again.. i've just updated the table def to allow NULL in those fields.. mind trying again?

Good on my end now!

Awesome.. thanks for your changes too!

I've found a bug which i'll have to sort out with the datatable.. if you have more than 10 devices, then the subsequent pages or search results don't highlight green or red when online.. i may be able to detect it differently with bootstrap but i'll have to look.