Skip to content
Snippets Groups Projects
Commit 2b1c2651 authored by Robert Martin-Legene's avatar Robert Martin-Legene
Browse files

Need bigger integers

parent 37c6c0c5
No related branches found
No related tags found
No related merge requests found
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
CREATE SEQUENCE account_id_seq INCREMENT 1 MINVALUE 1 MAXVALUE 2147483647 START 1000 CACHE 1; CREATE SEQUENCE account_id_seq INCREMENT 1 MINVALUE 1 MAXVALUE 2147483647 START 1000 CACHE 1;
CREATE TABLE "public"."account" ( CREATE TABLE "public"."account" (
"id" integer DEFAULT nextval('account_id_seq') NOT NULL, "id" bigint DEFAULT nextval('account_id_seq') NOT NULL,
"address" character(42) NOT NULL, "address" character(42) NOT NULL,
"shortname" character varying(16), "shortname" character varying(16),
"name" character varying(255), "name" character varying(255),
...@@ -14,22 +14,22 @@ CREATE TABLE "public"."account" ( ...@@ -14,22 +14,22 @@ CREATE TABLE "public"."account" (
CREATE SEQUENCE blockhash_id_seq INCREMENT 1 MINVALUE 1 MAXVALUE 2147483647 START 1000000 CACHE 1; CREATE SEQUENCE blockhash_id_seq INCREMENT 1 MINVALUE 1 MAXVALUE 2147483647 START 1000000 CACHE 1;
CREATE TABLE "public"."blockhash" ( CREATE TABLE "public"."blockhash" (
"id" integer DEFAULT nextval('blockhash_id_seq') NOT NULL, "id" bigint DEFAULT nextval('blockhash_id_seq') NOT NULL,
"hash" character(66) NOT NULL, "hash" character(66) NOT NULL,
CONSTRAINT "blockhash_id" PRIMARY KEY ("id"), CONSTRAINT "blockhash_id" PRIMARY KEY ("id"),
CONSTRAINT "blockhash_hash" UNIQUE ("hash") CONSTRAINT "blockhash_hash" UNIQUE ("hash")
) WITH (oids = false); ) WITH (oids = false);
CREATE TABLE "public"."block" ( CREATE TABLE "public"."block" (
"id" integer NOT NULL, "id" bigint NOT NULL,
"parentBlockhashId" integer, "parentBlockhashId" bigint,
"number" integer NOT NULL, "number" bigint NOT NULL,
"sealerAccountId" integer, "sealerAccountId" bigint,
"timestamp" integer NOT NULL, "timestamp" bigint NOT NULL,
"difficulty" smallint NOT NULL, "difficulty" smallint NOT NULL,
"gasUsed" integer NOT NULL, "gasUsed" bigint NOT NULL,
"gasLimit" integer NOT NULL, "gasLimit" bigint NOT NULL,
"size" integer NOT NULL, "size" bigint NOT NULL,
CONSTRAINT "block_id" PRIMARY KEY ("id"), CONSTRAINT "block_id" PRIMARY KEY ("id"),
CONSTRAINT "block_sealerAccountId_fkey" FOREIGN KEY ("sealerAccountId") REFERENCES account(id) NOT DEFERRABLE, CONSTRAINT "block_sealerAccountId_fkey" FOREIGN KEY ("sealerAccountId") REFERENCES account(id) NOT DEFERRABLE,
CONSTRAINT "block_id_fkey" FOREIGN KEY (id) REFERENCES blockhash(id) NOT DEFERRABLE, CONSTRAINT "block_id_fkey" FOREIGN KEY (id) REFERENCES blockhash(id) NOT DEFERRABLE,
...@@ -42,16 +42,16 @@ CREATE INDEX "block_timestamp" ON "public"."block" USING btree ("timestamp"); ...@@ -42,16 +42,16 @@ CREATE INDEX "block_timestamp" ON "public"."block" USING btree ("timestamp");
CREATE TABLE "public"."transaction" ( CREATE TABLE "public"."transaction" (
"hash" character(66) NOT NULL, "hash" character(66) NOT NULL,
"blockId" integer, "blockId" bigint,
"nonce" integer NOT NULL, "nonce" bigint NOT NULL,
"gas" integer NOT NULL, "gas" bigint NOT NULL,
"gasPrice" integer NOT NULL, "gasPrice" bigint NOT NULL,
"value" integer NOT NULL, "value" bigint NOT NULL,
"fromAccountId" integer NOT NULL, "fromAccountId" bigint NOT NULL,
"toAccountId" integer NOT NULL, "toAccountId" bigint NOT NULL,
"contractaddressAccountId" integer, "contractaddressAccountId" bigint,
"status" smallint NOT NULL, "status" smallint NOT NULL,
"gasUsed" integer NOT NULL, "gasUsed" bigint NOT NULL,
"inputlen" smallint NOT NULL, "inputlen" smallint NOT NULL,
"input" text NOT NULL, "input" text NOT NULL,
CONSTRAINT "transaction_contractaddressAccountId_fkey" FOREIGN KEY ("contractaddressAccountId") REFERENCES account(id) NOT DEFERRABLE, CONSTRAINT "transaction_contractaddressAccountId_fkey" FOREIGN KEY ("contractaddressAccountId") REFERENCES account(id) NOT DEFERRABLE,
...@@ -64,6 +64,8 @@ CREATE INDEX "transaction_fromAccountId" ON "public"."transaction" USING btree ( ...@@ -64,6 +64,8 @@ CREATE INDEX "transaction_fromAccountId" ON "public"."transaction" USING btree (
CREATE INDEX "transaction_toAccountId" ON "public"."transaction" USING btree ("toAccountId"); CREATE INDEX "transaction_toAccountId" ON "public"."transaction" USING btree ("toAccountId");
CREATE INDEX "transaction_blockId" ON "public"."transaction" USING btree ("blockId"); CREATE INDEX "transaction_blockId" ON "public"."transaction" USING btree ("blockId");
CREATE VIEW b AS SELECT b1.hash "hash", b2.hash "parentHash", number, account.address sealer, timestamp, difficulty, "gasUsed", "gasLimit", size FROM block, blockhash b1, blockhash b2, account WHERE block.id=b1.id AND block."parentBlockhashId"=b2.id AND block."sealerAccountId"=account.id;
INSERT INTO "account" ("id", "address", "shortname", "name") VALUES INSERT INTO "account" ("id", "address", "shortname", "name") VALUES
(1, '0x377ab0cd00744dbb07b369cd5c0872dcd362c8f0', 'UNER', 'Universidad Nacional de Entre Rios'), (1, '0x377ab0cd00744dbb07b369cd5c0872dcd362c8f0', 'UNER', 'Universidad Nacional de Entre Rios'),
(2, '0x2feb6a8876bd9e2116b47834b977506a08ea77bd', 'PNA', 'Prefectura Nacional Argentina'), (2, '0x2feb6a8876bd9e2116b47834b977506a08ea77bd', 'PNA', 'Prefectura Nacional Argentina'),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment