on mariadb i had audit set up with type json (generate audited:install --audited-changes-column-type json) docs
i updated my mariadb and encoutered the error
ActiveRecord::StatementInvalid: Mysql2::Error: CONSTRAINT audited_changes failed for cnc_office_test.audits
Since 10.4.3 mariadb has a json validation mariadb docs
By checking my database i found that the content of audited_changes on staging server, there was a YAML:
---
number: dsf
din_norm: swegr
So, my quick fix, on the development machine was to reset all databases, changed at the migration «...install_audited.rb» the line to t.column :audited_changes, :text re ran all migrations and the error was gone.
Seems that audited is not writing json, but, just since the switch to the newer mariadb. (Previous, on the mysql DB it wrotes audited_changes as json.)
And seems just to change the column type from json to text, is leading audited, no longer to tell the db for checking for a json.
Hi
on mariadb i had audit set up with type json (generate audited:install --audited-changes-column-type json) docs
i updated my mariadb and encoutered the error
ActiveRecord::StatementInvalid: Mysql2::Error: CONSTRAINT
audited_changes
failed forcnc_office_test
.audits
Since 10.4.3 mariadb has a json validation mariadb docs
By checking my database i found that the content of
audited_changes
on staging server, there was a YAML:So, my quick fix, on the development machine was to reset all databases, changed at the migration «...install_audited.rb» the line to
t.column :audited_changes, :text
re ran all migrations and the error was gone.Seems that audited is not writing json, but, just since the switch to the newer mariadb. (Previous, on the mysql DB it wrotes audited_changes as json.)
And seems just to change the column type from json to text, is leading audited, no longer to tell the db for checking for a json.