From d5e27a1059003228d49e57a63bee50b76f680e46 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sat, 6 Apr 2019 09:18:50 -0700 Subject: [PATCH] Fixing travis ci build - Fixes #39 Travis Travis Travis Travis Travis Travis Travis Travis Travis Travis Travis --- .travis.yml | 11 +++-------- .../2019-03-30-212058_create_post_view/up.sql | 2 +- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index e3dac182..26410fef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,27 +1,22 @@ language: rust rust: - stable - - beta - - nightly matrix: allow_failures: - rust: nightly fast_finish: true -before_cache: - - cd server cache: cargo -services: - - postgresql before_script: - psql -c "create user rrr with password 'rrr' superuser;" -U postgres - psql -c 'create database rrr with owner rrr;' -U postgres before_install: - cd server script: - - cargo install diesel_cli --no-default-features --features postgres - - cargo build + - cargo install --force diesel_cli --no-default-features --features postgres - diesel migration run - cargo build --all - cargo test --all env: - DATABASE_URL=postgres://rrr:rrr@localhost/rrr +addons: + postgresql: "9.4" diff --git a/server/migrations/2019-03-30-212058_create_post_view/up.sql b/server/migrations/2019-03-30-212058_create_post_view/up.sql index 79084a47..95789c73 100644 --- a/server/migrations/2019-03-30-212058_create_post_view/up.sql +++ b/server/migrations/2019-03-30-212058_create_post_view/up.sql @@ -5,7 +5,7 @@ create or replace function hot_rank( returns integer as $$ begin -- hours_diff:=EXTRACT(EPOCH FROM (timezone('utc',now()) - published))/3600 - return 10000*sign(score)*log(1 + abs(score)) / power(((EXTRACT(EPOCH FROM (timezone('utc',now()) - published))/3600) + 2), 1.8); + return floor(10000*sign(score)*log(1 + abs(score)) / power(((EXTRACT(EPOCH FROM (timezone('utc',now()) - published))/3600) + 2), 1.8))::integer; end; $$ LANGUAGE plpgsql;