forked from MapComplete/MapComplete
Automate setting up a cache server
This commit is contained in:
parent
752266ee48
commit
6f85db291a
6 changed files with 297 additions and 123 deletions
16
scripts/osm2pgsql/deleteOldDbs.ts
Normal file
16
scripts/osm2pgsql/deleteOldDbs.ts
Normal file
|
@ -0,0 +1,16 @@
|
|||
import Script from "../Script"
|
||||
import { OsmPoiDatabase } from "./osmPoiDatabase"
|
||||
|
||||
class DeleteOldDbs extends Script {
|
||||
constructor() {
|
||||
super("Drops all but the newest `osm-poi.*`")
|
||||
}
|
||||
|
||||
async main(args: string[]): Promise<void> {
|
||||
const db = new OsmPoiDatabase("postgresql://user:password@localhost:5444")
|
||||
await db.deleteAllButLatest()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
new DeleteOldDbs().run()
|
Loading…
Add table
Add a link
Reference in a new issue