Skip to content

Commit

Permalink
Issue #178
Browse files Browse the repository at this point in the history
CHANGE
  - .travis.yml now uses an input file rather than `<` the .sql file.
  • Loading branch information
Ianleeclark committed Dec 18, 2016
1 parent bc23c12 commit d551fb3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ before_script:
- mysql -h localhost -u root --password='' < ./build/schema_create.sql
- psql -c "create database testdb;" -U postgres
- psql -c "ALTER USER postgres PASSWORD 'postgres';" -U postgres
- psql -U postgres < build/postgres_create.sql
- psql -U postgres -d testdb -f build/postgres_create.sql
- go get ./...
- go get gopkg.in/redis.v3
- if ! go get github.com/golang/tools/cmd/cover; then go get golang.org/x/tools/cmd/cover; fi
Expand Down
20 changes: 13 additions & 7 deletions build/postgres_create.sql
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
CREATE TABLE white_torrents
(
info_hash TEXT,
name TEXT NOT NULL,
added_by TEXT,
date_added BIGINT
);
-- CREATE TABLE white_torrents
-- (
-- info_hash TEXT,
-- name TEXT NOT NULL,
-- added_by TEXT,
-- date_added BIGINT
-- );

CREATE OR REPLACE FUNCTION new_torrent_added() RETURNS TRIGGER AS $$
BEGIN
Expand All @@ -24,3 +24,9 @@ $$ LANGUAGE plpgsql;

DROP TRIGGER IF EXISTS new_torrent_added ON white_torrents;
CREATE TRIGGER new_torrent_added BEFORE INSERT ON white_torrents FOR EACH ROW EXECUTE PROCEDURE new_torrent_added();

DO language plpgsql $$
BEGIN
RAISE NOTICE 'Executed succesfully!';
END
$$;

0 comments on commit d551fb3

Please sign in to comment.