From 60d7ce8e8206b96542df61226297c5dfba0194fb Mon Sep 17 00:00:00 2001 From: Kyle Lawlor-Bagcal Date: Wed, 27 Sep 2023 17:08:13 -0400 Subject: [PATCH] feat: add graphile-migrate for managing migrations --- .gitignore | 131 ++++++ .gmrc | 140 ++++++ docker-compose.yml | 4 +- docker/indexer.Dockerfile | 3 +- docker/scripts/indexer_init.sh | 5 +- migrations/README.md | 72 +++ migrations/current.sql | 1 + migrations/initial_schema.sql | 668 ++++++++++++++++++++++++++ package-lock.json | 833 +++++++++++++++++++++++++++++++++ package.json | 12 + 10 files changed, 1866 insertions(+), 3 deletions(-) create mode 100644 .gmrc create mode 100644 migrations/README.md create mode 100644 migrations/current.sql create mode 100644 migrations/initial_schema.sql create mode 100644 package-lock.json create mode 100644 package.json diff --git a/.gitignore b/.gitignore index 26e9e00..828c5d5 100644 --- a/.gitignore +++ b/.gitignore @@ -232,3 +232,134 @@ cython_debug/ # vendor/ /.idea/ + +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* +.pnpm-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# Snowpack dependency directory (https://snowpack.dev/) +web_modules/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional stylelint cache +.stylelintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variable files +.env +.env.development.local +.env.test.local +.env.production.local +.env.local + +# parcel-bundler cache (https://parceljs.org/) +.cache +.parcel-cache + +# Next.js build output +.next +out + +# Nuxt.js build / generate output +.nuxt +dist + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and not Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# vuepress v2.x temp and cache directory +.temp +.cache + +# Docusaurus cache and generated files +.docusaurus + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port + +# Stores VSCode versions used for testing VSCode extensions +.vscode-test + +# yarn v2 +.yarn/cache +.yarn/unplugged +.yarn/build-state.yml +.yarn/install-state.gz +.pnp.* diff --git a/.gmrc b/.gmrc new file mode 100644 index 0000000..2a86f69 --- /dev/null +++ b/.gmrc @@ -0,0 +1,140 @@ +/* + * Graphile Migrate configuration. + * + * If you decide to commit this file (recommended) please ensure that it does + * not contain any secrets (passwords, etc) - we recommend you manage these + * with environmental variables instead. + * + * This file is in JSON5 format, in VSCode you can use "JSON with comments" as + * the file format. + */ +{ + /* + * connectionString: this tells Graphile Migrate where to find the database + * to run the migrations against. + * + * RECOMMENDATION: use `DATABASE_URL` envvar instead. + */ + // "connectionString": "postgres://appuser:apppassword@host:5432/appdb", + + /* + * shadowConnectionString: like connectionString, but this is used for the + * shadow database (which will be reset frequently). + * + * RECOMMENDATION: use `SHADOW_DATABASE_URL` envvar instead. + */ + // "shadowConnectionString": "postgres://appuser:apppassword@host:5432/appdb_shadow", + + /* + * rootConnectionString: like connectionString, but this is used for + * dropping/creating the database in `graphile-migrate reset`. This isn't + * necessary, shouldn't be used in production, but helps during development. + * + * RECOMMENDATION: use `ROOT_DATABASE_URL` envvar instead. + */ + // "rootConnectionString": "postgres://adminuser:adminpassword@host:5432/postgres", + + /* + * pgSettings: key-value settings to be automatically loaded into PostgreSQL + * before running migrations, using an equivalent of `SET LOCAL TO + * ` + */ + "pgSettings": { + // "search_path": "app_public,app_private,app_hidden,public", + }, + + /* + * placeholders: substituted in SQL files when compiled/executed. Placeholder + * keys should be prefixed with a colon and in all caps, like + * `:COLON_PREFIXED_ALL_CAPS`. Placeholder values should be strings. They + * will be replaced verbatim with NO ESCAPING AT ALL (this differs from how + * psql handles placeholders) so should only be used with "safe" values. This + * is useful for committing migrations where certain parameters can change + * between environments (development, staging, production) but you wish to + * use the same signed migration files for all. + * + * The special value "!ENV" can be used to indicate an environmental variable + * of the same name should be used. + * + * Graphile Migrate automatically sets the `:DATABASE_NAME` and + * `:DATABASE_OWNER` placeholders, and you should not attempt to override + * these. + */ + "placeholders": { + // ":DATABASE_VISITOR": "!ENV", // Uses process.env.DATABASE_VISITOR + }, + + /* + * Actions allow you to run scripts or commands at certain points in the + * migration lifecycle. SQL files are ran against the database directly. + * "command" actions are ran with the following environmental variables set: + * + * - GM_DBURL: the PostgreSQL URL of the database being migrated + * - GM_DBNAME: the name of the database from GM_DBURL + * - GM_DBUSER: the user from GM_DBURL + * - GM_SHADOW: set to 1 if the shadow database is being migrated, left unset + * otherwise + * + * If "shadow" is unspecified, the actions will run on events to both shadow + * and normal databases. If "shadow" is true the action will only run on + * actions to the shadow DB, and if false only on actions to the main DB. + */ + + /* + * afterReset: actions executed after a `graphile-migrate reset` command. + */ + "afterReset": [ + // "afterReset.sql", + // { "_": "command", "command": "graphile-worker --schema-only" }, + "initial_schema.sql" + ], + + /* + * afterAllMigrations: actions executed once all migrations are complete. + */ + "afterAllMigrations": [ + { + "_": "command", + "shadow": true, + "command": "pg_dump --no-sync --schema-only --no-owner --file=./migrations/schema_snapshot.sql $SHADOW_DATABASE_URL", + }, + ], + + /* + * afterCurrent: actions executed once the current migration has been + * evaluated (i.e. in watch mode). + */ + "afterCurrent": [ + // { + // "_": "command", + // "shadow": true, + // "command": "if [ \"$IN_TESTS\" = \"1\" ]; then ./scripts/test-seed; fi", + // }, + ], + + /* + * blankMigrationContent: content to be written to the current migration + * after commit. NOTE: this should only contain comments. + */ + // "blankMigrationContent": "-- Write your migration here\n", + + /****************************************************************************\ + *** *** + *** You probably don't want to edit anything below here. *** + *** *** + \****************************************************************************/ + + /* + * manageGraphileMigrateSchema: if you set this false, you must be sure to + * keep the graphile_migrate schema up to date yourself. We recommend you + * leave it at its default. + */ + // "manageGraphileMigrateSchema": true, + + /* + * migrationsFolder: path to the folder in which to store your migrations. + */ + // migrationsFolder: "./migrations", + + "//generatedWith": "1.4.1" +} diff --git a/docker-compose.yml b/docker-compose.yml index 6e8bb8b..b9c199d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -37,7 +37,9 @@ services: dockerfile: docker/indexer.Dockerfile container_name: indexer_container environment: - DATABASE_URL: postgres://postgres:password@localhost:5432 + DATABASE_URL: postgres://postgres:password@localhost:5432/indexer + SHADOW_DATABASE_URL: postgres://postgres:password@localhost:5432/indexer_shadow + ROOT_DATABASE_URL: postgres://postgres:password@localhost:5432/postgres REGEN_API: http://localhost:1317 REGEN_RPC: http://localhost:26657 entrypoint: ["/bin/sh", "-c", "./docker/scripts/indexer_start.sh"] diff --git a/docker/indexer.Dockerfile b/docker/indexer.Dockerfile index 6908d98..5f8c861 100644 --- a/docker/indexer.Dockerfile +++ b/docker/indexer.Dockerfile @@ -2,7 +2,7 @@ FROM python:3.9 # Install dependencies RUN apt-get update -RUN apt-get install libpq-dev postgresql-client python3-poetry -y +RUN apt-get install libpq-dev postgresql-client nodejs npm python3-poetry -y # Set working directory WORKDIR /home/indexer @@ -12,3 +12,4 @@ COPY . . # Install indexer RUN poetry install +RUN npm i diff --git a/docker/scripts/indexer_init.sh b/docker/scripts/indexer_init.sh index 2739906..94cf395 100755 --- a/docker/scripts/indexer_init.sh +++ b/docker/scripts/indexer_init.sh @@ -1,7 +1,10 @@ #!/bin/bash +psql "$DATABASE_URL" -c "CREATE DATABASE indexer" +psql "$DATABASE_URL" -c "CREATE DATABASE indexer_shadow" + # run migrations -(cd sql && ./run_all_migrations.sh) +npm run db-init # workaround for indexer starting with new chain psql "$DATABASE_URL" -c "INSERT INTO chain ( diff --git a/migrations/README.md b/migrations/README.md new file mode 100644 index 0000000..1228d1e --- /dev/null +++ b/migrations/README.md @@ -0,0 +1,72 @@ +# Migrations + +This readme provides info about how to work with migrations in this repo. + +## Local development + +In order to develop this project locally we must use the following commands. +If this is your first time setting up the project locally, we need to initialize your database. +First, you must run the local database: + +``` +$ pwd +/Users/kyle/regen/indexer +$ docker-compose up --build postgres +``` + +Then, you must initialize the database: + +``` +$ export DATABASE_URL="postgres://postgres:postgres@localhost:5432/indexer" +$ export SHADOW_DATABASE_URL="postgres://postgres:postgres@localhost:5432/indexer_shadow" +$ export ROOT_DATABASE_URL="postgres://postgres:postgres@localhost:5432/postgres" +$ yarn run graphile-migrate reset --erase +``` + +Now, we set up a watch process that will monitor `migrations/current.sql` for your changes as well as apply them to your local database: + +``` +$ yarn run graphile-migrate watch +``` + +When you are satisfied with the changes in `migration/current.sql`, you commit them: + +``` +$ yarn run graphile-migrate commit +``` + +By committing your changes you should see a new SQL file in `migration/committed/`. + +## Schema Snapshot + +The schema snapshot is stored and tracked in version control as `migrations/schema_snapshot.sql`. +Each time you apply a migration in local development this snapshot will be automatically updated. +See `.gmrc` and `afterAllMigrations` from [the `graphile-migrate` configuration docs](https://github.com/graphile/migrate#configuration) for how this is done. +This allows us to keep track of the changes being introduced to the schema. +You must commit your changes to this file. + +This is a helpful file to keep in mind when you have questions about entities in the database. +For example, it allows you to also view the functions in the database being used in various RLS policies. +Similarly, you can view the various policies in the database or which tables have RLS enabled. + +## Deploying to staging or production + +The migrations are always automatically run in Heroku for staging and production. +See the `migrate` command in `package.json` and `Procfile` for Heroku. + +## Debugging + +This section contains some notes that may be useful for debugging common scenarios. + +### Viewing migrations applied in a particular database + +Our migration tool tracks which migrations have been applied in the following table: + +``` +regen_registry=# select * from graphile_migrate.migrations; + hash | previous_hash | filename | date +-----------------------------------------------+---------------+------------+------------------------------- + sha1:28ab5499d9a4520daa9428681a9bf1152f9887af | | 000001.sql | 2023-05-08 20:20:31.213547+00 +``` + +This is one way that you can track the migrations that will be deployed to staging or production. diff --git a/migrations/current.sql b/migrations/current.sql new file mode 100644 index 0000000..8da5339 --- /dev/null +++ b/migrations/current.sql @@ -0,0 +1 @@ +-- Enter migration here diff --git a/migrations/initial_schema.sql b/migrations/initial_schema.sql new file mode 100644 index 0000000..cd6b5ee --- /dev/null +++ b/migrations/initial_schema.sql @@ -0,0 +1,668 @@ +-- +-- PostgreSQL database dump +-- + +-- Dumped from database version 13.11 (Ubuntu 13.11-1.pgdg20.04+1) +-- Dumped by pg_dump version 14.9 (Homebrew) + +SET statement_timeout = 0; +SET lock_timeout = 0; +SET idle_in_transaction_session_timeout = 0; +SET client_encoding = 'UTF8'; +SET standard_conforming_strings = on; +SELECT pg_catalog.set_config('search_path', '', false); +SET check_function_bodies = false; +SET xmloption = content; +SET client_min_messages = warning; +SET row_security = off; + + +-- +-- Name: pg_stat_statements; Type: EXTENSION; Schema: -; Owner: - +-- + +CREATE EXTENSION IF NOT EXISTS pg_stat_statements WITH SCHEMA public; + + +-- +-- Name: EXTENSION pg_stat_statements; Type: COMMENT; Schema: -; Owner: - +-- + +COMMENT ON EXTENSION pg_stat_statements IS 'track planning and execution statistics of all SQL statements executed'; + + +-- +-- Name: pgcrypto; Type: EXTENSION; Schema: -; Owner: - +-- + +CREATE EXTENSION IF NOT EXISTS pgcrypto WITH SCHEMA public; + + +-- +-- Name: EXTENSION pgcrypto; Type: COMMENT; Schema: -; Owner: - +-- + +COMMENT ON EXTENSION pgcrypto IS 'cryptographic functions'; + + +SET default_tablespace = ''; + +SET default_table_access_method = heap; + +-- +-- Name: tx; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.tx ( + chain_num smallint NOT NULL, + block_height bigint NOT NULL, + tx_idx smallint NOT NULL, + hash bytea NOT NULL, + data jsonb NOT NULL +); + + +-- +-- Name: all_ecocredit_txes(); Type: FUNCTION; Schema: public; Owner: - +-- + +CREATE FUNCTION public.all_ecocredit_txes() RETURNS SETOF public.tx + LANGUAGE sql STABLE + AS $$ + select tx.* + from tx + natural join msg_event as me + where + data ->'tx_response'->'code' = '0' + and me.type like 'regen.ecocredit.%' + order by tx.block_height desc +$$; + + +-- +-- Name: block; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.block ( + chain_num smallint NOT NULL, + height bigint NOT NULL, + data jsonb NOT NULL, + "time" timestamp with time zone NOT NULL +); + + +-- +-- Name: chain; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.chain ( + num smallint NOT NULL, + chain_id text NOT NULL +); + + +-- +-- Name: chain_num_seq; Type: SEQUENCE; Schema: public; Owner: - +-- + +CREATE SEQUENCE public.chain_num_seq + AS smallint + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: chain_num_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - +-- + +ALTER SEQUENCE public.chain_num_seq OWNED BY public.chain.num; + + +-- +-- Name: class_issuers; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.class_issuers ( + type text NOT NULL, + block_height bigint NOT NULL, + tx_idx smallint NOT NULL, + msg_idx smallint NOT NULL, + chain_num smallint NOT NULL, + "timestamp" timestamp with time zone, + tx_hash text NOT NULL, + class_id text NOT NULL, + issuer text NOT NULL, + latest boolean DEFAULT true NOT NULL +); + + +-- +-- Name: msg_event_attr; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.msg_event_attr ( + chain_num smallint NOT NULL, + block_height bigint NOT NULL, + tx_idx smallint NOT NULL, + msg_idx smallint NOT NULL, + type text NOT NULL, + key text NOT NULL, + value text NOT NULL, + value_hash bytea NOT NULL +); + + +-- +-- Name: event_retire_v1; Type: VIEW; Schema: public; Owner: - +-- + +CREATE VIEW public.event_retire_v1 AS + SELECT msg_event_attr.chain_num, + msg_event_attr.block_height, + msg_event_attr.tx_idx, + msg_event_attr.msg_idx, + max( + CASE + WHEN (msg_event_attr.key = 'owner'::text) THEN msg_event_attr.value + ELSE NULL::text + END) AS owner, + max( + CASE + WHEN (msg_event_attr.key = 'batch_denom'::text) THEN msg_event_attr.value + ELSE NULL::text + END) AS batch_denom, + max( + CASE + WHEN (msg_event_attr.key = 'amount'::text) THEN msg_event_attr.value + ELSE NULL::text + END) AS amount, + max( + CASE + WHEN (msg_event_attr.key = 'jurisdiction'::text) THEN msg_event_attr.value + ELSE NULL::text + END) AS jurisdiction, + max( + CASE + WHEN (msg_event_attr.key = 'reason'::text) THEN msg_event_attr.value + ELSE NULL::text + END) AS reason, + (sum( + CASE + WHEN (msg_event_attr.key = 'amount'::text) THEN 1 + ELSE 0 + END) > 1) AS has_duplicates + FROM public.msg_event_attr + WHERE (msg_event_attr.type ~~ 'regen.ecocredit.v1.EventRetire'::text) + GROUP BY msg_event_attr.chain_num, msg_event_attr.block_height, msg_event_attr.tx_idx, msg_event_attr.msg_idx; + + +-- +-- Name: event_retire_v1alpha1; Type: VIEW; Schema: public; Owner: - +-- + +CREATE VIEW public.event_retire_v1alpha1 AS + SELECT msg_event_attr.chain_num, + msg_event_attr.block_height, + msg_event_attr.tx_idx, + msg_event_attr.msg_idx, + max( + CASE + WHEN (msg_event_attr.key = 'retirer'::text) THEN msg_event_attr.value + ELSE NULL::text + END) AS retirer, + max( + CASE + WHEN (msg_event_attr.key = 'batch_denom'::text) THEN msg_event_attr.value + ELSE NULL::text + END) AS batch_denom, + max( + CASE + WHEN (msg_event_attr.key = 'amount'::text) THEN msg_event_attr.value + ELSE NULL::text + END) AS amount, + max( + CASE + WHEN (msg_event_attr.key = 'location'::text) THEN msg_event_attr.value + ELSE NULL::text + END) AS location, + (sum( + CASE + WHEN (msg_event_attr.key = 'amount'::text) THEN 1 + ELSE 0 + END) > 1) AS has_duplicates + FROM public.msg_event_attr + WHERE (msg_event_attr.type ~~ 'regen.ecocredit.v1alpha1.EventRetire'::text) + GROUP BY msg_event_attr.chain_num, msg_event_attr.block_height, msg_event_attr.tx_idx, msg_event_attr.msg_idx; + + +-- +-- Name: event_retire; Type: VIEW; Schema: public; Owner: - +-- + +CREATE VIEW public.event_retire AS + SELECT event_retire_v1.chain_num, + event_retire_v1.block_height, + event_retire_v1.tx_idx, + event_retire_v1.msg_idx, + event_retire_v1.owner, + event_retire_v1.batch_denom, + event_retire_v1.amount, + event_retire_v1.jurisdiction, + event_retire_v1.reason, + event_retire_v1.has_duplicates + FROM public.event_retire_v1 +UNION + SELECT event_retire_v1alpha1.chain_num, + event_retire_v1alpha1.block_height, + event_retire_v1alpha1.tx_idx, + event_retire_v1alpha1.msg_idx, + event_retire_v1alpha1.retirer AS owner, + event_retire_v1alpha1.batch_denom, + event_retire_v1alpha1.amount, + event_retire_v1alpha1.location AS jurisdiction, + ''::text AS reason, + event_retire_v1alpha1.has_duplicates + FROM public.event_retire_v1alpha1; + + +-- +-- Name: flyway_schema_history; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.flyway_schema_history ( + installed_rank integer NOT NULL, + version character varying(50), + description character varying(200) NOT NULL, + type character varying(20) NOT NULL, + script character varying(1000) NOT NULL, + checksum integer, + installed_by character varying(100) NOT NULL, + installed_on timestamp without time zone DEFAULT now() NOT NULL, + execution_time integer NOT NULL, + success boolean NOT NULL +); + + +-- +-- Name: msg; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.msg ( + chain_num smallint NOT NULL, + block_height bigint NOT NULL, + tx_idx smallint NOT NULL, + msg_idx smallint NOT NULL, + data jsonb NOT NULL +); + + +-- +-- Name: msg_event; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.msg_event ( + chain_num smallint NOT NULL, + block_height bigint NOT NULL, + tx_idx smallint NOT NULL, + msg_idx smallint NOT NULL, + type text NOT NULL +); + + +-- +-- Name: proposals; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.proposals ( + type text NOT NULL, + block_height bigint NOT NULL, + tx_idx smallint NOT NULL, + msg_idx smallint NOT NULL, + chain_num smallint NOT NULL, + "timestamp" timestamp with time zone, + tx_hash text NOT NULL, + proposal_id bigint NOT NULL, + status text NOT NULL, + group_policy_address text NOT NULL, + metadata text NOT NULL, + proposers text[] NOT NULL, + submit_time timestamp with time zone, + group_version bigint NOT NULL, + group_policy_version bigint NOT NULL, + final_tally_result jsonb NOT NULL, + voting_period_end timestamp with time zone NOT NULL, + executor_result text NOT NULL, + messages jsonb NOT NULL +); + + +-- +-- Name: retirements; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.retirements ( + type text NOT NULL, + amount text NOT NULL, + batch_denom text NOT NULL, + jurisdiction text NOT NULL, + owner text NOT NULL, + reason text NOT NULL, + "timestamp" timestamp with time zone, + block_height bigint NOT NULL, + chain_num smallint NOT NULL, + tx_idx smallint NOT NULL, + msg_idx smallint NOT NULL, + tx_hash text NOT NULL +); + + +-- +-- Name: votes; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.votes ( + type text NOT NULL, + block_height bigint NOT NULL, + tx_idx smallint NOT NULL, + msg_idx smallint NOT NULL, + chain_num smallint NOT NULL, + "timestamp" timestamp with time zone, + tx_hash text NOT NULL, + proposal_id bigint NOT NULL, + voter text NOT NULL, + option text NOT NULL, + metadata text NOT NULL, + submit_time timestamp with time zone NOT NULL +); + + +-- +-- Name: chain num; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.chain ALTER COLUMN num SET DEFAULT nextval('public.chain_num_seq'::regclass); + + +-- +-- Name: block block_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.block + ADD CONSTRAINT block_pkey PRIMARY KEY (chain_num, height); + + +-- +-- Name: chain chain_chain_id_key; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.chain + ADD CONSTRAINT chain_chain_id_key UNIQUE (chain_id); + + +-- +-- Name: chain chain_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.chain + ADD CONSTRAINT chain_pkey PRIMARY KEY (num); + + +-- +-- Name: class_issuers class_issuers_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.class_issuers + ADD CONSTRAINT class_issuers_pkey PRIMARY KEY (chain_num, block_height, tx_idx, msg_idx, class_id, issuer); + + +-- +-- Name: flyway_schema_history flyway_schema_history_pk; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.flyway_schema_history + ADD CONSTRAINT flyway_schema_history_pk PRIMARY KEY (installed_rank); + + +-- +-- Name: msg_event_attr msg_event_attr_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.msg_event_attr + ADD CONSTRAINT msg_event_attr_pkey PRIMARY KEY (chain_num, block_height, tx_idx, msg_idx, type, key, value_hash); + + +-- +-- Name: msg_event msg_event_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.msg_event + ADD CONSTRAINT msg_event_pkey PRIMARY KEY (chain_num, block_height, tx_idx, msg_idx, type); + + +-- +-- Name: msg msg_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.msg + ADD CONSTRAINT msg_pkey PRIMARY KEY (chain_num, block_height, tx_idx, msg_idx); + + +-- +-- Name: proposals proposals_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.proposals + ADD CONSTRAINT proposals_pkey PRIMARY KEY (chain_num, block_height, tx_idx, msg_idx); + + +-- +-- Name: retirements retirements_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.retirements + ADD CONSTRAINT retirements_pkey PRIMARY KEY (chain_num, block_height, tx_idx, msg_idx); + + +-- +-- Name: tx tx_hash_key; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.tx + ADD CONSTRAINT tx_hash_key UNIQUE (hash); + + +-- +-- Name: tx tx_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.tx + ADD CONSTRAINT tx_pkey PRIMARY KEY (chain_num, block_height, tx_idx); + + +-- +-- Name: votes votes_chain_num_proposal_id_voter_ux; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.votes + ADD CONSTRAINT votes_chain_num_proposal_id_voter_ux UNIQUE (chain_num, proposal_id, voter); + + +-- +-- Name: votes votes_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.votes + ADD CONSTRAINT votes_pkey PRIMARY KEY (chain_num, block_height, tx_idx, msg_idx); + + +-- +-- Name: class_issuers_credit_class_id_idx; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX class_issuers_credit_class_id_idx ON public.class_issuers USING btree (class_id); + + +-- +-- Name: class_issuers_issuer_idx; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX class_issuers_issuer_idx ON public.class_issuers USING btree (issuer); + + +-- +-- Name: class_issuers_latest_idx; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX class_issuers_latest_idx ON public.class_issuers USING btree (latest); + + +-- +-- Name: flyway_schema_history_s_idx; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX flyway_schema_history_s_idx ON public.flyway_schema_history USING btree (success); + + +-- +-- Name: msg_event_attr_type_idx; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX msg_event_attr_type_idx ON public.msg_event_attr USING btree (type); + + +-- +-- Name: msg_event_type_idx; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX msg_event_type_idx ON public.msg_event USING btree (type); + + +-- +-- Name: msg_expr_idx; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX msg_expr_idx ON public.msg USING gin (((data -> '@type'::text))); + + +-- +-- Name: proposals_group_policy_address_idx; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX proposals_group_policy_address_idx ON public.proposals USING btree (group_policy_address); + + +-- +-- Name: proposals_proposal_id_idx; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX proposals_proposal_id_idx ON public.proposals USING btree (proposal_id); + + +-- +-- Name: retirements_owner_idx; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX retirements_owner_idx ON public.retirements USING btree (owner); + + +-- +-- Name: tx_data_tx_response_code_idx; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX tx_data_tx_response_code_idx ON public.tx USING btree ((((data -> 'tx_response'::text) -> 'code'::text))); + + +-- +-- Name: votes_proposal_id_chain_num_idx; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX votes_proposal_id_chain_num_idx ON public.votes USING btree (proposal_id, chain_num); + + +-- +-- Name: block block_chain_num_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.block + ADD CONSTRAINT block_chain_num_fkey FOREIGN KEY (chain_num) REFERENCES public.chain(num); + + +-- +-- Name: class_issuers class_issuers_chain_num_block_height_tx_idx_msg_idx_type_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.class_issuers + ADD CONSTRAINT class_issuers_chain_num_block_height_tx_idx_msg_idx_type_fkey FOREIGN KEY (chain_num, block_height, tx_idx, msg_idx, type) REFERENCES public.msg_event(chain_num, block_height, tx_idx, msg_idx, type); + + +-- +-- Name: msg msg_chain_num_block_height_tx_idx_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.msg + ADD CONSTRAINT msg_chain_num_block_height_tx_idx_fkey FOREIGN KEY (chain_num, block_height, tx_idx) REFERENCES public.tx(chain_num, block_height, tx_idx); + + +-- +-- Name: msg_event_attr msg_event_attr_chain_num_block_height_tx_idx_msg_idx_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.msg_event_attr + ADD CONSTRAINT msg_event_attr_chain_num_block_height_tx_idx_msg_idx_fkey FOREIGN KEY (chain_num, block_height, tx_idx, msg_idx) REFERENCES public.msg(chain_num, block_height, tx_idx, msg_idx); + + +-- +-- Name: msg_event msg_event_chain_num_block_height_tx_idx_msg_idx_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.msg_event + ADD CONSTRAINT msg_event_chain_num_block_height_tx_idx_msg_idx_fkey FOREIGN KEY (chain_num, block_height, tx_idx, msg_idx) REFERENCES public.msg(chain_num, block_height, tx_idx, msg_idx); + + +-- +-- Name: proposals proposals_chain_num_block_height_tx_idx_msg_idx_type_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.proposals + ADD CONSTRAINT proposals_chain_num_block_height_tx_idx_msg_idx_type_fkey FOREIGN KEY (chain_num, block_height, tx_idx, msg_idx, type) REFERENCES public.msg_event(chain_num, block_height, tx_idx, msg_idx, type); + + +-- +-- Name: retirements retirements_chain_num_block_height_tx_idx_msg_idx_type_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.retirements + ADD CONSTRAINT retirements_chain_num_block_height_tx_idx_msg_idx_type_fkey FOREIGN KEY (chain_num, block_height, tx_idx, msg_idx, type) REFERENCES public.msg_event(chain_num, block_height, tx_idx, msg_idx, type); + + +-- +-- Name: tx tx_chain_num_block_height_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.tx + ADD CONSTRAINT tx_chain_num_block_height_fkey FOREIGN KEY (chain_num, block_height) REFERENCES public.block(chain_num, height); + + +-- +-- Name: votes votes_chain_num_block_height_tx_idx_msg_idx_type_fkey; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.votes + ADD CONSTRAINT votes_chain_num_block_height_tx_idx_msg_idx_type_fkey FOREIGN KEY (chain_num, block_height, tx_idx, msg_idx, type) REFERENCES public.msg_event(chain_num, block_height, tx_idx, msg_idx, type); + + +-- +-- Name: SCHEMA public; Type: ACL; Schema: -; Owner: - +-- + +REVOKE ALL ON SCHEMA public FROM postgres; +REVOKE ALL ON SCHEMA public FROM PUBLIC; + + +-- +-- PostgreSQL database dump complete +-- + diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..c7aa17c --- /dev/null +++ b/package-lock.json @@ -0,0 +1,833 @@ +{ + "name": "indexer", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "indexer", + "version": "1.0.0", + "license": "Apache-2.0", + "dependencies": { + "graphile-migrate": "^1.4.1" + } + }, + "node_modules/@graphile/logger": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@graphile/logger/-/logger-0.2.0.tgz", + "integrity": "sha512-jjcWBokl9eb1gVJ85QmoaQ73CQ52xAaOCF29ukRbYNl6lY+ts0ErTaDYOBlejcbUs2OpaiqYLO5uDhyLFzWw4w==", + "license": "MIT" + }, + "node_modules/@types/json5": { + "version": "0.0.30", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.30.tgz", + "integrity": "sha512-sqm9g7mHlPY/43fcSNrCYfOeX9zkTTK+euO5E6+CVijSMm5tTjkVdwdqRkY3ljjIAf8679vps5jKUoJBCLsMDA==", + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "14.18.63", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.63.tgz", + "integrity": "sha512-fAtCfv4jJg+ExtXhvCkCqUKZ+4ok/JQk01qDKhL5BDDoS3AxKXhV5/MAVUZyQnSEd2GT92fkgZl0pz0Q0AzcIQ==", + "license": "MIT" + }, + "node_modules/@types/pg": { + "version": "8.10.3", + "resolved": "https://registry.npmjs.org/@types/pg/-/pg-8.10.3.tgz", + "integrity": "sha512-BACzsw64lCZesclRpZGu55tnqgFAYcrCBP92xLh1KLypZLCOsvJTSTgaoFVTy3lCys/aZTQzfeDxtjwrvdzL2g==", + "license": "MIT", + "dependencies": { + "@types/node": "*", + "pg-protocol": "*", + "pg-types": "^4.0.1" + } + }, + "node_modules/@types/pg/node_modules/@types/node": { + "version": "20.7.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.7.1.tgz", + "integrity": "sha512-LT+OIXpp2kj4E2S/p91BMe+VgGX2+lfO+XTpfXhh+bCk2LkQtHZSub8ewFBMGP5ClysPjTDFa4sMI8Q3n4T0wg==", + "license": "MIT" + }, + "node_modules/@types/pg/node_modules/pg-types": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-4.0.1.tgz", + "integrity": "sha512-hRCSDuLII9/LE3smys1hRHcu5QGcLs9ggT7I/TCs0IE+2Eesxi9+9RWAAwZ0yaGjxoWICF/YHLOEjydGujoJ+g==", + "license": "MIT", + "dependencies": { + "pg-int8": "1.0.1", + "pg-numeric": "1.0.2", + "postgres-array": "~3.0.1", + "postgres-bytea": "~3.0.0", + "postgres-date": "~2.0.1", + "postgres-interval": "^3.0.0", + "postgres-range": "^1.1.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@types/pg/node_modules/postgres-array": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-3.0.2.tgz", + "integrity": "sha512-6faShkdFugNQCLwucjPcY5ARoW1SlbnrZjmGl0IrrqewpvxvhSLHimCVzqeuULCbG0fQv7Dtk1yDbG3xv7Veog==", + "license": "MIT", + "engines": { + "node": ">=12" + } + }, + "node_modules/@types/pg/node_modules/postgres-bytea": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-3.0.0.tgz", + "integrity": "sha512-CNd4jim9RFPkObHSjVHlVrxoVQXz7quwNFpz7RY1okNNme49+sVyiTvTRobiLV548Hx/hb1BG+iE7h9493WzFw==", + "license": "MIT", + "dependencies": { + "obuf": "~1.1.2" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/@types/pg/node_modules/postgres-date": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-2.0.1.tgz", + "integrity": "sha512-YtMKdsDt5Ojv1wQRvUhnyDJNSr2dGIC96mQVKz7xufp07nfuFONzdaowrMHjlAzY6GDLd4f+LUHHAAM1h4MdUw==", + "license": "MIT", + "engines": { + "node": ">=12" + } + }, + "node_modules/@types/pg/node_modules/postgres-interval": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-3.0.0.tgz", + "integrity": "sha512-BSNDnbyZCXSxgA+1f5UU2GmwhoI0aU5yMxRGO8CdFEcY2BQF9xm/7MqKnYoM1nJDk8nONNWDk9WeSmePFhQdlw==", + "license": "MIT", + "engines": { + "node": ">=12" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "license": "ISC", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "license": "MIT", + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/buffer-writer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/buffer-writer/-/buffer-writer-2.0.0.tgz", + "integrity": "sha512-a7ZpuTZU1TRtnwyCNW3I5dc0wWNC3VR9S++Ewyk2HHZdrO3CQJqSpd+95Us590V6AL7JqUAH2IwZ/398PmNFgw==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/chokidar": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "license": "MIT", + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "license": "MIT" + }, + "node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT" + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "license": "MIT", + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/graphile-migrate": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/graphile-migrate/-/graphile-migrate-1.4.1.tgz", + "integrity": "sha512-yupLO7kPC8tPu9QjZbbd740bKvKjziZROhpsSVOBmIM4KKXpir9j1uOpekj6WzxQ+L1VlL3r/C6VgjYPP6QnqA==", + "dependencies": { + "@graphile/logger": "^0.2.0", + "@types/json5": "^0.0.30", + "@types/node": "^14.6.0", + "@types/pg": ">=6 <9", + "chalk": "^3.0.0", + "chokidar": "^3.5.1", + "json5": "^2.1.2", + "pg": ">=6.5 <9", + "pg-connection-string": "^2.1.0", + "pg-minify": "^1.5.2", + "tslib": "^1.10.0", + "yargs": "^15.3.1" + }, + "bin": { + "graphile-migrate": "dist/cli.js" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "license": "MIT", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "license": "MIT", + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/obuf": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz", + "integrity": "sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==", + "license": "MIT" + }, + "node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "license": "MIT", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "license": "MIT", + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/packet-reader": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/packet-reader/-/packet-reader-1.0.0.tgz", + "integrity": "sha512-HAKu/fG3HpHFO0AA8WE8q2g+gBJaZ9MG7fcKk+IJPLTGAD6Psw4443l+9DGRbOIh3/aXr7Phy0TjilYivJo5XQ==", + "license": "MIT" + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/pg": { + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/pg/-/pg-8.11.3.tgz", + "integrity": "sha512-+9iuvG8QfaaUrrph+kpF24cXkH1YOOUeArRNYIxq1viYHZagBxrTno7cecY1Fa44tJeZvaoG+Djpkc3JwehN5g==", + "license": "MIT", + "dependencies": { + "buffer-writer": "2.0.0", + "packet-reader": "1.0.0", + "pg-connection-string": "^2.6.2", + "pg-pool": "^3.6.1", + "pg-protocol": "^1.6.0", + "pg-types": "^2.1.0", + "pgpass": "1.x" + }, + "engines": { + "node": ">= 8.0.0" + }, + "optionalDependencies": { + "pg-cloudflare": "^1.1.1" + }, + "peerDependencies": { + "pg-native": ">=3.0.1" + }, + "peerDependenciesMeta": { + "pg-native": { + "optional": true + } + } + }, + "node_modules/pg-cloudflare": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pg-cloudflare/-/pg-cloudflare-1.1.1.tgz", + "integrity": "sha512-xWPagP/4B6BgFO+EKz3JONXv3YDgvkbVrGw2mTo3D6tVDQRh1e7cqVGvyR3BE+eQgAvx1XhW/iEASj4/jCWl3Q==", + "license": "MIT", + "optional": true + }, + "node_modules/pg-connection-string": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.6.2.tgz", + "integrity": "sha512-ch6OwaeaPYcova4kKZ15sbJ2hKb/VP48ZD2gE7i1J+L4MspCtBMAx8nMgz7bksc7IojCIIWuEhHibSMFH8m8oA==", + "license": "MIT" + }, + "node_modules/pg-int8": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz", + "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==", + "license": "ISC", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/pg-minify": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/pg-minify/-/pg-minify-1.6.3.tgz", + "integrity": "sha512-NoSsPqXxbkD8RIe+peQCqiea4QzXgosdTKY8p7PsbbGsh2F8TifDj/vJxfuR8qJwNYrijdSs7uf0tAe6WOyCsQ==", + "license": "MIT", + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/pg-numeric": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pg-numeric/-/pg-numeric-1.0.2.tgz", + "integrity": "sha512-BM/Thnrw5jm2kKLE5uJkXqqExRUY/toLHda65XgFTBTFYZyopbKjBe29Ii3RbkvlsMoFwD+tHeGaCjjv0gHlyw==", + "license": "ISC", + "engines": { + "node": ">=4" + } + }, + "node_modules/pg-pool": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.6.1.tgz", + "integrity": "sha512-jizsIzhkIitxCGfPRzJn1ZdcosIt3pz9Sh3V01fm1vZnbnCMgmGl5wvGGdNN2EL9Rmb0EcFoCkixH4Pu+sP9Og==", + "license": "MIT", + "peerDependencies": { + "pg": ">=8.0" + } + }, + "node_modules/pg-protocol": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.6.0.tgz", + "integrity": "sha512-M+PDm637OY5WM307051+bsDia5Xej6d9IR4GwJse1qA1DIhiKlksvrneZOYQq42OM+spubpcNYEo2FcKQrDk+Q==", + "license": "MIT" + }, + "node_modules/pg-types": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz", + "integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==", + "license": "MIT", + "dependencies": { + "pg-int8": "1.0.1", + "postgres-array": "~2.0.0", + "postgres-bytea": "~1.0.0", + "postgres-date": "~1.0.4", + "postgres-interval": "^1.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/pgpass": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.5.tgz", + "integrity": "sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==", + "license": "MIT", + "dependencies": { + "split2": "^4.1.0" + } + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/postgres-array": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz", + "integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/postgres-bytea": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz", + "integrity": "sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/postgres-date": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz", + "integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/postgres-interval": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz", + "integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==", + "license": "MIT", + "dependencies": { + "xtend": "^4.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/postgres-range": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/postgres-range/-/postgres-range-1.1.3.tgz", + "integrity": "sha512-VdlZoocy5lCP0c/t66xAfclglEapXPCIVhqqJRncYpvbCgImF0w67aPKfbqUMr72tO2k5q0TdTZwCLjPTI6C9g==", + "license": "MIT" + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "license": "MIT", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "license": "ISC" + }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", + "license": "ISC" + }, + "node_modules/split2": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", + "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", + "license": "ISC", + "engines": { + "node": ">= 10.x" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "license": "0BSD" + }, + "node_modules/which-module": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz", + "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==", + "license": "ISC" + }, + "node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "license": "MIT", + "engines": { + "node": ">=0.4" + } + }, + "node_modules/y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "license": "ISC" + }, + "node_modules/yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "license": "MIT", + "dependencies": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "license": "ISC", + "dependencies": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + }, + "engines": { + "node": ">=6" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..86e6dd1 --- /dev/null +++ b/package.json @@ -0,0 +1,12 @@ +{ + "name": "indexer", + "version": "1.0.0", + "scripts": { + "migrate": "graphile-migrate migrate", + "db-init": "graphile-migrate reset --erase" + }, + "license": "Apache-2.0", + "dependencies": { + "graphile-migrate": "^1.4.1" + } +}