You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To install the latest version of pgstac on an empty database, you can directly load the primary source code.
25
25
```
26
26
psql -f pgstac.sql
@@ -33,20 +33,20 @@ For each new version of PGStac, two migrations should be added to pypgstac/pypgs
33
33
- pgstac.[version].sql (equivalent to `cat sql/*.sql > migration.sql && echo "insert into migrations (versions) VALUES ('[version]')" >> migration.sql)
34
34
- pgstac.[version].[fromversion].sql (Migration to move from existing version to new version, can be created by hand or using the makemigration.sh tool below)
35
35
36
-
## Running Migrations
36
+
###Running Migrations
37
37
Migrations can be installed by either directly running the appropriate migration sql file for from and target PGStac versions:
To create a migration from a previous version of pgstac you can calculate the migration from the running instance of pgstac using the makemigration.sh command. This will use docker to copy the schema of the existing database and the new sql into new docker databases and create/test the migration between the two.
A python utility is included which allows to load data from any source openable by smart-open using python in a memory efficient streaming manner using PostgreSQL copy. There are options for collections and items and can be used either as a command line or a library.
51
51
52
52
To load an ndjson of items directly using copy (will fail on any duplicate ids but is the fastest option to load new data you know will not conflict)
@@ -63,3 +63,41 @@ To upsert any records, adding anything new and replacing anything with the same
63
63
```
64
64
pypgstac load items --method upsert
65
65
```
66
+
67
+
## Development
68
+
69
+
PGStac uses a dockerized development environment. You can set this up using:
70
+
71
+
```bash
72
+
scripts/setup
73
+
```
74
+
75
+
To bring up the development database:
76
+
```
77
+
scripts/server
78
+
```
79
+
80
+
To run tests, use:
81
+
```bash
82
+
scripts/test
83
+
```
84
+
85
+
To rebuild docker images:
86
+
```bash
87
+
scripts/update
88
+
```
89
+
90
+
To drop into a console, use
91
+
```bash
92
+
scripts/console
93
+
```
94
+
95
+
To drop into a psql console on the database container, use:
96
+
```bash
97
+
scripts/console --db
98
+
```
99
+
100
+
To run migrations on the development database, use
0 commit comments