From cfac2768ae21e848395ae96a69d57bbf1e9d1576 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Mon, 14 Jun 2021 11:52:12 +0200 Subject: [PATCH] use varbinary rather than fixed binary column types where length is variable --- .../resources/com/sparrowwallet/sparrow/sql/V1__Initial.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/resources/com/sparrowwallet/sparrow/sql/V1__Initial.sql b/src/main/resources/com/sparrowwallet/sparrow/sql/V1__Initial.sql index 39deccf8..ad98ebaf 100644 --- a/src/main/resources/com/sparrowwallet/sparrow/sql/V1__Initial.sql +++ b/src/main/resources/com/sparrowwallet/sparrow/sql/V1__Initial.sql @@ -1,9 +1,9 @@ -create table blockTransaction (id identity not null, txid binary(32) not null, hash binary(32) not null, height integer not null, date timestamp, fee bigint, label varchar(255), transaction binary(1048576), blockHash binary(32), wallet bigint not null); +create table blockTransaction (id identity not null, txid binary(32) not null, hash binary(32) not null, height integer not null, date timestamp, fee bigint, label varchar(255), transaction varbinary(1048576), blockHash binary(32), wallet bigint not null); create table blockTransactionHashIndex (id identity not null, hash binary(32) not null, height integer not null, date timestamp, fee bigint, label varchar(255), index bigint not null, outputValue bigint not null, status integer, spentBy bigint, node bigint not null); create table keystore (id identity not null, label varchar(255), source integer not null, walletModel integer not null, masterFingerprint varchar(8), derivationPath varchar(255) not null, extendedPublicKey varchar(255), masterPrivateExtendedKey bigint, seed bigint, wallet bigint not null, index integer not null); -create table masterPrivateExtendedKey (id identity not null, privateKey binary(255), chainCode binary(255), initialisationVector binary(255), encryptedBytes binary(255), keySalt binary(255), deriver integer, crypter integer, creationTimeSeconds bigint); +create table masterPrivateExtendedKey (id identity not null, privateKey varbinary(255), chainCode varbinary(255), initialisationVector varbinary(32), encryptedBytes varbinary(255), keySalt varbinary(32), deriver integer, crypter integer, creationTimeSeconds bigint); create table policy (id identity not null, name varchar(255) not null, script varchar(2048) not null); -create table seed (id identity not null, type integer not null, mnemonicString varchar(255), initialisationVector binary(255), encryptedBytes binary(255), keySalt binary(255), deriver integer, crypter integer, needsPassphrase boolean, creationTimeSeconds bigint); +create table seed (id identity not null, type integer not null, mnemonicString varchar(255), initialisationVector varbinary(32), encryptedBytes varbinary(255), keySalt varbinary(32), deriver integer, crypter integer, needsPassphrase boolean, creationTimeSeconds bigint); create table wallet (id identity not null, name varchar(255) not null, network integer not null, policyType integer not null, scriptType integer not null, storedBlockHeight integer, gapLimit integer, birthDate timestamp, defaultPolicy bigint not null); create table walletNode (id identity not null, derivationPath varchar(255) not null, label varchar(255), wallet bigint not null, parent bigint); alter table blockTransactionHashIndex add constraint blockTransactionHashIndex_spentBy_unique unique (spentBy);