feat: organizations and API keys

This commit is contained in:
2023-04-27 07:09:10 +02:00
parent 504f40902e
commit 554a6c252f
22 changed files with 2469 additions and 199 deletions
+13
View File
@@ -1,7 +1,10 @@
package store
import (
"embed"
"github.com/jmoiron/sqlx"
"github.com/pressly/goose/v3"
)
func SetupDB(driverName, url string) (*sqlx.DB, error) {
@@ -25,3 +28,13 @@ func SetupDB(driverName, url string) (*sqlx.DB, error) {
//
// return goose.Up(db.DB, "migrations")
//}
//go:embed event_store_migrations/*.sql
var embedEventStoreMigrations embed.FS
func RunEventStoreMigrations(db *sqlx.DB) error {
goose.SetTableName("goose_db_version_event")
goose.SetBaseFS(embedEventStoreMigrations)
return goose.Up(db.DB, "event_store_migrations")
}