openauth

command module
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

README

OpenAuth

Migrations Basic Commands

Create a new migration
migrate create -ext sql -dir resources/migrations/postgresql -seq create_users_table

This creates two files:

  • 000001_create_users_table.up.sql - Forward migration
  • 000001_create_users_table.down.sql - Rollback migration
Run migrations
Rollback migrations
Check migration status

Troubleshooting

Dirty Database State

If you encounter the error: Dirty database version X. Fix and force version.

This means a migration failed partway through. Here's how to fix it:

  1. Investigate the failed migration: Note down the migration no which is failed and fix the migration files.

  2. Manually inspect your database:

    • Connect to your database
    • Check what changes were partially applied
    • Look for incomplete tables, indexes, or constraints
  3. Clean up the database manually:

    • Remove any partially created objects
    • Ensure the database is in a consistent state
  4. Force set the version:

    • update .yml file ForceVersion: version_numer
    • update .yml file Action: force
    • run the migration
       make migrate
    
  5. Fix the problematic migration and retry:

    # Edit the migration file
    vim migrations/000010_problematic_migration.up.sql
    
    # Run migrations again
    - update .yml file Action: up
    
     make migrate
    

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
api
openauth_v1
Package openauth_v1 is a reverse proxy.
Package openauth_v1 is a reverse proxy.
cmd
internal
pkg

Jump to

Keyboard shortcuts

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