Migrate to postgres from sqlite
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -2,3 +2,4 @@ data
|
||||
sqlite-latest.sqlite
|
||||
*.log
|
||||
*.dmp
|
||||
postgres_data
|
||||
|
||||
21
README.md
21
README.md
@@ -5,8 +5,21 @@ The idea is to find "an algos that died in faction warfare having at least 2 rem
|
||||
|
||||
## Data
|
||||
|
||||
One half of the data is the eve static dump coming from [fuzzworks](https://www.fuzzwork.co.uk/dump/)<br>
|
||||
And the other half are the dumps from [everef](https://data.everef.net/killmails/)
|
||||
One half of the data is the eve static dump coming from [fuzzworks](https://www.fuzzwork.co.uk/dump/) specifically the [postgres dump](https://www.fuzzwork.co.uk/dump/postgres-schema-latest.dmp.bz2)<br>
|
||||
The other half are the dumps from [everef](https://data.everef.net/killmails/)
|
||||
|
||||
Static dump is to be extracted into the project root<br>
|
||||
And the killmails are to be put into data in their .tar.bz2 format
|
||||
Killmails are to be put into data in their .tar.bz2 format
|
||||
|
||||
## Database Import
|
||||
|
||||
The PostgreSQL database dump comes in the form of a `.dmp` file. The database must be empty prior to import.
|
||||
|
||||
To import the database dump:
|
||||
|
||||
1. Ensure PostgreSQL is running (e.g., via `docker-compose up -d`)
|
||||
2. Ensure the target database exists and is empty
|
||||
3. Import the dump using `pg_restore` from the host machine:
|
||||
|
||||
```bash
|
||||
docker-compose exec -T db pg_restore -U postgres -d zkill -v < postgres-schema-latest.dmp
|
||||
```
|
||||
|
||||
11
docker-compose.yml
Normal file
11
docker-compose.yml
Normal file
@@ -0,0 +1,11 @@
|
||||
services:
|
||||
db:
|
||||
image: postgres:17
|
||||
environment:
|
||||
- POSTGRES_USER=postgres
|
||||
- POSTGRES_PASSWORD=postgres
|
||||
- POSTGRES_DB=postgres
|
||||
ports:
|
||||
- "5432:5432"
|
||||
volumes:
|
||||
- ./postgres_data:/var/lib/postgresql/data
|
||||
Reference in New Issue
Block a user