This commit is contained in:
parent
00791344e6
commit
d81c2cb739
|
|
@ -0,0 +1,7 @@
|
|||
#!/bin/sh
|
||||
|
||||
DB=${1:-netbox}
|
||||
|
||||
# Drop and re-create the database locally
|
||||
sudo -u postgres psql -c "drop database $DB"
|
||||
sudo -u postgres psql -c "create database $DB"
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
#!/bin/sh
|
||||
|
||||
DB=${2:-netbox}
|
||||
|
||||
# Drop and re-create the database locally
|
||||
sudo -u postgres psql -c "DROP DATABASE $DB"
|
||||
sudo -u postgres psql -c "CREATE DATABASE $DB"
|
||||
sudo -u postgres psql -c "GRANT CREATE ON DATABASE $DB TO $DB"
|
||||
|
||||
# Load tables from the production dump
|
||||
sudo -u postgres psql $DB < $1
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
#!/bin/sh
|
||||
|
||||
DB=${2:-netbox}
|
||||
|
||||
# Dump the database to a file
|
||||
sudo -u postgres pg_dump $DB > $1
|
||||
|
||||
Loading…
Reference in New Issue