test-fullautomation / testresultwebapp

Apache License 2.0
2 stars 1 forks source link

update db model and webapp db connection with charset 'utf8mb4' #18

Closed ngoan1608 closed 1 year ago

ngoan1608 commented 1 year ago

Hi Thomas,

This PR contains changes in database model and node server to support 4 byte chars.

I have update the testdb with this changes by using Database > Synchronize Model feature of MySQL Workbench, but it seems that it is not effective properly. So that I have to run sql queries to update them manually. Please refer the attached sql script set_charset_tables.zip (replace testdb with your schema). Then verify the database, tables, columns charset changes with below queries (replace testdb with your schema):

select @@collation_database;
select @@character_set_database;
select table_name, table_collation from information_schema.tables WHERE table_schema='testdb';
select column_name, character_set_name, collation_name from information_schema.columns WHERE table_schema='testdb' and (data_type='varchar' or data_type like '%text');

The charset should be 'utf8mb4' and collation should be 'utf8mb4_general_ci'.

testdb database have been changed properly, you can verify the changes by using the updated *log2db tools in below pull requests: https://github.com/test-fullautomation/python-pytestlog2db/pull/27 https://github.com/test-fullautomation/robotframework-robotlog2db/pull/42 Besides, apply change in node server in this PR to make the webapp display 4 byte string properly.

Please contact me in case you have any issue when applying changes.

Thank you, Ngoan

ngoan1608 commented 1 year ago

Hi Thomas,

I have updated the DB instance for BIOS_ROBFWAIO_SELFTEST. But I see that that web server instance is still problem when getting branch info.

Besides, the merge conflict in database model has been resolved.

Thank you, Ngoan