@@ -18,8 +18,6 @@ import (
18
18
"github.com/supabase/cli/internal/db/lint"
19
19
"github.com/supabase/cli/internal/db/pull"
20
20
"github.com/supabase/cli/internal/db/push"
21
- "github.com/supabase/cli/internal/db/remote/changes"
22
- "github.com/supabase/cli/internal/db/remote/commit"
23
21
"github.com/supabase/cli/internal/db/reset"
24
22
"github.com/supabase/cli/internal/db/start"
25
23
"github.com/supabase/cli/internal/db/test"
@@ -175,7 +173,7 @@ var (
175
173
Short : "Show changes on the remote database" ,
176
174
Long : "Show changes on the remote database since last migration." ,
177
175
RunE : func (cmd * cobra.Command , args []string ) error {
178
- return changes .Run (cmd .Context (), schema , flags .DbConfig , afero .NewOsFs ())
176
+ return diff .Run (cmd .Context (), schema , file , flags .DbConfig , diff . DiffSchemaMigra , afero .NewOsFs ())
179
177
},
180
178
}
181
179
@@ -184,7 +182,7 @@ var (
184
182
Use : "commit" ,
185
183
Short : "Commit remote changes as a new migration" ,
186
184
RunE : func (cmd * cobra.Command , args []string ) error {
187
- return commit .Run (cmd .Context (), schema , flags .DbConfig , afero .NewOsFs ())
185
+ return pull .Run (cmd .Context (), schema , flags .DbConfig , "remote_commit" , afero .NewOsFs ())
188
186
},
189
187
}
190
188
@@ -304,10 +302,12 @@ func init() {
304
302
dbCmd .AddCommand (dbPullCmd )
305
303
// Build remote command
306
304
remoteFlags := dbRemoteCmd .PersistentFlags ()
305
+ remoteFlags .StringSliceVarP (& schema , "schema" , "s" , []string {}, "Comma separated list of schema to include." )
307
306
remoteFlags .String ("db-url" , "" , "Connect using the specified Postgres URL (must be percent-encoded)." )
307
+ remoteFlags .Bool ("linked" , true , "Connect to the linked project." )
308
+ dbRemoteCmd .MarkFlagsMutuallyExclusive ("db-url" , "linked" )
308
309
remoteFlags .StringVarP (& dbPassword , "password" , "p" , "" , "Password to your remote Postgres database." )
309
310
cobra .CheckErr (viper .BindPFlag ("DB_PASSWORD" , remoteFlags .Lookup ("password" )))
310
- remoteFlags .StringSliceVarP (& schema , "schema" , "s" , []string {}, "Comma separated list of schema to include." )
311
311
dbRemoteCmd .AddCommand (dbRemoteChangesCmd )
312
312
dbRemoteCmd .AddCommand (dbRemoteCommitCmd )
313
313
dbCmd .AddCommand (dbRemoteCmd )
0 commit comments