Column not found: 1054 Unknown column 'duration' in 'where clause'

updating 20.0.10 to 21.0.2 can’t complete because of a missing column
Doctrine\DBAL\Exception\InvalidFieldNameException: An exception occurred while executing a query: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'duration' in 'where clause'

I tried occ maintenance:repair to no avail:
- Repair MySQL collation - All tables already have the correct collation -> nothing to do

I have the same problem. When running occ -vvvvv upgrade for verbosity, you can see that this is related to the polls app:

$ occ -vvvvv upgrade
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
2021-07-01T09:48:55+00:00 Setting log level to debug
2021-07-01T09:48:55+00:00 Repair step: Repair MySQL collation
2021-07-01T09:48:55+00:00 Repair info: All tables already have the correct collation -> nothing to do
2021-07-01T09:48:55+00:00 Repair step: Repair SQLite autoincrement
2021-07-01T09:48:55+00:00 Repair step: Copy data from accounts table when migrating from ownCloud
2021-07-01T09:48:55+00:00 Repair step: Drop account terms table when migrating from ownCloud
2021-07-01T09:48:55+00:00 Updating database schema
2021-07-01T09:48:55+00:00 Updated database
2021-07-01T09:48:55+00:00 Updating <polls> ...
2021-07-01T09:48:55+00:00 Repair step: Delete duplicates
2021-07-01T09:48:55+00:00 Repair step: Polls repairstep - Fix votes with duration options
2021-07-01T09:48:55+00:00 Doctrine\DBAL\Exception\InvalidFieldNameException: An exception occurred while executing a query: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'duration' in 'where clause'
2021-07-01T09:48:55+00:00 Update failed
2021-07-01T09:48:55+00:00 Maintenance mode is kept active
2021-07-01T09:48:55+00:00 Resetting log level

I disabled the polls app for now, and the update went through. However, it would of course be nice to fix the problem itself.

As a side node, the first occ upgrade worked:

$ occ upgrade
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
Setting log level to debug
Turned on maintenance mode
Updating database schema
Updated database
Checking for update of app accessibility in appstore
Checked for update of app "accessibility" in appstore 
Checking for update of app activity in appstore
Checked for update of app "activity" in appstore 
Checking for update of app calendar in appstore
Update app calendar from appstore
Checked for update of app "calendar" in appstore 
Checking for update of app cloud_federation_api in appstore
Checked for update of app "cloud_federation_api" in appstore 
Checking for update of app comments in appstore
Checked for update of app "comments" in appstore 
Checking for update of app contacts in appstore
Update app contacts from appstore
Checked for update of app "contacts" in appstore 
Checking for update of app contactsinteraction in appstore
Checked for update of app "contactsinteraction" in appstore 
Checking for update of app cookbook in appstore
Checked for update of app "cookbook" in appstore 
Checking for update of app dashboard in appstore
Checked for update of app "dashboard" in appstore 
Checking for update of app dav in appstore
Checked for update of app "dav" in appstore 
Checking for update of app federatedfilesharing in appstore
Checked for update of app "federatedfilesharing" in appstore 
Checking for update of app federation in appstore
Checked for update of app "federation" in appstore 
Checking for update of app files in appstore
Checked for update of app "files" in appstore 
Checking for update of app files_external in appstore
Checked for update of app "files_external" in appstore 
Checking for update of app files_pdfviewer in appstore
Checked for update of app "files_pdfviewer" in appstore 
Checking for update of app files_rightclick in appstore
Checked for update of app "files_rightclick" in appstore 
Checking for update of app files_sharing in appstore
Checked for update of app "files_sharing" in appstore 
Checking for update of app files_trashbin in appstore
Checked for update of app "files_trashbin" in appstore 
Checking for update of app files_versions in appstore
Checked for update of app "files_versions" in appstore 
Checking for update of app files_videoplayer in appstore
Checked for update of app "files_videoplayer" in appstore 
Checking for update of app firstrunwizard in appstore
Checked for update of app "firstrunwizard" in appstore 
Checking for update of app forms in appstore
Update app forms from appstore
Checked for update of app "forms" in appstore 
Checking for update of app logreader in appstore
Checked for update of app "logreader" in appstore 
Checking for update of app lookup_server_connector in appstore
Checked for update of app "lookup_server_connector" in appstore 
Checking for update of app metadata in appstore
Checked for update of app "metadata" in appstore 
Checking for update of app nextcloud_announcements in appstore
Checked for update of app "nextcloud_announcements" in appstore 
Checking for update of app notifications in appstore
Checked for update of app "notifications" in appstore 
Checking for update of app oauth2 in appstore
Checked for update of app "oauth2" in appstore 
Checking for update of app password_policy in appstore
Checked for update of app "password_policy" in appstore 
Checking for update of app phonetrack in appstore
Checked for update of app "phonetrack" in appstore 
Checking for update of app photos in appstore
Checked for update of app "photos" in appstore 
Checking for update of app polls in appstore
Update app polls from appstore
Checking for update of app previewgenerator in appstore
Checked for update of app "previewgenerator" in appstore 
Checking for update of app privacy in appstore
Checked for update of app "privacy" in appstore 
Checking for update of app provisioning_api in appstore
Checked for update of app "provisioning_api" in appstore 
Checking for update of app recommendations in appstore
Checked for update of app "recommendations" in appstore 
Checking for update of app serverinfo in appstore
Checked for update of app "serverinfo" in appstore 
Checking for update of app settings in appstore
Checked for update of app "settings" in appstore 
Checking for update of app sharebymail in appstore
Checked for update of app "sharebymail" in appstore 
Checking for update of app spreed in appstore
Update app spreed from appstore
Checked for update of app "spreed" in appstore 
Checking for update of app support in appstore
Checked for update of app "support" in appstore 
Checking for update of app survey_client in appstore
Checked for update of app "survey_client" in appstore 
Checking for update of app systemtags in appstore
Checked for update of app "systemtags" in appstore 
Checking for update of app tasks in appstore
Checked for update of app "tasks" in appstore 
Checking for update of app text in appstore
Checked for update of app "text" in appstore 
Checking for update of app theming in appstore
Checked for update of app "theming" in appstore 
Checking for update of app timemanager in appstore
Update app timemanager from appstore
Checked for update of app "timemanager" in appstore 
Checking for update of app twofactor_backupcodes in appstore
Checked for update of app "twofactor_backupcodes" in appstore 
Checking for update of app twofactor_totp in appstore
Update app twofactor_totp from appstore
Checked for update of app "twofactor_totp" in appstore 
Checking for update of app updatenotification in appstore
Checked for update of app "updatenotification" in appstore 
Checking for update of app user_status in appstore
Checked for update of app "user_status" in appstore 
Checking for update of app viewer in appstore
Checked for update of app "viewer" in appstore 
Checking for update of app weather_status in appstore
Checked for update of app "weather_status" in appstore 
Checking for update of app workflowengine in appstore
Checked for update of app "workflowengine" in appstore 
Starting code integrity check...
Finished code integrity check
Update successful
Turned off maintenance mode
Resetting log level

But when opening the web page, Nextcloud still said, polls needed an update, and I can do this by running occ upgrade on the console, so I did it a second time, and only then the error appeared.

alter table oc_polls_options add duration int nonnull default 0;

has helped me. (I guessed this from the error message, the devs might know better.)