Skip to content

Warning "Table session has column created_unix but struct has not related field" after migrating release/v1.13 to release/v1.14 #15123

Closed
@pboguslawski

Description

@pboguslawski

After upgrading gitea in test environment from release/v1.13 do release/v1.14 message appears on gitea startup (mariadb):

2021/03/23 13:39:47 ...rm/session_schema.go:431:Sync2() [W] Table session has column created_unix but struct has not related field

Session table after upgrade:

$ mysql -e 'show create table session' gitea
[...]
CREATE TABLE `session` (
  `key` char(16) NOT NULL,
  `data` blob DEFAULT NULL,
  `created_unix` bigint(20) DEFAULT NULL,
  `expiry` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC
[...]

No such message when same gitea release/v1.14 initializes empty db; session table after db initialization:

$ mysql -e 'show create table session' gitea
[...]
CREATE TABLE `session` (
  `key` char(16) NOT NULL,
  `data` blob DEFAULT NULL,
  `expiry` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC
[...]

This table was not present in release/v1.13; this error is probably caused by:

https://github.com/go-gitea/gitea/blob/master/models/session.go#L14
https://github.com/go-gitea/gitea/blob/master/models/session.go#L120

Regards,
Paweł

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions