I believe (using python 3.11.7, web2py 2,24,1, mysql 8),with web2py record versioning enabled,
I have verified that
db.export_to_csv_file does not write table rows that have the "is_active" field set
to False.
A simple test case is
1. add a new (is_active=True) row to a table (e.g. mediatitles),
This results in an "is_active = True" row in mediatitles,
2. Delete (archive) it.
This results in an "is_active = False" row in mediatitles,
and creation of an "is_active = True" row in table mediatitles_archive
3. Now, backup the db (db.export...)
4. restore it (db.import_from_csv_file)
Having cleared out the tables before step 3, this results in an empty mediatitles table and a mediatitles_archive table with one row
which, during execution, causes a MYSQL exception:
"(1452, 'Cannot add or update a child row:
a foreign key constraint fails (`mfm_curr_lib`.`mediatitles_archive`, CONSTRAINT `mediatitles_archive_ibfk_1` FOREIGN KEY (`current_record`) REFERENCES `mediatitles` (`id`) ON DELETE CASCADE)')
since there is no row in mediatitles that mediatitles_archive can reference.
Am I doing something wrong?
Is this fixed in a later web2py version?
Thanks