File tree Expand file tree Collapse file tree
src/Migration/Destinations Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -90,12 +90,18 @@ class Appwrite extends Destination
9090
9191 public function setOverwrite (bool $ overwrite ): self
9292 {
93+ if ($ overwrite && $ this ->skip ) {
94+ throw new \InvalidArgumentException ('Cannot set both overwrite and skip to true. ' );
95+ }
9396 $ this ->overwrite = $ overwrite ;
9497 return $ this ;
9598 }
9699
97100 public function setSkip (bool $ skip ): self
98101 {
102+ if ($ skip && $ this ->overwrite ) {
103+ throw new \InvalidArgumentException ('Cannot set both skip and overwrite to true. ' );
104+ }
99105 $ this ->skip = $ skip ;
100106 return $ this ;
101107 }
@@ -1001,7 +1007,7 @@ protected function createRecord(Row $resource, bool $isLast): bool
10011007 $ this ->cache ->get ($ resource ->getName ())
10021008 );
10031009
1004- if ($ exists ) {
1010+ if ($ exists && ! $ this -> overwrite ) {
10051011 $ resource ->setStatus (
10061012 Resource::STATUS_SKIPPED ,
10071013 'Row has already been created '
You can’t perform that action at this time.
0 commit comments