Skip to content

Commit

Permalink
Merge branch 'main' of github.com:openaq/openaq-db
Browse files Browse the repository at this point in the history
  • Loading branch information
caparker committed Aug 23, 2024
2 parents 7c6a753 + d3caa53 commit 91c461d
Show file tree
Hide file tree
Showing 25 changed files with 2,495 additions and 607 deletions.
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM postgis/postgis:14-3.4 as pg
FROM postgis/postgis:16-3.4 as pg

LABEL maintainer="OpenAQ"

# defaults that may be overwritten by env
ENV POSTGIS_MAJOR 3
ENV POSTGRESQL_MAJOR 14
ENV POSTGRESQL_MAJOR 16
ENV PGUSER postgres
ENV PGDATABASE postgres
ENV PGHOST localhost
Expand All @@ -24,6 +24,7 @@ EXPOSE 5432
# Docker image will automatically run scripts in `/docker-entrypoint-initdb.d`
RUN mkdir -p /docker-entrypoint-initdb.d \
&& echo "#!/bin/bash" >/docker-entrypoint-initdb.d/001_initdb.sh \
&& echo "/openaqdb/init.sh" >> /docker-entrypoint-initdb.d/001_initdb.sh
&& echo "/openaqdb/init.sh" >> /docker-entrypoint-initdb.d/001_initdb.sh \
&& echo "/openaqdb/mock.sh" >> /docker-entrypoint-initdb.d/001_initdb.sh

WORKDIR /openaqdb
2 changes: 1 addition & 1 deletion migra/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ REMOTE_DATABASE_URL=postgresql://user:pwd@host:port/openaq
```

```sh
ENV=docker python3 compare.py
DOTENV=.env.docker python3 compare.py
```

## Notes
Expand Down
2 changes: 1 addition & 1 deletion migra/compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
m.add_all_changes(privileges=False)

sql = m.sql.encode('utf8')
with open(f'migra/patches/patch_{today}_chk.sql', 'w') as f:
with open(f'migra/patches/patch_{today}.sql', 'w') as f:
for statement in m.statements:
f.write(f"----------------\n{statement}\n")
Loading

0 comments on commit 91c461d

Please sign in to comment.