Skip to content

Commit

Permalink
Issue #178
Browse files Browse the repository at this point in the history
ADD:
  - build/postgres_create.sql Updating script to create the `white_torrents`
    table.
  • Loading branch information
Ianleeclark committed Dec 18, 2016
1 parent d551fb3 commit 90b9961
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 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,9 +24,3 @@ $$ 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 90b9961

Please sign in to comment.