diff --git a/tests/db/pgsql-init.sql b/tests/db/pgsql-init.sql index 86d11696..5c7496bf 100644 --- a/tests/db/pgsql-init.sql +++ b/tests/db/pgsql-init.sql @@ -120,38 +120,6 @@ CREATE TABLE "photos" CONSTRAINT "photos_album_id" FOREIGN KEY ("album_id") REFERENCES "photo_albums" ("id") ON DELETE CASCADE ON UPDATE CASCADE ); -CREATE TABLE "user_stats_x" ( - "user_id" int NOT NULL, - "date" TIMESTAMPTZ NOT NULL, - "value" int NOT NULL, - PRIMARY KEY("user_id", "date"), - CONSTRAINT "user_stats_x_user_id" FOREIGN KEY ("user_id") REFERENCES "users" ("id") ON DELETE CASCADE ON UPDATE CASCADE -); - - -CREATE TABLE "users_x_users" ( - "my_friends_id" int NOT NULL, - "friends_with_me_id" int NOT NULL, - PRIMARY KEY ("my_friends_id", "friends_with_me_id"), - CONSTRAINT "my_friends_key" FOREIGN KEY ("my_friends_id") REFERENCES "users" ("id") ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT "friends_with_me_key" FOREIGN KEY ("friends_with_me_id") REFERENCES "users" ("id") ON DELETE CASCADE ON UPDATE CASCADE -); - - -CREATE FUNCTION "book_collections_before"() RETURNS TRIGGER AS $BODY$BEGIN -NEW."updated_at" = NOW(); -return NEW; -END; -$BODY$ -LANGUAGE 'plpgsql' VOLATILE; - -CREATE TRIGGER "book_collections_before_insert_trigger" BEFORE INSERT ON "book_collections" -FOR EACH ROW EXECUTE PROCEDURE "book_collections_before"(); - -CREATE TRIGGER "book_collections_before_update_trigger" BEFORE UPDATE ON "book_collections" -FOR EACH ROW EXECUTE PROCEDURE "book_collections_before"(); - - CREATE TABLE "photo_albums" ( "id" serial4 NOT NULL, "title" varchar(255) NOT NULL,