Skip to content

Code of Let’s Go Further book by Alex Edwards

Notifications You must be signed in to change notification settings

jrvldam/greenlight

Folders and files

NameName
Last commit message
Last commit date

Latest commit

592754d · Aug 20, 2023

History

76 Commits
Aug 20, 2023
Aug 13, 2023
Aug 13, 2023
Aug 20, 2023
Aug 20, 2023
Jul 17, 2023
Aug 20, 2023
Aug 20, 2023

Repository files navigation

greenlight

Code of Let’s Go Further book by Alex Edwards

Postgresql

Log in to database (first time):

docker exec -it postgresql-greenlight psql -U postgres

Create database:

CREATE DATABASE greenlight;

Connect to database:

\c greenlight

Create database user:

CREATE ROLE greenlight WITH LOGIN PASSWORD 'pa55word';

Add citext extension: Note: This adds a case-insensitive character string type to PostgreSQL.

CREATE EXTENSION IF NOT EXISTS citext;

Log in with new user:

docker exec -it postgresql-greenlight psql --host=localhost --dbname=greenlight --username=greenlight

Migrations

Install migration tool:

brew install golang-migrate

Grant privileges to user:

GRANT ALL ON SCHEMA public TO greenlight;

To run migrations:

migrate -path=./migrations -database="postgres://greenlight:pa55word@localhost/greenlight?sslmode=disable" up

About

Code of Let’s Go Further book by Alex Edwards

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published