Skip to content

🕹️ My personal sandbox built with Next.js, Tailwind CSS, and Vercel.

License

Notifications You must be signed in to change notification settings

dataroche/dataroc.ca

 
 

Repository files navigation

dataroc.ca

Database initialization

Outside of migrations, a basic initialization of the postgres database is required. Replace passwords with generated random hashes:

CREATE USER dataroc_admin WITH ENCRYPTED PASSWORD 'my-password';

GRANT ALL ON SCHEMA public TO dataroc_admin;

CREATE DATABASE dataroc;
GRANT ALL PRIVILEGES ON DATABASE dataroc TO admin;
GRANT ALL PRIVILEGES ON DATABASE dataroc TO dataroc_admin;

CREATE DATABASE dataroc_shadow;
GRANT ALL PRIVILEGES ON DATABASE dataroc_shadow TO admin;
GRANT ALL PRIVILEGES ON DATABASE dataroc_shadow TO dataroc_admin;

DROP ROLE IF EXISTS authenticator;
CREATE ROLE authenticator LOGIN NOINHERIT NOCREATEDB NOCREATEROLE NOSUPERUSER;
ALTER USER authenticator PASSWORD 'my-authenticator-password';

Then, connect to the dataroc database and create the anonymous user for PostgREST:

\c dataroc
CREATE ROLE api_anon nologin;
GRANT api_anon TO authenticator;

CREATE ROLE api_data_producer nologin;
GRANT api_data_producer TO authenticator;

About

🕹️ My personal sandbox built with Next.js, Tailwind CSS, and Vercel.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • MDX 56.5%
  • TypeScript 27.4%
  • Python 6.3%
  • JavaScript 5.6%
  • CSS 3.5%
  • Makefile 0.5%
  • Dockerfile 0.2%