diff --git a/resources/sql/fixtures/user.sql b/resources/sql/fixtures/01-user.sql similarity index 100% rename from resources/sql/fixtures/user.sql rename to resources/sql/fixtures/01-user.sql diff --git a/resources/sql/fixtures/citizen.sql b/resources/sql/fixtures/02-citizen.sql similarity index 100% rename from resources/sql/fixtures/citizen.sql rename to resources/sql/fixtures/02-citizen.sql diff --git a/resources/sql/fixtures/workgroup.sql b/resources/sql/fixtures/03-workgroup.sql similarity index 100% rename from resources/sql/fixtures/workgroup.sql rename to resources/sql/fixtures/03-workgroup.sql diff --git a/resources/sql/fixtures/article.sql b/resources/sql/fixtures/04-article.sql similarity index 100% rename from resources/sql/fixtures/article.sql rename to resources/sql/fixtures/04-article.sql diff --git a/resources/sql/fixtures/constitution.sql b/resources/sql/fixtures/05-constitution.sql similarity index 100% rename from resources/sql/fixtures/constitution.sql rename to resources/sql/fixtures/05-constitution.sql diff --git a/resources/sql/fixtures/follow.sql b/resources/sql/fixtures/06-follow.sql similarity index 100% rename from resources/sql/fixtures/follow.sql rename to resources/sql/fixtures/06-follow.sql diff --git a/resources/sql/fixtures/comment.sql b/resources/sql/fixtures/07-comment.sql similarity index 100% rename from resources/sql/fixtures/comment.sql rename to resources/sql/fixtures/07-comment.sql diff --git a/resources/sql/fixtures/vote.sql b/resources/sql/fixtures/08-vote.sql similarity index 100% rename from resources/sql/fixtures/vote.sql rename to resources/sql/fixtures/08-vote.sql diff --git a/resources/sql/functions/helpers/random_between.sql b/resources/sql/functions/helpers/random_between.sql new file mode 100644 index 0000000..76e81dd --- /dev/null +++ b/resources/sql/functions/helpers/random_between.sql @@ -0,0 +1,7 @@ +CREATE OR REPLACE FUNCTION random_between(low INT ,high INT) + RETURNS INT AS +$$ +BEGIN + RETURN floor(random()* (high-low + 1) + low); +END; +$$ language 'plpgsql' STRICT; \ No newline at end of file