Skip to content

Commit

Permalink
fix psql
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Aug 14, 2017
1 parent c4c0772 commit de750af
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 15 deletions.
2 changes: 0 additions & 2 deletions .ci/travis/linux/docker-build-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ ccache -z

cd /root/QGIS

sleep 20

printf "[qgis_test]\nhost=postgres\nport=5432\ndbname=docker\nuser=docker\npassword=docker" > ~/.pg_service.conf
export PGUSER=docker
export PGHOST=postgres
Expand Down
4 changes: 3 additions & 1 deletion tests/testdata/provider/testdata_pg.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/sh

set -e

SCRIPTS="
tests/testdata/provider/testdata_pg.sql
tests/testdata/provider/testdata_pg_reltests.sql
Expand All @@ -12,5 +14,5 @@ SCRIPTS="
dropdb qgis_test 2> /dev/null || true
createdb qgis_test || exit 1
for f in ${SCRIPTS}; do
psql -q -f $f qgis_test --set ON_ERROR_STOP=1 || exit 1
psql --echo-errors -f $f qgis_test -v ON_ERROR_STOP=1
done
7 changes: 4 additions & 3 deletions tests/testdata/provider/testdata_pg.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
--

--
-- PostgreSQL database dump
--

Expand Down Expand Up @@ -30,7 +31,7 @@ SET default_with_oids = false;

--
-- TOC entry 171 (class 1259 OID 377761)
-- Name: someData; Type: TABLE; Schema: qgis_test; Owner: postgres; Tablespace:
-- Name: someData; Type: TABLE; Schema: qgis_test; Owner: postgres; Tablespace:
--

CREATE TABLE qgis_test."someData" (
Expand Down Expand Up @@ -92,7 +93,7 @@ INSERT INTO qgis_test."someDataCompound" ( key1, key2, pk, cnt, name, name2, num

--
-- TOC entry 3953 (class 2606 OID 377768)
-- Name: someData_pkey; Type: CONSTRAINT; Schema: qgis_test; Owner: postgres; Tablespace:
-- Name: someData_pkey; Type: CONSTRAINT; Schema: qgis_test; Owner: postgres; Tablespace:
--

ALTER TABLE ONLY qgis_test."someData"
Expand Down
4 changes: 2 additions & 2 deletions tests/testdata/provider/testdata_pg_array.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
DROP TABLE IF EXISTS qgis_test.string_array;

DROP TABLE IF EXISTS qgis_test.string_array;

CREATE TABLE qgis_test.string_array
(
Expand Down Expand Up @@ -34,4 +35,3 @@ CREATE TABLE qgis_test.double_array
INSERT INTO qgis_test.double_array(value)
VALUES
('{1.1,2,-5.12345}');

3 changes: 2 additions & 1 deletion tests/testdata/provider/testdata_pg_hstore.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
CREATE EXTENSION IF NOT EXISTS hstore;

CREATE EXTENSION IF NOT EXISTS hstore;

DROP TABLE IF EXISTS qgis_test.dict;

Expand Down
9 changes: 5 additions & 4 deletions tests/testdata/provider/testdata_pg_reltests.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
-- Table: qgis_test.authors

-- Table: qgis_test.authors

DROP TABLE IF EXISTS qgis_test.books_authors;
DROP TABLE IF EXISTS qgis_test.authors;
Expand Down Expand Up @@ -40,7 +41,7 @@ CREATE TABLE qgis_test.books_authors
);

INSERT INTO qgis_test.authors(name)
VALUES
VALUES
('Erich Gamma'),
('Richard Helm'),
('Ralph Johnson'),
Expand All @@ -50,11 +51,11 @@ INSERT INTO qgis_test.authors(name)
('Gabriel García Márquez');

INSERT INTO qgis_test.books(name)
VALUES
VALUES
('Design Patterns. Elements of Reusable Object-Oriented Software');

INSERT INTO qgis_test.books_authors(fk_book, fk_author)
VALUES
VALUES
(1, 1),
(1, 2),
(1, 3),
Expand Down
2 changes: 0 additions & 2 deletions tests/testdata/provider/testdata_pg_vectorjoin.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

--CREATE SCHEMA IF NOT EXISTS qgis_test;


Expand Down Expand Up @@ -34,4 +33,3 @@ CREATE TABLE qgis_test.table_x
value_x2 integer,
CONSTRAINT table_x_pkey PRIMARY KEY (id_x)
);

0 comments on commit de750af

Please sign in to comment.