mirror of
https://github.com/openziti/zrok.git
synced 2025-06-13 13:26:46 +02:00
organizing sqlite3 stuff to support postgres (#46)
This commit is contained in:
parent
6148fe316d
commit
bc75b312bf
@ -1,6 +0,0 @@
|
|||||||
package sql
|
|
||||||
|
|
||||||
import "embed"
|
|
||||||
|
|
||||||
//go:embed *.sql
|
|
||||||
var Fs embed.FS
|
|
6
controller/store/sql/sqlite3/embed.go
Normal file
6
controller/store/sql/sqlite3/embed.go
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
package sqlite3_schema
|
||||||
|
|
||||||
|
import "embed"
|
||||||
|
|
||||||
|
//go:embed *.sql
|
||||||
|
var FS embed.FS
|
@ -5,7 +5,7 @@ import (
|
|||||||
"github.com/iancoleman/strcase"
|
"github.com/iancoleman/strcase"
|
||||||
"github.com/jmoiron/sqlx"
|
"github.com/jmoiron/sqlx"
|
||||||
_ "github.com/mattn/go-sqlite3"
|
_ "github.com/mattn/go-sqlite3"
|
||||||
"github.com/openziti-test-kitchen/zrok/controller/store/sql"
|
sqlite3_schema "github.com/openziti-test-kitchen/zrok/controller/store/sql/sqlite3"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
migrate "github.com/rubenv/sql-migrate"
|
migrate "github.com/rubenv/sql-migrate"
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
@ -52,7 +52,7 @@ func (self *Store) Close() error {
|
|||||||
|
|
||||||
func (self *Store) migrate() error {
|
func (self *Store) migrate() error {
|
||||||
migrations := &migrate.EmbedFileSystemMigrationSource{
|
migrations := &migrate.EmbedFileSystemMigrationSource{
|
||||||
FileSystem: sql.Fs,
|
FileSystem: sqlite3_schema.FS,
|
||||||
Root: "/",
|
Root: "/",
|
||||||
}
|
}
|
||||||
migrate.SetTable("migrations")
|
migrate.SetTable("migrations")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user