Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Create extension as super user #751

Merged
merged 1 commit into from
Jul 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions examples/dao/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,7 @@ drop-sigma-dao-user:

# execute sigma dao setup file. Indexer should be running before executing this script
setup-sigma-dao:
# pg_trgm extension.
@psql -d $(POSTGRES_DBNAME) -c "CREATE EXTENSION IF NOT EXISTS pg_trgm;"
# execute file
@psql -U $(POSTGRES_UNAME) -d $(POSTGRES_DBNAME) -a -f $(SIGMA_DAO_SETUP_FILE)
4 changes: 1 addition & 3 deletions examples/dao/setup_sigma_dao.sql
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ CREATE TABLE IF NOT EXISTS sigma_dao_proposals (
-- Create indexes
CREATE UNIQUE INDEX sigma_daos_app_id_idx ON sigma_daos (app_id);
-- create an index to do efficient text search using `%<text>%`, it requires
-- pg_trgm extension.
CREATE EXTENSION pg_trgm;
CREATE INDEX sigma_daos_dao_name_idx ON sigma_daos USING gin (dao_name gin_trgm_ops);
CREATE INDEX sigma_daos_dao_name_idx ON sigma_daos USING gin (CAST(dao_name AS TEXT) gin_trgm_ops);

-- create a procedure to handle the trigger (sigmadao_trigger_fn) action
CREATE OR REPLACE FUNCTION sigmadao_trigger_fn()
Expand Down