Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql: Resolve beta.9 -> rc.1 migration issue #1186

Merged
merged 3 commits into from
Nov 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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