Skip to content

Prototype Go based service for managing TTRPG games

Notifications You must be signed in to change notification settings

SomethingSexy/chronicle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Untitled TTRPG discord bot service thingie

For now setting this up as monorepo of services but might only have one.

.devcontainer

See https://github.com/qdm12/godevcontainer/tree/master

DB

Go Definitions

sqlc generate

Migration Scripts

https://atlasgo.io/versioned/intro

Inspect database

atlas schema inspect -u "postgres://postgres:postgres@db:5432/chronicle?sslmode=disable"

Inspect schema

atlas schema inspect -u "postgres://postgres:postgres@db:5432/chronicle?search_path=public&sslmode=disable"

atlas schema apply \
  -u "postgres://postgres:postgres@db:5432/chronicle?sslmode=disable" \
  --to file://schema.sql \
  --dev-url "postgres://postgres:postgres@db:5432/chronicle?sslmode=disable"

Initialize

atlas migrate diff initial \
  --to file://schema.sql \
  --dev-url "postgres://postgres:postgres@db:5432/chronicle?sslmode=disable" \
  --format '{{ sql . "  " }}'

Update schema

atlas migrate diff add_commits \
  --to file://schema.sql \
  --dev-url "postgres://postgres:postgres@db:5432/chronicle?sslmode=disable" \
  --format '{{ sql . "  " }}'

Run all migrations on a new database

atlas migrate apply \
  --url "postgres://postgres:postgres@db:5432/chronicle?sslmode=disable"  \
  --dir "file://migrations"

Migrate from a baseline, the baseline will be ignored

atlas migrate apply \
  --url "postgres://postgres:postgres@db:5432/chronicle?sslmode=disable"  \
  --dir "file://migrations" \
  --baseline "20240731025606"

Using the free version of Atlas, we need to manually add extensions.

Right now we are adding them to the root migration (probably should make this a separate first migration).

Need to run the following after manually adding extensions.

atlas migrate hash

About

Prototype Go based service for managing TTRPG games

Resources

Stars

Watchers

Forks

Packages