Skip to content

Commit df9b2ee

Browse files
committed
fix db migration
1 parent db9933b commit df9b2ee

File tree

3 files changed

+9
-13
lines changed

3 files changed

+9
-13
lines changed

cmd/mytoken-server/mytoken-migratedb/main.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,16 @@ import (
66
"strings"
77
"time"
88

9+
"github.com/zachmann/cli/v2"
10+
"golang.org/x/term"
11+
912
"github.com/oidc-mytoken/server/internal/config"
1013
"github.com/oidc-mytoken/server/internal/db"
1114
"github.com/oidc-mytoken/server/shared/utils/fileutil"
12-
"github.com/zachmann/cli/v2"
13-
"golang.org/x/term"
1415

15-
"github.com/oidc-mytoken/server/internal/model/version"
1616
log "github.com/sirupsen/logrus"
17+
18+
"github.com/oidc-mytoken/server/internal/model/version"
1719
)
1820

1921
var configFile string
@@ -48,7 +50,7 @@ var app = &cli.App{
4850
&cli.BoolFlag{
4951
Name: "force",
5052
Aliases: []string{"f"},
51-
Usage: "Force a complete database migration. Mytoken servers are not checked if they are compatible with the changes.",
53+
Usage: "Force a complete database migration. It is not checked if mytoken servers are compatible with the changes.",
5254
Destination: &force,
5355
HideDefaultValue: true,
5456
},

go.sum

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuy
5555
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
5656
github.com/andybalholm/brotli v1.0.0/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y=
5757
github.com/andybalholm/brotli v1.0.1/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y=
58-
github.com/andybalholm/brotli v1.0.2 h1:JKnhI/XQ75uFBTiuzXpzFrUriDPiZjlOSzh6wXogP0E=
5958
github.com/andybalholm/brotli v1.0.2/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y=
6059
github.com/andybalholm/brotli v1.0.3 h1:fpcw+r1N1h0Poc1F/pHbW40cUm/lMEQslZtCkBQ0UnM=
6160
github.com/andybalholm/brotli v1.0.3/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
@@ -166,12 +165,9 @@ github.com/goccy/go-json v0.7.4 h1:B44qRUFwz/vxPKPISQ1KhvzRi9kZ28RAf6YtjriBZ5k=
166165
github.com/goccy/go-json v0.7.4/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
167166
github.com/gofiber/fiber/v2 v2.2.2/go.mod h1:Aso7/M+EQOinVkWp4LUYjdlTpKTBoCk2Qo4djnMsyHE=
168167
github.com/gofiber/fiber/v2 v2.7.1/go.mod h1:f8BRRIMjMdRyt2qmJ/0Sea3j3rwwfufPrh9WNBRiVZ0=
169-
github.com/gofiber/fiber/v2 v2.14.0/go.mod h1:oZTLWqYnqpMMuF922SjGbsYZsdpE1MCfh416HNdweIM=
170168
github.com/gofiber/fiber/v2 v2.16.0 h1:Bly40vAh4qofpCoVYGLYC0TS9lNGNA1OVSPuzhIK7Q8=
171169
github.com/gofiber/fiber/v2 v2.16.0/go.mod h1:iftruuHGkRYGEXVISmdD7HTYWyfS2Bh+Dkfq4n/1Owg=
172170
github.com/gofiber/helmet/v2 v2.1.0/go.mod h1:BWTRxVM8ILkx7pv+xrRSnEZcMriqMbtywhqHsDCB98s=
173-
github.com/gofiber/helmet/v2 v2.1.7 h1:D9UhKjASJ0V/9wpciUMe9e1mh407XWsc/btdFSIbnG0=
174-
github.com/gofiber/helmet/v2 v2.1.7/go.mod h1:ZI5amrsoR4H0Ak4mMqJ/1+g6mwhOlcGRxHkx+vF4YYU=
175171
github.com/gofiber/helmet/v2 v2.2.0 h1:ZIJ+ypWcmq3i/GmZEdcH6DDutV5oi7WLi6klcU3hiD8=
176172
github.com/gofiber/helmet/v2 v2.2.0/go.mod h1:4/j07d1B2JRy+V7FfZSwQ9NMGERlwvJipZUgmscmGHA=
177173
github.com/gofiber/template v1.6.8/go.mod h1:9hx59OnW2CAO03HntVp44U9o5XWM5Ly1r0oIsQZQwsI=
@@ -334,7 +330,6 @@ github.com/klauspost/compress v1.10.5/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYs
334330
github.com/klauspost/compress v1.10.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
335331
github.com/klauspost/compress v1.11.8/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
336332
github.com/klauspost/compress v1.11.12/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
337-
github.com/klauspost/compress v1.12.2 h1:2KCfW3I9M7nSc5wOqXAlW2v2U6v+w6cbjvbfp+OykW8=
338333
github.com/klauspost/compress v1.12.2/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg=
339334
github.com/klauspost/compress v1.13.2 h1:YecVYiuZPySnUyT8Ar9d5VawPwybeQw9IcwsLfdfdEk=
340335
github.com/klauspost/compress v1.13.2/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg=
@@ -721,7 +716,6 @@ golang.org/x/sys v0.0.0-20210319071255-635bc2c9138d/go.mod h1:h1NjWce9XRLGQEsW7w
721716
golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
722717
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
723718
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
724-
golang.org/x/sys v0.0.0-20210514084401-e8d321eab015 h1:hZR0X1kPW+nwyJ9xRxqZk1vx5RUObAPBdKVvXPDUH/E=
725719
golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
726720
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c h1:F1jZWGFhYfh0Ci55sIpILtKKK8p3i2/krTr0H1rg74I=
727721
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=

internal/db/dbmigrate/v0.3.0.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ var v0_3_0_Before = []string{
1111
"ALTER TABLE AuthInfo ADD code_verifier varchar(128) NULL",
1212
"ALTER TABLE TransferCodesAttributes ADD max_token_len INT NULL",
1313
"CREATE OR REPLACE" +
14-
"ALGORITHM = UNDEFINED VIEW `mytoken_test`.`TransferCodes` AS" +
14+
"ALGORITHM = UNDEFINED VIEW `TransferCodes` AS" +
1515
"select" +
1616
"`pt`.`id` AS `id`," +
1717
"`pt`.`jwt` AS `jwt`," +
@@ -23,8 +23,8 @@ var v0_3_0_Before = []string{
2323
"`tca`.`max_token_len` AS `max_token_len`," +
2424
"`tca`.`consent_declined` AS `consent_declined`" +
2525
"from" +
26-
"(`mytoken_test`.`ProxyTokens` `pt`" +
27-
"join `mytoken_test`.`TransferCodesAttributes` `tca` on" +
26+
"(`ProxyTokens` `pt`" +
27+
"join `TransferCodesAttributes` `tca` on" +
2828
"(`pt`.`id` = `tca`.`id`))",
2929

3030
// Predefined Values

0 commit comments

Comments
 (0)