iver-wharf / wharf-api

Wharf backend written in Go
MIT License
1 stars 0 forks source link

Added Gormigrate #144

Closed applejag closed 2 years ago

applejag commented 2 years ago

Summary

Motivation

Adding the Gormigrate was simple enough. I've just stuck our entire previous migration code into migrations_old.go instead of trying to translate it to Gormigrate.

There was one major caveat: Gormigrate needed a higher version of GORM, which required updating the database drivers. The Sqlite database driver has a bug where it creates invalid SQL if the table name and column name is the same. Therefore I have renamed the database column token.token to token.value.

The response.Token is left untouched. The JSON response still uses a field named "token"

Closes #135