forked from ddev/ddev-contrib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PostgreSQL commands: changed from
pgsql-db
directory to import-db
…
… to avoid messing with git index (ddev#184)
- Loading branch information
Showing
4 changed files
with
8 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
docker-compose-services/postgres/commands/postgres/pgsql_export
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#!/bin/bash | ||
|
||
## Description: Dump the postgresql database to .ddev/pgsql-db/postgresql.db.sql | ||
## Description: Dump the postgresql database to .ddev/import-db/postgresql.db.sql | ||
## Usage: pgsql_export | ||
## Example: ddev pgsql_export | ||
|
||
mkdir -p /mnt/ddev_config/import-db && chmod 777 /mnt/ddev_config/import-db && su postgres -c "pg_dump db --username=db --host=localhost --port=5432 --column-inserts > /mnt/ddev_config/pgsql-db/postgresql.db.sql" | ||
mkdir -p /mnt/ddev_config/import-db && chmod 777 /mnt/ddev_config/import-db && su postgres -c "pg_dump db --username=db --host=localhost --port=5432 --column-inserts > /mnt/ddev_config/import-db/postgresql.db.sql" |
4 changes: 2 additions & 2 deletions
4
docker-compose-services/postgres/commands/postgres/pgsql_import
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
#!/bin/bash | ||
|
||
## Description: Load to an empty postgresql database from .ddev/pgsql-db/postgresql.db.sql | ||
## Description: Load to an empty postgresql database from .ddev/import-db/postgresql.db.sql | ||
## Usage: pgsql_import | ||
## Example: ddev pgsql_import | ||
|
||
# First drop all tables. | ||
su postgres -c "psql -U db -c 'DROP SCHEMA public CASCADE; CREATE SCHEMA public; GRANT ALL ON SCHEMA public TO db; GRANT ALL ON SCHEMA public TO public;'" | ||
|
||
# Import via user postgres to avoid credentials prompt | ||
su postgres -c "psql -U db db < /mnt/ddev_config/pgsql-db/postgresql.db.sql" | ||
su postgres -c "psql -U db db < /mnt/ddev_config/import-db/postgresql.db.sql" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters