Skip to content

Commit f99e210

Browse files
feat(keystore/generic): update credentials schema
1 parent 58173f6 commit f99e210

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
CREATE TABLE mls_credentials_new (
2+
public_key_sha256 TEXT UNIQUE,
3+
public_key BLOB NOT NULL,
4+
id BLOB NOT NULL,
5+
credential BLOB NOT NULL,
6+
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
7+
ciphersuite INT NOT NULL,
8+
secret_key BLOB NOT NULL
9+
);
10+
11+
INSERT INTO mls_credentials_new (
12+
public_key_sha256,
13+
public_key,
14+
id,
15+
credential,
16+
created_at,
17+
ciphersuite,
18+
secret_key
19+
)
20+
SELECT sha256_blob(public_key),
21+
public_key,
22+
id,
23+
credential,
24+
created_at,
25+
ciphersuite,
26+
secret_key
27+
FROM mls_credentials;
28+
29+
DROP TABLE mls_credentials;
30+
31+
ALTER TABLE mls_credentials_new RENAME TO mls_credentials;

0 commit comments

Comments
 (0)