updated the foundation readme, and the postgis readme to further explain another solution to the postgis testing error when we aren't superuser

This commit is contained in:
ronny abraham 2023-07-04 03:16:08 +03:00
parent 45ba1ac426
commit 6e807d07a2
2 changed files with 32 additions and 1 deletions

View file

@ -114,6 +114,18 @@ create a new template
## installing via foundation-sites
npm install foundation-sites
# Alternate way of loading Foundation
install foundation-sites
link to foundation-sites parent directory
ln -s /pathto/node_modules/foundation-sites /pathto/sass/foundation-sites
inside the sass file import foundation as
@import foundation-sites/scss

View file

@ -14,4 +14,23 @@ use [docker-postgis](https://github.com/kartoza/docker-postgis)
now the admin can run the tests
`sudo docker exec -it minyanfinder_development_db bash`
`sudo docker exec -it minyanfinder_development_db bash`
#### another more elegant solution to the problem
[create extension without superuser role](https://stackoverflow.com/questions/16527806/cannot-create-extension-without-superuser-role)
[potential problem if it's not working](https://stackoverflow.com/questions/39556719/django-test-error-creating-the-test-database-permission-denied-to-copy-databas)
createdb template_postgis; # create a new database
psql -U postgres -c "UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template_postgis';" # make it a template psql -U postpsql -U postgres -d template_postgis -c "CREATE EXTENSION postgis;" # install postgis in it
example:
createdb -h localhost -p 49032 -U admin template_postgis
psql -h localhost -p 49032 -U admin minyanfinder_dev -c "UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template_postgis';"
psql -h localhost -p 49032 -U admin -d template_gis -c "CREATE EXTENSION postgis;"
in local settings file:
DATABASES['default']['TEST'] = dict()
DATABASES['default']['TEST']['TEMPLATE'] = 'template_postgis'