Hi,
I am upgrading my keycloak from keycloak-9.0.0 to keycloak-15.1.1 as part of my application upgrade. I did a fresh installation of database and also tried upgrading my database by running the upgrade scripts. But I could find differences in the table schema between the fresh installation and upgraded one.
For example, a table structure of USER_SESSION_NOTE is different in both the cases.
Table created during fresh installation:
CREATE TABLE USER_SESSION_NOTE
(
USER_SESSION
varchar(36) NOT NULL,
NAME
varchar(255) NOT NULL,
VALUE
text,
PRIMARY KEY (USER_SESSION
,NAME
),
CONSTRAINT FK5EDFB00FF51D3472
FOREIGN KEY (USER_SESSION
) REFERENCES USER_SESSION
(ID
)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
Table created by running upgrade scripts:
CREATE TABLE USER_SESSION_NOTE
(
USER_SESSION
varchar(36) NOT NULL,
NAME
varchar(255) NOT NULL,
VALUE
varchar(2048) DEFAULT NULL,
PRIMARY KEY (USER_SESSION
,NAME
),
CONSTRAINT FK5EDFB00FF51D3472
FOREIGN KEY (USER_SESSION
) REFERENCES USER_SESSION
(ID
) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
There are differences between these 2 table schema. The differences are highlighted. This is same with almost all the tables created. Which one is the correct one and how to fix this during upgrade?
Thanks in advance,
Deeps.