@@ -19,17 +19,11 @@ import (
19
19
"github.com/supabase/cli/pkg/api"
20
20
"github.com/supabase/cli/pkg/cast"
21
21
cliConfig "github.com/supabase/cli/pkg/config"
22
- "github.com/supabase/cli/pkg/diff"
23
22
"github.com/supabase/cli/pkg/migration"
24
23
)
25
24
26
25
func Run (ctx context.Context , projectRef string , fsys afero.Fs , options ... func (* pgx.ConnConfig )) error {
27
- copy := utils .Config .Clone ()
28
- original , err := cliConfig .ToTomlBytes (copy )
29
- if err != nil {
30
- fmt .Fprintln (utils .GetDebugLogger (), err )
31
- }
32
-
26
+ majorVersion := utils .Config .Db .MajorVersion
33
27
if err := checkRemoteProjectStatus (ctx , projectRef , fsys ); err != nil {
34
28
return err
35
29
}
@@ -54,14 +48,12 @@ func Run(ctx context.Context, projectRef string, fsys afero.Fs, options ...func(
54
48
fmt .Fprintln (os .Stdout , "Finished " + utils .Aqua ("supabase link" )+ "." )
55
49
56
50
// 4. Suggest config update
57
- updated , err := cliConfig .ToTomlBytes (utils .Config .Clone ())
58
- if err != nil {
59
- fmt .Fprintln (utils .GetDebugLogger (), err )
60
- }
61
-
62
- if lineDiff := diff .Diff (utils .ConfigPath , original , projectRef , updated ); len (lineDiff ) > 0 {
63
- fmt .Fprintln (os .Stderr , utils .Yellow ("WARNING:" ), "Local config differs from linked project. Try updating" , utils .Bold (utils .ConfigPath ))
64
- fmt .Println (string (lineDiff ))
51
+ if utils .Config .Db .MajorVersion != majorVersion {
52
+ fmt .Fprintln (os .Stderr , utils .Yellow ("WARNING:" ), "Local database version differs from the linked project." )
53
+ fmt .Fprintf (os .Stderr , `Update your %s to fix it:
54
+ [db]
55
+ major_version = %d
56
+ ` , utils .Bold (utils .ConfigPath ), utils .Config .Db .MajorVersion )
65
57
}
66
58
return nil
67
59
}
0 commit comments