From ce79f4c2141a3584bfd1600d1960de5778d09318 Mon Sep 17 00:00:00 2001 From: Alex Guo Date: Tue, 1 Jun 2021 06:02:36 -0500 Subject: [PATCH 1/6] increase sql table owner_public_key from varchar(256) to 512 --- sql/01-create-table.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/01-create-table.sql b/sql/01-create-table.sql index b8426aad1..51a2d0af6 100644 --- a/sql/01-create-table.sql +++ b/sql/01-create-table.sql @@ -14,7 +14,7 @@ CREATE TABLE allocations( size BIGINT NOT NULL DEFAULT 0, used_size BIGINT NOT NULL DEFAULT 0, owner_id VARCHAR(64) NOT NULL, - owner_public_key VARCHAR(256) NOT NULL, + owner_public_key VARCHAR(512) NOT NULL, expiration_date BIGINT NOT NULL, allocation_root VARCHAR(255) NOT NULL DEFAULT '', blobber_size BIGINT NOT NULL DEFAULT 0, From 61193583283e8a9702c766e2590236b6eb352560 Mon Sep 17 00:00:00 2001 From: Alex Guo Date: Tue, 1 Jun 2021 07:57:44 -0500 Subject: [PATCH 2/6] Revert "increase sql table owner_public_key from varchar(256) to 512" This reverts commit ce79f4c2141a3584bfd1600d1960de5778d09318. --- sql/01-create-table.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/01-create-table.sql b/sql/01-create-table.sql index 51a2d0af6..b8426aad1 100644 --- a/sql/01-create-table.sql +++ b/sql/01-create-table.sql @@ -14,7 +14,7 @@ CREATE TABLE allocations( size BIGINT NOT NULL DEFAULT 0, used_size BIGINT NOT NULL DEFAULT 0, owner_id VARCHAR(64) NOT NULL, - owner_public_key VARCHAR(512) NOT NULL, + owner_public_key VARCHAR(256) NOT NULL, expiration_date BIGINT NOT NULL, allocation_root VARCHAR(255) NOT NULL DEFAULT '', blobber_size BIGINT NOT NULL DEFAULT 0, From 9b5d5932d8f5fb0b3edb21b993a6f1c7db03b891 Mon Sep 17 00:00:00 2001 From: Alex Guo Date: Tue, 1 Jun 2021 08:02:34 -0500 Subject: [PATCH 3/6] increase sql table owner_public_key from varchar(256) to 512 --- sql/14-increase_owner_pubkey.sql | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 sql/14-increase_owner_pubkey.sql diff --git a/sql/14-increase_owner_pubkey.sql b/sql/14-increase_owner_pubkey.sql new file mode 100644 index 000000000..8ae77f218 --- /dev/null +++ b/sql/14-increase_owner_pubkey.sql @@ -0,0 +1,12 @@ +-- +-- Increase the char limit of owner_public_key from 256 to 512. +-- + +-- pew-pew +\connect blobber_meta; + +-- in a transaction +BEGIN; + ALTER TABLE allocations + MODIFY COLUMN owner_public_key varchar(512) NOT NULL; +COMMIT; From c60df98906cc847814e44b589cbc562920bfe897 Mon Sep 17 00:00:00 2001 From: Alex Guo Date: Tue, 1 Jun 2021 08:27:21 -0500 Subject: [PATCH 4/6] fix syntax error for postgres sql --- sql/14-increase_owner_pubkey.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/14-increase_owner_pubkey.sql b/sql/14-increase_owner_pubkey.sql index 8ae77f218..47898b4b9 100644 --- a/sql/14-increase_owner_pubkey.sql +++ b/sql/14-increase_owner_pubkey.sql @@ -8,5 +8,5 @@ -- in a transaction BEGIN; ALTER TABLE allocations - MODIFY COLUMN owner_public_key varchar(512) NOT NULL; + ALTER COLUMN owner_public_key varchar(512) NOT NULL; COMMIT; From 993a2146b69554522aad3428b58b6e44625cdce5 Mon Sep 17 00:00:00 2001 From: Alex Guo Date: Tue, 1 Jun 2021 08:45:32 -0500 Subject: [PATCH 5/6] fix varchar syntax error for postgres --- sql/14-increase_owner_pubkey.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/14-increase_owner_pubkey.sql b/sql/14-increase_owner_pubkey.sql index 47898b4b9..4b7c56332 100644 --- a/sql/14-increase_owner_pubkey.sql +++ b/sql/14-increase_owner_pubkey.sql @@ -8,5 +8,5 @@ -- in a transaction BEGIN; ALTER TABLE allocations - ALTER COLUMN owner_public_key varchar(512) NOT NULL; + ALTER COLUMN owner_public_key TYPE varchar(512) NOT NULL; COMMIT; From c4496fa2762d0ac07bafe5cf4b11fcaeca8c0574 Mon Sep 17 00:00:00 2001 From: Alex Guo Date: Tue, 1 Jun 2021 10:46:47 -0500 Subject: [PATCH 6/6] remove NOT NULL from alter. --- sql/14-increase_owner_pubkey.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/14-increase_owner_pubkey.sql b/sql/14-increase_owner_pubkey.sql index 4b7c56332..0b81e2542 100644 --- a/sql/14-increase_owner_pubkey.sql +++ b/sql/14-increase_owner_pubkey.sql @@ -8,5 +8,5 @@ -- in a transaction BEGIN; ALTER TABLE allocations - ALTER COLUMN owner_public_key TYPE varchar(512) NOT NULL; + ALTER COLUMN owner_public_key TYPE varchar(512); COMMIT;