Skip to content

Commit

Permalink
sql: Resolve beta.9 -> rc.1 migration issue (#1186)
Browse files Browse the repository at this point in the history
Closes #1185

Signed-off-by: aeneasr <[email protected]>
  • Loading branch information
aeneasr authored Nov 21, 2018
1 parent 8352d84 commit 1295663
Show file tree
Hide file tree
Showing 12 changed files with 31 additions and 32 deletions.
6 changes: 3 additions & 3 deletions client/manager_sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ import (
"github.com/ory/x/sqlcon"
)

var Migrations = map[string]*migrate.PackrMigrationSource{
dbal.DriverMySQL: dbal.NewMustPackerMigrationSource(logrus.New(), AssetNames(), Asset, []string{"migrations/sql/shared", "migrations/sql/mysql"}),
dbal.DriverPostgreSQL: dbal.NewMustPackerMigrationSource(logrus.New(), AssetNames(), Asset, []string{"migrations/sql/shared", "migrations/sql/postgres"}),
var Migrations = map[string]*dbal.PackrMigrationSource{
dbal.DriverMySQL: dbal.NewMustPackerMigrationSource(logrus.New(), AssetNames(), Asset, []string{"migrations/sql/shared", "migrations/sql/mysql"}, true),
dbal.DriverPostgreSQL: dbal.NewMustPackerMigrationSource(logrus.New(), AssetNames(), Asset, []string{"migrations/sql/shared", "migrations/sql/postgres"}, true),
}

func NewSQLManager(db *sqlx.DB, h fosite.Hasher) *SQLManager {
Expand Down
7 changes: 3 additions & 4 deletions client/x_manager_sql_migrations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import (
"testing"

"github.com/jmoiron/sqlx"
migrate "github.com/rubenv/sql-migrate"
"github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand All @@ -36,9 +35,9 @@ import (
"github.com/ory/x/dbal/migratest"
)

var createMigrations = map[string]*migrate.PackrMigrationSource{
dbal.DriverMySQL: dbal.NewMustPackerMigrationSource(logrus.New(), AssetNames(), Asset, []string{"migrations/sql/tests"}),
dbal.DriverPostgreSQL: dbal.NewMustPackerMigrationSource(logrus.New(), AssetNames(), Asset, []string{"migrations/sql/tests"}),
var createMigrations = map[string]*dbal.PackrMigrationSource{
dbal.DriverMySQL: dbal.NewMustPackerMigrationSource(logrus.New(), AssetNames(), Asset, []string{"migrations/sql/tests"}, true),
dbal.DriverPostgreSQL: dbal.NewMustPackerMigrationSource(logrus.New(), AssetNames(), Asset, []string{"migrations/sql/tests"}, true),
}

func CleanTestDB(t *testing.T, db *sqlx.DB) {
Expand Down
7 changes: 3 additions & 4 deletions consent/sql_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,22 @@ import (
"time"

"github.com/pkg/errors"
"github.com/rubenv/sql-migrate"
"github.com/sirupsen/logrus"

"github.com/ory/go-convenience/stringsx"
"github.com/ory/hydra/client"
"github.com/ory/x/dbal"
)

var Migrations = map[string]*migrate.PackrMigrationSource{
var Migrations = map[string]*dbal.PackrMigrationSource{
"mysql": dbal.NewMustPackerMigrationSource(logrus.New(), AssetNames(), Asset, []string{
"migrations/sql/shared",
"migrations/sql/mysql",
}),
}, true),
"postgres": dbal.NewMustPackerMigrationSource(logrus.New(), AssetNames(), Asset, []string{
"migrations/sql/shared",
"migrations/sql/postgres",
}),
}, true),
}

var sqlParamsAuthenticationRequestHandled = []string{
Expand Down
7 changes: 3 additions & 4 deletions consent/x_manager_sql_migrations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"testing"

"github.com/jmoiron/sqlx"
migrate "github.com/rubenv/sql-migrate"
"github.com/sirupsen/logrus"
"github.com/stretchr/testify/require"

Expand All @@ -17,9 +16,9 @@ import (
"github.com/ory/x/dbal/migratest"
)

var createMigrations = map[string]*migrate.PackrMigrationSource{
dbal.DriverMySQL: dbal.NewMustPackerMigrationSource(logrus.New(), consent.AssetNames(), consent.Asset, []string{"migrations/sql/tests"}),
dbal.DriverPostgreSQL: dbal.NewMustPackerMigrationSource(logrus.New(), consent.AssetNames(), consent.Asset, []string{"migrations/sql/tests"}),
var createMigrations = map[string]*dbal.PackrMigrationSource{
dbal.DriverMySQL: dbal.NewMustPackerMigrationSource(logrus.New(), consent.AssetNames(), consent.Asset, []string{"migrations/sql/tests"}, true),
dbal.DriverPostgreSQL: dbal.NewMustPackerMigrationSource(logrus.New(), consent.AssetNames(), consent.Asset, []string{"migrations/sql/tests"}, true),
}

func cleanDB(t *testing.T, db *sqlx.DB) {
Expand Down
2 changes: 1 addition & 1 deletion docker-compose-twoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ services:
consent:
environment:
- HYDRA_ADMIN_URL=http://hydra-admin:4445
image: oryd/hydra-login-consent-node:v1.0.0-beta.9
image: oryd/hydra-login-consent-node:v1.0.0-rc.2
links:
- hydra-admin
ports:
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ services:
consent:
environment:
- HYDRA_ADMIN_URL=http://hydra:4445
image: oryd/hydra-login-consent-node:v1.0.0-beta.9
image: oryd/hydra-login-consent-node:v1.0.0-rc.2
links:
- hydra
ports:
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ require (
github.com/ory/graceful v0.1.0
github.com/ory/herodot v0.4.1
github.com/ory/sqlcon v0.0.7
github.com/ory/x v0.0.30
github.com/ory/x v0.0.32
github.com/pborman/uuid v1.2.0
github.com/phayes/freeport v0.0.0-20171002181615-b8543db493a5
github.com/pkg/errors v0.8.0
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,10 @@ github.com/ory/x v0.0.29 h1:rpKMq1/QeY5UcXBXjzKs1DugWj1SRBB692mCEgxR7u8=
github.com/ory/x v0.0.29/go.mod h1:ARp3iXjJhOEErlXHwUtfgVtEN1VnmW1ZxBZ0bw8eARk=
github.com/ory/x v0.0.30 h1:pfbgmGEkuy+k4I8VAOnFlTpsiFTBHhpv/rAUvhBHgJ0=
github.com/ory/x v0.0.30/go.mod h1:4hnvHBE1KfoPP99R82BH72s3UnHt//MmWX+5NYnfzFQ=
github.com/ory/x v0.0.31 h1:aDO76m7b5wUu5wfZQ8dHzWGV0qHxgAzUFfRIpkB+XFw=
github.com/ory/x v0.0.31/go.mod h1:4hnvHBE1KfoPP99R82BH72s3UnHt//MmWX+5NYnfzFQ=
github.com/ory/x v0.0.32 h1:fgxawi8zaB/WODqNcIukSsBfq5C64s2Xh7sOEjUuHhc=
github.com/ory/x v0.0.32/go.mod h1:4hnvHBE1KfoPP99R82BH72s3UnHt//MmWX+5NYnfzFQ=
github.com/parnurzeal/gorequest v0.2.15/go.mod h1:3Kh2QUMJoqw3icWAecsyzkpY7UzRfDhbRdTjtNwNiUE=
github.com/pborman/uuid v1.2.0 h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g=
github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
Expand Down
6 changes: 3 additions & 3 deletions jwk/manager_sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ func NewSQLManager(db *sqlx.DB, key []byte) *SQLManager {
return &SQLManager{DB: db, Cipher: &AEAD{Key: key}}
}

var migrations = map[string]*migrate.PackrMigrationSource{
var migrations = map[string]*dbal.PackrMigrationSource{
dbal.DriverMySQL: dbal.NewMustPackerMigrationSource(logrus.New(), AssetNames(), Asset, []string{
"migrations/sql/shared",
"migrations/sql/mysql",
}),
}, true),
dbal.DriverPostgreSQL: dbal.NewMustPackerMigrationSource(logrus.New(), AssetNames(), Asset, []string{
"migrations/sql/shared",
"migrations/sql/postgres",
}),
}, true),
}

type sqlData struct {
Expand Down
7 changes: 3 additions & 4 deletions jwk/x_manager_sql_migrations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import (
"testing"

"github.com/jmoiron/sqlx"
migrate "github.com/rubenv/sql-migrate"
"github.com/sirupsen/logrus"
"github.com/stretchr/testify/require"

Expand All @@ -35,9 +34,9 @@ import (
"github.com/ory/x/dbal/migratest"
)

var createMigrations = map[string]*migrate.PackrMigrationSource{
dbal.DriverMySQL: dbal.NewMustPackerMigrationSource(logrus.New(), AssetNames(), Asset, []string{"migrations/sql/tests"}),
dbal.DriverPostgreSQL: dbal.NewMustPackerMigrationSource(logrus.New(), AssetNames(), Asset, []string{"migrations/sql/tests"}),
var createMigrations = map[string]*dbal.PackrMigrationSource{
dbal.DriverMySQL: dbal.NewMustPackerMigrationSource(logrus.New(), AssetNames(), Asset, []string{"migrations/sql/tests"}, true),
dbal.DriverPostgreSQL: dbal.NewMustPackerMigrationSource(logrus.New(), AssetNames(), Asset, []string{"migrations/sql/tests"}, true),
}

func TestXXMigrations(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions oauth2/fosite_store_sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,15 @@ const (
sqlTablePKCE = "pkce"
)

var Migrations = map[string]*migrate.PackrMigrationSource{
var Migrations = map[string]*dbal.PackrMigrationSource{
dbal.DriverMySQL: dbal.NewMustPackerMigrationSource(logrus.New(), AssetNames(), Asset, []string{
"migrations/sql/shared",
"migrations/sql/mysql",
}),
}, true),
dbal.DriverPostgreSQL: dbal.NewMustPackerMigrationSource(logrus.New(), AssetNames(), Asset, []string{
"migrations/sql/shared",
"migrations/sql/postgres",
}),
}, true),
}

var sqlParams = []string{
Expand Down
7 changes: 3 additions & 4 deletions oauth2/x_fosite_migrations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"time"

"github.com/jmoiron/sqlx"
migrate "github.com/rubenv/sql-migrate"
"github.com/sirupsen/logrus"
"github.com/stretchr/testify/require"

Expand All @@ -19,9 +18,9 @@ import (
"github.com/ory/x/dbal/migratest"
)

var createMigrations = map[string]*migrate.PackrMigrationSource{
dbal.DriverMySQL: dbal.NewMustPackerMigrationSource(logrus.New(), oauth2.AssetNames(), oauth2.Asset, []string{"migrations/sql/tests"}),
dbal.DriverPostgreSQL: dbal.NewMustPackerMigrationSource(logrus.New(), oauth2.AssetNames(), oauth2.Asset, []string{"migrations/sql/tests"}),
var createMigrations = map[string]*dbal.PackrMigrationSource{
dbal.DriverMySQL: dbal.NewMustPackerMigrationSource(logrus.New(), oauth2.AssetNames(), oauth2.Asset, []string{"migrations/sql/tests"}, true),
dbal.DriverPostgreSQL: dbal.NewMustPackerMigrationSource(logrus.New(), oauth2.AssetNames(), oauth2.Asset, []string{"migrations/sql/tests"}, true),
}

func cleanDB(t *testing.T, db *sqlx.DB) {
Expand Down

0 comments on commit 1295663

Please sign in to comment.