forked from cerc-io/ipld-eth-server
Update Travis to create a database from a schema
* We were running into issues getting migrate to work
This commit is contained in:
parent
6fec53d5a1
commit
f61b1bc96c
@ -1,15 +1,12 @@
|
|||||||
dist: trusty
|
dist: trusty
|
||||||
sudo: required
|
|
||||||
language: go
|
language: go
|
||||||
go:
|
go:
|
||||||
- 1.9
|
- 1.9
|
||||||
services:
|
services:
|
||||||
- postgresql
|
- postgresql
|
||||||
before_script:
|
before_script:
|
||||||
- go get -u -d github.com/mattes/migrate/cli github.com/lib/pq
|
- createdb vulcanize
|
||||||
- go build -tags 'postgres' -o /usr/local/bin/migrate github.com/mattes/migrate/cli
|
- psql vulcanize < migrations/schema.sql
|
||||||
- psql -c 'create database vulcanize;' -U postgres
|
|
||||||
- migrate -database 'postgresql://localhost:5432/vulcanize?sslmode=disable' -path ./migrations up
|
|
||||||
script:
|
script:
|
||||||
- go test -v ./core/...
|
- go test -v ./core/...
|
||||||
notifications:
|
notifications:
|
||||||
|
67
migrations/schema.sql
Normal file
67
migrations/schema.sql
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
--
|
||||||
|
-- PostgreSQL database dump
|
||||||
|
--
|
||||||
|
|
||||||
|
-- Dumped from database version 10.0
|
||||||
|
-- Dumped by pg_dump version 10.0
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: -
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: -
|
||||||
|
--
|
||||||
|
|
||||||
|
COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
|
||||||
|
|
||||||
|
|
||||||
|
SET search_path = public, pg_catalog;
|
||||||
|
|
||||||
|
SET default_tablespace = '';
|
||||||
|
|
||||||
|
SET default_with_oids = false;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: blocks; Type: TABLE; Schema: public; Owner: -
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE blocks (
|
||||||
|
block_number bigint
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: schema_migrations; Type: TABLE; Schema: public; Owner: -
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE schema_migrations (
|
||||||
|
version bigint NOT NULL,
|
||||||
|
dirty boolean NOT NULL
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: schema_migrations schema_migrations_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY schema_migrations
|
||||||
|
ADD CONSTRAINT schema_migrations_pkey PRIMARY KEY (version);
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- PostgreSQL database dump complete
|
||||||
|
--
|
||||||
|
|
2
scripts/dump_schema
Executable file
2
scripts/dump_schema
Executable file
@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
pg_dump -O -s vulcanize > migrations/schema.sql
|
Loading…
Reference in New Issue
Block a user