Skip to content

Commit cb19592

Browse files
committed
Address H2 DB upgrade issue
1 parent 9e53019 commit cb19592

File tree

7 files changed

+11
-183
lines changed

7 files changed

+11
-183
lines changed

samples/spa/src/main/java/com/webauthn4j/springframework/security/webauthn/sample/domain/entity/AuthenticatorEntity.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ public class AuthenticatorEntity implements WebAuthnAuthenticator {
5656

5757
@Embedded
5858
@AttributeOverrides({
59-
@AttributeOverride(name="aaguid", column=@Column(columnDefinition = "blob")),
60-
@AttributeOverride(name="credentialId", column=@Column(columnDefinition = "blob")),
61-
@AttributeOverride(name="coseKey", column=@Column(name = "cose_key", columnDefinition = "blob"))
59+
@AttributeOverride(name="aaguid", column=@Column(name = "aaguid", columnDefinition = "binary")),
60+
@AttributeOverride(name="credentialId", column=@Column(name = "credential_id", columnDefinition = "binary")),
61+
@AttributeOverride(name="coseKey", column=@Column(name = "cose_key", columnDefinition = "binary"))
6262
})
6363
@Converts({
6464
@Convert(converter = AAGUIDConverter.class, attributeName = "aaguid"),

samples/spa/src/main/java/com/webauthn4j/springframework/security/webauthn/sample/domain/entity/UserEntity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public class UserEntity implements UserDetails {
3333
@Id
3434
@GeneratedValue(strategy = GenerationType.IDENTITY)
3535
private Integer id;
36-
@Column(columnDefinition = "blob")
36+
@Column(columnDefinition = "VARBINARY(64)")
3737
private byte[] userHandle;
3838
private String firstName;
3939
private String lastName;

samples/spa/src/main/resources/db/migration/h2/V0_0_0__create_tables.sql

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
-- User table --
22
CREATE TABLE m_user (
33
id INTEGER NOT NULL AUTO_INCREMENT,
4-
user_handle BLOB NOT NULL,
4+
user_handle VARBINARY(64) NOT NULL,
55
first_name VARCHAR(32) NOT NULL,
66
last_name VARCHAR(32) NOT NULL,
77
email_address VARCHAR(64) NOT NULL UNIQUE,
@@ -30,12 +30,12 @@ CREATE TABLE m_authenticator(
3030
name VARCHAR(32) NOT NULL,
3131
user_id INTEGER NOT NULL REFERENCES m_user(id),
3232
counter BIGINT NOT NULL,
33-
aaguid BLOB NOT NULL,
34-
credential_id BLOB NOT NULL,
35-
cose_key BLOB NOT NULL,
36-
attestation_statement TEXT NOT NULL,
37-
client_extensions TEXT NOT NULL,
38-
authenticator_extensions TEXT NOT NULL,
33+
aaguid VARBINARY(16) NOT NULL,
34+
credential_id VARBINARY(1024) NOT NULL,
35+
cose_key VARBINARY(1024) NOT NULL,
36+
attestation_statement CLOB NOT NULL,
37+
client_extensions CLOB NOT NULL,
38+
authenticator_extensions CLOB NOT NULL,
3939
primary key(id)
4040
);
4141

samples/spa/src/main/resources/db/migration/mysql/V0_0_0__create_tables.sql

Lines changed: 0 additions & 69 deletions
This file was deleted.

samples/spa/src/main/resources/db/migration/mysql/V0_0_1__dataload_tables.sql

Lines changed: 0 additions & 22 deletions
This file was deleted.

samples/spa/src/main/resources/db/migration/postgresql/V0_0_0__create_tables.sql

Lines changed: 0 additions & 59 deletions
This file was deleted.

samples/spa/src/main/resources/db/migration/postgresql/V0_0_1__dataload_tables.sql

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)