Skip to content

schema.sql script error #289

@juresaht2

Description

@juresaht2

#98

This fix creates the issue:

    --------------
    CREATE TABLE IF NOT EXISTS requests (
            id INT NOT NULL AUTO_INCREMENT,
            domain INT NOT NULL,
            repuri VARCHAR(255) NOT NULL DEFAULT '',
            adkim TINYINT NOT NULL DEFAULT '0',
            aspf TINYINT NOT NULL DEFAULT '0',
            policy TINYINT NOT NULL DEFAULT '0',
            spolicy TINYINT NOT NULL DEFAULT '0',
            pct TINYINT NOT NULL DEFAULT '0',
            locked TINYINT NOT NULL DEFAULT '0',
            firstseen TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
            lastsent TIMESTAMP NOT NULL DEFAULT '1970-01-01 00:00:00',
  
            PRIMARY KEY(id),
            KEY(lastsent),
            UNIQUE KEY(domain)
    )
    --------------
  
    ERROR 1067 (42000) at line 58: Invalid default value for 'lastsent'

According the mysql manual, the previous value '0000-00-00 00:00:00' is the correct zero value:
https://dev.mysql.com/doc/refman/8.4/en/date-and-time-types.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions