Migrate to postgres from sqlite

This commit is contained in:
2026-01-05 12:27:38 +01:00
parent 595759466a
commit b540b7924f
3 changed files with 29 additions and 4 deletions

1
.gitignore vendored
View File

@@ -2,3 +2,4 @@ data
sqlite-latest.sqlite
*.log
*.dmp
postgres_data

View File

@@ -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
View 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