Skip to content

Database error when enabling app: 1067 Invalid default value for 'expires' #24

Description

@Miesepies

Nextcloud 14.0.4 docker image (official)
MariaDB docker image (official)

An exception occurred while executing 'ALTER TABLE oc_twofactor_admin_codes CHANGE expires expires BIGINT UNSIGNED DEFAULT NULL NOT NULL': SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'expires'

Could it be that "DEFAULT NULL NOT NULL" is the issue here?

MariaDB [nextcloud]> describe oc_twofactor_admin_codes;                                                                                                                           
+---------+---------------------+------+-----+---------+-------+                                                                                                                  
| Field   | Type                | Null | Key | Default | Extra |                                                                                                                  
+---------+---------------------+------+-----+---------+-------+                                                                                                                  
| id      | bigint(20) unsigned | NO   | PRI | NULL    |       |                                                                                                                  
| user_id | varchar(64)         | NO   | PRI | NULL    |       |                                                                                                                  
| code    | varchar(6)          | NO   |     | NULL    |       |                                                                                                                  
| expires | bigint(20) unsigned | YES  |     | NULL    |       |                                                                                                                  
+---------+---------------------+------+-----+---------+-------+                                                                                                                  
4 rows in set (0.002 sec)                                          

Originally posted by @Miesepies in #20 (comment)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions