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

Create a "setup" script #10

Closed
Shpigford opened this issue Jan 5, 2024 · 0 comments
Closed

Create a "setup" script #10

Shpigford opened this issue Jan 5, 2024 · 0 comments

Comments

@Shpigford
Copy link
Member

In an effort to make it as easy as possible to get up and running with Maybe, we should have a "setup" script to run.

I'm not attached to any specific method for that (and realistically don't have a lot of experience in this area), so open to suggestions.

The big things that need to happen are around database setup, specifically with rails db:setup and :migrate and then creating a read-only role.

After database setup, a read-only ai_user needs to be created:

CREATE ROLE ai_user WITH LOGIN PASSWORD 'YOUR_UNIQUE_PASSWORD';

GRANT SELECT ON balances TO ai_user;
GRANT SELECT ON accounts TO ai_user;
GRANT SELECT ON connections TO ai_user;
GRANT SELECT ON conversations TO ai_user;
GRANT SELECT ON holdings TO ai_user;
GRANT SELECT ON investment_transactions TO ai_user;
GRANT SELECT ON messages TO ai_user;
GRANT SELECT ON metrics TO ai_user;
GRANT SELECT ON securities TO ai_user;
GRANT SELECT ON security_prices TO ai_user;
GRANT SELECT ON transactions TO ai_user;

And then after that, READONLY_DATABASE_URL needs to be set to postgres://ai_user:YOUR_UNIQUE_PASSWORD@localhost/maybe_ai_development in the .env file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant