Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sections.migrated_time #148

Closed
notartom opened this issue Nov 30, 2022 · 0 comments
Closed

Fix sections.migrated_time #148

notartom opened this issue Nov 30, 2022 · 0 comments

Comments

@notartom
Copy link
Member

notartom commented Nov 30, 2022

Next on the STRICT_TRANS_TABLES fallout is sections.migrated_time. It's preventing us from creating a new project from a project code because there is no default value.

We're not really sure what sections.migrated_time is for or where it came from. It looks to be intended as a duration, but it's filled with invalid values and other garbage. Its only reference in the code is in the RSS view application/views/rss/rss.php. We want to give it a default value of NULL, and in the process, let's clean it up and make it a proper TIME column.

alter table sections modify column migrated_time varchar(20) null;
update sections set migrated_time = NULL where migrated_time = 'Source:';
update sections set migrated_time = substring(migrated_time,1,8) where migrated_time like "%Source:";
update sections set migrated_time = NULL where length(migrated_time) > 8;
update sections set migrated_time = NULL where migrated_time like '%Sung%';
update sections set migrated_time = NULL where migrated_time = '';
update sections set migrated_time = NULL where migrated_time like '%by%';
update sections set migrated_time = '00:15:07' where migrated_time = '00:15"07';
update sections set migrated_time = '01:13:50' where id = 126048;
update sections set migrated_time = NULL where id = 163744;
update sections set migrated_time = NULL where migrated_time like '1599%';
update sections set migrated_time = NULL where migrated_time like 'Book%';
alter table sections modify column migrated_time time null;
notartom added a commit to notartom/librivox-catalog that referenced this issue Dec 2, 2022
With the move to Jammy, MariaDB now has STRICT_TRANS_TABLES on by
default. This means we can no longer do things like save empty strings
into integer columns and have them magically transformed into the
correct type (which I assume is what was happening before). This patch
adds a bunch of code around places where such slopiness was detected
during testing. The patch is half of the fix, the other half is
issues LibriVox#147 and LibriVox#148.
notartom added a commit to notartom/librivox-catalog that referenced this issue Dec 2, 2022
With the move to Jammy, MariaDB now has STRICT_TRANS_TABLES on by
default. This means we can no longer do things like save empty strings
into integer columns and have them magically transformed into the
correct type (which I assume is what was happening before). This patch
adds a bunch of code around places where such slopiness was detected
during testing. The patch is half of the fix, the other half is
issues LibriVox#147 and LibriVox#148.
notartom added a commit that referenced this issue Dec 2, 2022
With the move to Jammy, MariaDB now has STRICT_TRANS_TABLES on by
default. This means we can no longer do things like save empty strings
into integer columns and have them magically transformed into the
correct type (which I assume is what was happening before). This patch
adds a bunch of code around places where such slopiness was detected
during testing. The patch is half of the fix, the other half is
issues #147 and #148.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant