Skip to content

mhdiiilham/gosm

Repository files navigation

GOSM

Go Report Card
Deployment
Semantic Release

Database Migration

How to Create a New Migration

To create a new database migration file, follow these steps:

  1. Ensure golang-migrate is installed.
  2. Run the following Makefile command:
    make migrate-create
  3. This will generate a new migration file in the database/migrations/ directory.
  4. Edit the generated migration file to define the required schema changes.

After creating the migration, apply it by running:

How to Migrate the Database Schema

Follow these steps to apply database migrations:

  1. Install golang-migrate by following the instructions at golang-migrate/migrate.
  2. Set the environment variable DATABASE_URL with your database connection string.
  3. Run the following Makefile command to apply the migrations:
    make migrate-up

About

A guest management system that is written in Go.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages