blog

module
v0.0.0-...-7c5da1f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 12, 2023 License: MIT

README

Description

Blog source code

Running locally

Start database

docker compose up -d

Install migrate CLI

make install_golang_migrate

Migrate database

make db_migrate
make db_test_migrate

Run tests

make test

Start the project locally

make run

Migrations

Create migration

make generate_migration name=migration_name

Run migrations on dev database

make db_migrate

Run migrations on test database

make db_test_migrate

Run migration on a custom database

make db_migrate db_url='DATABASE_URL'

Rollback 1 migration on dev database

make db_rollback

Rollback 1 migration on test database

make db_test_rollback

Rollback 1 migration on a custom database

make db_rollback db_url='DATABASE_URL'

Force migration version on dev database

In case there is a migration error and you receive the message Dirty database version 20211109080746. Fix and force version.. You can fix it by running the following command. Be sure to pass the previous version and not the one specified in the error.

make db_force version=20211108120029

Force migration version on test database

make db_test_force version=20211108120029

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL