Skip to content

Commit

Permalink
Merge pull request #22 from rafaelpezzuto/fix-v2-procedures
Browse files Browse the repository at this point in the history
Corrige procedures v2 e melhora instruções de uso
  • Loading branch information
rafaelpezzuto authored Jan 6, 2022
2 parents 1504a22 + c8e4641 commit 56f5dec
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 9 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,18 @@ SciELO SUSHI API
## Instalation and Running
_Build_
```shell script
docker build --tag scielo-sushi-api:latest .
docker build . --tag scieloorg/scielo-sushi-api:0.5
```

_Run_
```
docker run -d -p 6543:6543 --name scielo-sushi-api --env MARIADB_STRING_CONNECTION="mysql://user:pass@localhost:port/database" --env APPLICATION_URL="http://127.0.0.1:6543" scielo-sushi-api
docker run -d \
-p 6543:6543 \
--name scielo-sushi-api \
--env MARIADB_STRING_CONNECTION="mysql://user:pass@localhost:port/database" \
--env APPLICATION_URL="http://127.0.0.1:6543" \
scieloorg/scielo-sushi-api \
pserve /app/config.ini
```

## Routes
Expand Down
28 changes: 22 additions & 6 deletions api/static/sql/procedures.sql
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,10 @@ BEGIN
) AS T
JOIN counter_journal cj ON cj.id = T.journalID
JOIN counter_journal_collection cjc ON cj.id = cjc.idjournal_jc
WHERE cjc.collection = collection;
WHERE cjc.collection = collection
ORDER BY
journalID ASC,
beginDate ASC;
END $$
DELIMITER ;

Expand Down Expand Up @@ -452,7 +455,10 @@ BEGIN
) AS T
JOIN counter_journal cj ON cj.id = T.journalID
JOIN counter_journal_collection cjc ON cj.id = cjc.idjournal_jc
WHERE cjc.collection = collection;
WHERE cjc.collection = collection
ORDER BY
journalID ASC,
yearMonth ASC;
END $$
DELIMITER ;

Expand Down Expand Up @@ -490,7 +496,10 @@ BEGIN
) AS T
JOIN counter_journal cj ON cj.id = T.journalID
JOIN counter_journal_collection cjc ON cj.id = cjc.idjournal_jc
WHERE cjc.collection = collection;
WHERE cjc.collection = collection
ORDER BY
journalID ASC,
beginDate ASC;
END $$
DELIMITER ;

Expand Down Expand Up @@ -531,7 +540,10 @@ BEGIN
) AS T
JOIN counter_journal cj ON cj.id = T.journalID
JOIN counter_journal_collection cjc ON cj.id = cjc.idjournal_jc
WHERE cjc.collection = collection;
WHERE cjc.collection = collection
ORDER BY
journalID ASC,
yearMonth ASC;
END $$
DELIMITER ;

Expand All @@ -548,7 +560,9 @@ BEGIN
WHERE
(sjm.collection in (collection , collection_extra)) AND
(year_month_day between beginDate AND endDate) AND
(cj.online_issn <> '' OR cj.print_issn <> '');
(cj.online_issn <> '' OR cj.print_issn <> '')
ORDER BY
beginDate ASC;
END $$
DELIMITER ;

Expand All @@ -568,6 +582,8 @@ BEGIN
(year_month_day between beginDate AND endDate) AND
(online_issn <> '' OR print_issn <> '')
GROUP BY
yearMonth;
yearMonth
ORDER BY
yearMonth ASC;
END $$
DELIMITER ;
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

setup(
name='scielo-sushiapi',
version='0.5',
version='0.5.1',
packages=find_packages(
exclude=["*.tests", "*.tests.*", "tests.*", "tests", "docs"]
),
Expand Down

0 comments on commit 56f5dec

Please sign in to comment.