text: -- This file is not generated by SCC. It's used by tests that check Core DB schema
  -- version compatibility. All unnecessary tables are removed.
  
  --
  -- PostgreSQL database dump
  --
  
  -- Dumped from database version 9.6.1
  -- Dumped by pg_dump version 9.6.1
  
  SET statement_timeout = 0;
  SET lock_timeout = 0;
  SET idle_in_transaction_session_timeout = 0;
  SET client_encoding = 'UTF8';
  SET standard_conforming_strings = on;
  SET check_function_bodies = false;
  SET client_min_messages = warning;
  SET row_security = off;
  
  SET search_path = public, pg_catalog;
  
  DROP INDEX IF EXISTS public.upgradehistbyseq;
  DROP INDEX IF EXISTS public.signersaccount;
  DROP INDEX IF EXISTS public.sellingissuerindex;
  DROP INDEX IF EXISTS public.scpquorumsbyseq;
  DROP INDEX IF EXISTS public.scpenvsbyseq;
  DROP INDEX IF EXISTS public.priceindex;
  DROP INDEX IF EXISTS public.ledgersbyseq;
  DROP INDEX IF EXISTS public.histfeebyseq;
  DROP INDEX IF EXISTS public.histbyseq;
  DROP INDEX IF EXISTS public.buyingissuerindex;
  DROP INDEX IF EXISTS public.accountbalances;
  ALTER TABLE IF EXISTS ONLY public.upgradehistory DROP CONSTRAINT IF EXISTS upgradehistory_pkey;
  ALTER TABLE IF EXISTS ONLY public.txhistory DROP CONSTRAINT IF EXISTS txhistory_pkey;
  ALTER TABLE IF EXISTS ONLY public.txfeehistory DROP CONSTRAINT IF EXISTS txfeehistory_pkey;
  ALTER TABLE IF EXISTS ONLY public.trustlines DROP CONSTRAINT IF EXISTS trustlines_pkey;
  ALTER TABLE IF EXISTS ONLY public.storestate DROP CONSTRAINT IF EXISTS storestate_pkey;
  ALTER TABLE IF EXISTS ONLY public.signers DROP CONSTRAINT IF EXISTS signers_pkey;
  ALTER TABLE IF EXISTS ONLY public.scpquorums DROP CONSTRAINT IF EXISTS scpquorums_pkey;
  ALTER TABLE IF EXISTS ONLY public.pubsub DROP CONSTRAINT IF EXISTS pubsub_pkey;
  ALTER TABLE IF EXISTS ONLY public.publishqueue DROP CONSTRAINT IF EXISTS publishqueue_pkey;
  ALTER TABLE IF EXISTS ONLY public.peers DROP CONSTRAINT IF EXISTS peers_pkey;
  ALTER TABLE IF EXISTS ONLY public.offers DROP CONSTRAINT IF EXISTS offers_pkey;
  ALTER TABLE IF EXISTS ONLY public.ledgerheaders DROP CONSTRAINT IF EXISTS ledgerheaders_pkey;
  ALTER TABLE IF EXISTS ONLY public.ledgerheaders DROP CONSTRAINT IF EXISTS ledgerheaders_ledgerseq_key;
  ALTER TABLE IF EXISTS ONLY public.ban DROP CONSTRAINT IF EXISTS ban_pkey;
  ALTER TABLE IF EXISTS ONLY public.accounts DROP CONSTRAINT IF EXISTS accounts_pkey;
  ALTER TABLE IF EXISTS ONLY public.accountdata DROP CONSTRAINT IF EXISTS accountdata_pkey;
  DROP TABLE IF EXISTS public.upgradehistory;
  DROP TABLE IF EXISTS public.txhistory;
  DROP TABLE IF EXISTS public.txfeehistory;
  DROP TABLE IF EXISTS public.trustlines;
  DROP TABLE IF EXISTS public.storestate;
  DROP TABLE IF EXISTS public.signers;
  DROP TABLE IF EXISTS public.scpquorums;
  DROP TABLE IF EXISTS public.scphistory;
  DROP TABLE IF EXISTS public.pubsub;
  DROP TABLE IF EXISTS public.publishqueue;
  DROP TABLE IF EXISTS public.peers;
  DROP TABLE IF EXISTS public.offers;
  DROP TABLE IF EXISTS public.ledgerheaders;
  DROP TABLE IF EXISTS public.ban;
  DROP TABLE IF EXISTS public.accounts;
  DROP TABLE IF EXISTS public.accountdata;
  DROP EXTENSION IF EXISTS plpgsql;
  DROP SCHEMA IF EXISTS public;
  --
  -- Name: public; Type: SCHEMA; Schema: -; Owner: -
  --
  
  CREATE SCHEMA public;
  
  --
  -- Name: storestate; Type: TABLE; Schema: public; Owner: -
  --
  
  CREATE TABLE storestate (
      statename character(32) NOT NULL,
      state text
  );
  
  --
  -- Name: storestate storestate_pkey; Type: CONSTRAINT; Schema: public; Owner: -
  --
  
  ALTER TABLE ONLY storestate
      ADD CONSTRAINT storestate_pkey PRIMARY KEY (statename);
  
  INSERT INTO storestate VALUES ('databaseschema                  ', '8');
  
  --
  -- Name: accounts; Type: TABLE; Schema: public; Owner: -
  --
  
  CREATE TABLE accounts (
      accountid character varying(56) NOT NULL,
      balance bigint NOT NULL,
      seqnum bigint NOT NULL,
      numsubentries integer NOT NULL,
      inflationdest character varying(56),
      homedomain character varying(32) NOT NULL,
      thresholds text NOT NULL,
      flags integer NOT NULL,
      lastmodified integer NOT NULL,
      buyingliabilities bigint,
      sellingliabilities bigint,
      CONSTRAINT accounts_balance_check CHECK ((balance >= 0)),
      CONSTRAINT accounts_buyingliabilities_check CHECK ((buyingliabilities >= 0)),
      CONSTRAINT accounts_numsubentries_check CHECK ((numsubentries >= 0)),
      CONSTRAINT accounts_sellingliabilities_check CHECK ((sellingliabilities >= 0))
  );
  
  --
  -- Name: accounts accounts_pkey; Type: CONSTRAINT; Schema: public; Owner: -
  --
  
  ALTER TABLE ONLY accounts
      ADD CONSTRAINT accounts_pkey PRIMARY KEY (accountid);
  
  --
  -- Name: accountbalances; Type: INDEX; Schema: public; Owner: -
  --
  
  CREATE INDEX accountbalances ON accounts USING btree (balance) WHERE (balance >= 1000000000);
  
  INSERT INTO accounts VALUES ('GBRPYHIL2CI3FNQ4BXLFMNDLFJUNPU2HY3ZMFSHONUCEOASW7QC7OX2H', 999999979999999800, 2, 0, NULL, 'paydex.org', 'AQAAAA==', 0, 2, NULL, NULL);
  
  --
  -- Name: accountdata; Type: TABLE; Schema: public; Owner: -
  --
  
  CREATE TABLE accountdata (
      accountid character varying(56) NOT NULL,
      dataname character varying(64) NOT NULL,
      datavalue character varying(112) NOT NULL,
      lastmodified integer NOT NULL
  );
  
  
  --
  -- Name: accountdata accountdata_pkey; Type: CONSTRAINT; Schema: public; Owner: -
  --
  
  ALTER TABLE ONLY accountdata
      ADD CONSTRAINT accountdata_pkey PRIMARY KEY (accountid, dataname);
  
  
  INSERT INTO accountdata VALUES ('GBRPYHIL2CI3FNQ4BXLFMNDLFJUNPU2HY3ZMFSHONUCEOASW7QC7OX2H', 'aaa', 'bWFu', 10);
  
  --
  -- Name: ledgerheaders; Type: TABLE; Schema: public; Owner: -
  --
  
  CREATE TABLE ledgerheaders (
      ledgerhash character(64) NOT NULL,
      prevhash character(64) NOT NULL,
      bucketlisthash character(64) NOT NULL,
      ledgerseq integer,
      closetime bigint NOT NULL,
      data text NOT NULL,
      CONSTRAINT ledgerheaders_closetime_check CHECK ((closetime >= 0)),
      CONSTRAINT ledgerheaders_ledgerseq_check CHECK ((ledgerseq >= 0))
  );
  
  --
  -- Name: offers; Type: TABLE; Schema: public; Owner: -
  --
  
  CREATE TABLE offers (
      sellerid character varying(56) NOT NULL,
      offerid bigint NOT NULL,
      sellingassettype integer NOT NULL,
      sellingassetcode character varying(12),
      sellingissuer character varying(56),
      buyingassettype integer NOT NULL,
      buyingassetcode character varying(12),
      buyingissuer character varying(56),
      amount bigint NOT NULL,
      pricen integer NOT NULL,
      priced integer NOT NULL,
      price double precision NOT NULL,
      flags integer NOT NULL,
      lastmodified integer NOT NULL,
      CONSTRAINT offers_amount_check CHECK ((amount >= 0)),
      CONSTRAINT offers_offerid_check CHECK ((offerid >= 0))
  );
  
  ALTER TABLE ONLY offers
      ADD CONSTRAINT offers_pkey PRIMARY KEY (offerid);
  
  INSERT INTO offers VALUES ('GAXMF43TGZHW3QN3REOUA2U5PW5BTARXGGYJ3JIFHW3YT6QRKRL3CPPU', 1, 0, NULL, NULL, 1, 'USD', 'GAXMF43TGZHW3QN3REOUA2U5PW5BTARXGGYJ3JIFHW3YT6QRKRL3CPPU', 2000000000, 1, 2, 0.5, 0, 19);
  
  INSERT INTO offers VALUES ('GB2QIYT2IAUFMRXKLSLLPRECC6OCOGJMADSPTRK7TGNT2SFR2YGWDARD', 4, 1, 'USD', 'GB2QIYT2IAUFMRXKLSLLPRECC6OCOGJMADSPTRK7TGNT2SFR2YGWDARD', 0, NULL, NULL, 100000000, 1, 1, 1, 0, 24);
  INSERT INTO offers VALUES ('GB2QIYT2IAUFMRXKLSLLPRECC6OCOGJMADSPTRK7TGNT2SFR2YGWDARD', 5, 1, 'USD', 'GB2QIYT2IAUFMRXKLSLLPRECC6OCOGJMADSPTRK7TGNT2SFR2YGWDARD', 0, NULL, NULL, 200000000, 2, 1, 2, 0, 24);
  INSERT INTO offers VALUES ('GB2QIYT2IAUFMRXKLSLLPRECC6OCOGJMADSPTRK7TGNT2SFR2YGWDARD', 6, 0, NULL, NULL, 1, 'USD', 'GB2QIYT2IAUFMRXKLSLLPRECC6OCOGJMADSPTRK7TGNT2SFR2YGWDARD', 300000000, 1, 1, 1, 0, 24);
  INSERT INTO offers VALUES ('GB2QIYT2IAUFMRXKLSLLPRECC6OCOGJMADSPTRK7TGNT2SFR2YGWDARD', 7, 0, NULL, NULL, 1, 'USD', 'GB2QIYT2IAUFMRXKLSLLPRECC6OCOGJMADSPTRK7TGNT2SFR2YGWDARD', 400000000, 3, 1, 3, 0, 24);
  
  --
  -- Name: signers; Type: TABLE; Schema: public; Owner: -
  --
  
  CREATE TABLE signers (
      accountid character varying(56) NOT NULL,
      publickey character varying(56) NOT NULL,
      weight integer NOT NULL
  );
  
  --
  -- Name: signers signers_pkey; Type: CONSTRAINT; Schema: public; Owner: -
  --
  
  ALTER TABLE ONLY signers
      ADD CONSTRAINT signers_pkey PRIMARY KEY (accountid, publickey);
  
  
  --
  -- Name: signersaccount; Type: INDEX; Schema: public; Owner: -
  --
  
  CREATE INDEX signersaccount ON signers USING btree (accountid);
  
  INSERT INTO signers VALUES ('GBRPYHIL2CI3FNQ4BXLFMNDLFJUNPU2HY3ZMFSHONUCEOASW7QC7OX2H', 'GAFEES4MDE5Z7Q6JBB2BYMLS7YWEHTPNR7ICANZA7TAOLMSRELE4H4S2', 2);
  