Skip to content

Commit 062c649

Browse files
authored
Merge pull request #109 from UW-Macrostrat/migration-updates
Migration updates
2 parents 5679c16 + 6922dde commit 062c649

File tree

22 files changed

+50724
-48343
lines changed

22 files changed

+50724
-48343
lines changed

.idea/dataSources.xml

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,13 @@ caching and harmonization).
1414

1515
## Installation
1616

17-
To install the Python application that controls Macrostrat, head to the
18-
[py-root](py-root) directory. Running `make` will install the Python
19-
dependencies and build the application.
17+
- Running `make` will install the Python dependencies and build the application.
18+
- `make test` will run the test suite.
19+
- `make install` will install the application into the local root.
20+
21+
Setting the `MACROSTRAT_PYROOT` environment variable allows a different root
22+
Python version to be installed. This can be used to add new plugins
23+
or application dependencies.
2024

2125
## Usage
2226

@@ -74,3 +78,4 @@ Documentation is a work in progress. We have starting points for:
7478

7579
Other documentation of general interest can be found in the [docs/](docs/)
7680
directory.
81+

base-images/database/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Database container for local development
21
FROM imresamu/postgis:15-3.4
2+
RUN apt-get update && apt-get install -y --no-install-recommends \
3+
postgresql-15-pgaudit
34

4-
# TODO: add extensions
5-
RUN echo "Hello from database container!"
5+
CMD docker-entrypoint.sh postgres -c shared_preload_libraries=pgaudit

bin/macrostrat

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export PATH="$VIRTUAL_ENV/bin:$PATH"
6262
# Set the poetry root directory to the script directory
6363
if [ "$1" = "poetry" ]; then
6464
shift
65-
$_poetry "$@"
65+
$_poetry --directory "$SCRIPT_DIR" "$@"
6666
exit $?
6767
fi
6868

@@ -85,9 +85,13 @@ if [ "$1" = "install" ]; then
8585
fi
8686
$SUDO rm -f "$install_loc"
8787
$SUDO ln -sf "$this_file" "$install_loc"
88+
else
89+
echo -e "Macrostrat command already available at at \033[36m$install_loc\033[0m"
90+
echo -e ""
8891
fi
8992

9093
shift
94+
$_poetry --directory "$SCRIPT_DIR" lock "$@"
9195
$_poetry --directory "$SCRIPT_DIR" install "$@"
9296
exit $?
9397
fi

cli/macrostrat/cli/database/migrations/api_v3/09-ingest-process.sql

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
11
CREATE SCHEMA IF NOT EXISTS maps_metadata;
22

3-
CREATE TYPE ingest_state AS ENUM ('pending', 'ingested', 'prepared', 'failed', 'abandoned', 'post_harmonization');
4-
CREATE TYPE ingest_type AS ENUM ('vector', 'ta1_output');
3+
CREATE TYPE maps.ingest_state AS ENUM (
4+
'pending',
5+
'ingested',
6+
'prepared',
7+
'failed',
8+
'abandoned',
9+
'post_harmonization'
10+
);
11+
12+
CREATE TYPE maps.ingest_type AS ENUM (
13+
'vector',
14+
'ta1_output'
15+
);
516

617
CREATE TABLE maps_metadata.ingest_process
718
(
819
id serial primary key,
9-
state ingest_state,
10-
type ingest_type,
20+
state maps.ingest_state,
21+
type maps.ingest_type,
1122
comments text,
1223
source_id integer
1324
references maps.sources,
@@ -20,13 +31,9 @@ CREATE TABLE maps_metadata.ingest_process
2031
map_id text
2132
);
2233

23-
ALTER TABLE maps_metadata.ingest_process
24-
owner to macrostrat;
2534

2635
CREATE TABLE maps_metadata.ingest_process_tag (
2736
ingest_process_id integer NOT NULL
2837
references maps_metadata.ingest_process,
2938
tag character varying(255) NOT NULL
3039
);
31-
32-
ALTER TABLE maps_metadata.ingest_process_tag OWNER TO macrostrat;

0 commit comments

Comments
 (0)