text: /* Create Memory Tables
   *
   */
  
  BEGIN;
  
  CREATE TABLE IF NOT EXISTS "mem_accounts"(
    "username" VARCHAR(20),
    "isDelegate" SMALLINT DEFAULT 0,
    "u_isDelegate" SMALLINT DEFAULT 0,
    "secondSignature" SMALLINT DEFAULT 0,
    "u_secondSignature" SMALLINT DEFAULT 0,
    "u_username" VARCHAR(20),
    "address" VARCHAR(50) NOT NULL UNIQUE PRIMARY KEY,
    "publicKey" BYTEA,
    "secondPublicKey" BYTEA,
    "balance" NUMERIC(30,10) DEFAULT 0,
    "u_balance" NUMERIC(30,10) DEFAULT 0,
    "vote" BIGINT DEFAULT 0,
    "rate" BIGINT DEFAULT 0,
    "delegates" TEXT,
    "u_delegates" TEXT,
    "multisignatures" TEXT,
    "u_multisignatures" TEXT,
    "multimin" SMALLINT DEFAULT 0,
    "u_multimin" SMALLINT DEFAULT 0,
    "multilifetime" SMALLINT DEFAULT 0,
    "u_multilifetime" SMALLINT DEFAULT 0,
    "blockId" VARCHAR(64),
    "nameexist" SMALLINT DEFAULT 0,
    "u_nameexist" SMALLINT DEFAULT 0,
    "producedblocks" int DEFAULT 0,
    "missedblocks" int DEFAULT 0,
    "fees" BIGINT DEFAULT 0,
    "rewards" NUMERIC(30,10) DEFAULT 0,
    "virgin" SMALLINT DEFAULT 1
  );
  
  CREATE INDEX IF NOT EXISTS "mem_accounts_balance" ON "mem_accounts"("balance");
  
  CREATE TABLE IF NOT EXISTS "mem_delegates"(
    "publicKey" VARCHAR(66) NOT NULL,
    "vote" BIGINT NOT NULL,
    "round" BIGINT NOT NULL,
    "producedblocks" int,
    "missedblocks" int
  );
  
  CREATE TABLE IF NOT EXISTS "mem_accounts2delegates"(
    "accountId" VARCHAR(50) NOT NULL,
    "dependentId" VARCHAR(66) NOT NULL,
    FOREIGN KEY ("accountId") REFERENCES mem_accounts("address") ON DELETE CASCADE
  );
  
  CREATE TABLE IF NOT EXISTS "mem_accounts2u_delegates"(
    "accountId" VARCHAR(50) NOT NULL,
    "dependentId" VARCHAR(66) NOT NULL,
    FOREIGN KEY ("accountId") REFERENCES mem_accounts("address") ON DELETE CASCADE
  );
  
  CREATE TABLE IF NOT EXISTS "mem_accounts2multisignatures"(
    "accountId" VARCHAR(50) NOT NULL,
    "dependentId" VARCHAR(66) NOT NULL,
    FOREIGN KEY ("accountId") REFERENCES mem_accounts("address") ON DELETE CASCADE
  );
  
  CREATE TABLE IF NOT EXISTS "mem_accounts2u_multisignatures"(
    "accountId" VARCHAR(50) NOT NULL,
    "dependentId" VARCHAR(66) NOT NULL,
    FOREIGN KEY ("accountId") REFERENCES mem_accounts("address") ON DELETE CASCADE
  );
  
  
  CREATE INDEX IF NOT EXISTS "mem_delegates_vote" ON "mem_delegates"("vote");
  
  CREATE INDEX IF NOT EXISTS "mem_delegates_round" ON "mem_delegates"("round");
  
  CREATE INDEX IF NOT EXISTS "mem_accounts2delegates_accountId" ON "mem_accounts2delegates"("accountId");
  
  CREATE INDEX IF NOT EXISTS "mem_accounts2u_delegates_accountId" ON "mem_accounts2u_delegates"("accountId");
  
  CREATE INDEX IF NOT EXISTS "mem_accounts2multisignatures_accountId" ON "mem_accounts2multisignatures"("accountId");
  
  CREATE INDEX IF NOT EXISTS "mem_accounts2u_multisignatures_accountId" ON "mem_accounts2u_multisignatures"("accountId");
  
  COMMIT;
  