7
7
use Utopia \Database \Exception as DatabaseException ;
8
8
use Utopia \Database \Exception \Authorization as AuthorizationException ;
9
9
use Utopia \Database \Exception \Conflict as ConflictException ;
10
+ use Utopia \Database \Exception \Dependency as DependencyException ;
10
11
use Utopia \Database \Exception \Duplicate as DuplicateException ;
11
12
use Utopia \Database \Exception \Limit as LimitException ;
12
13
use Utopia \Database \Exception \NotFound as NotFoundException ;
15
16
use Utopia \Database \Exception \Restricted as RestrictedException ;
16
17
use Utopia \Database \Exception \Structure as StructureException ;
17
18
use Utopia \Database \Exception \Timeout as TimeoutException ;
18
- use Utopia \Database \Exception \Dependency as DependencyException ;
19
19
use Utopia \Database \Helpers \ID ;
20
20
use Utopia \Database \Helpers \Permission ;
21
21
use Utopia \Database \Helpers \Role ;
@@ -2078,11 +2078,11 @@ public function renameAttribute(string $collection, string $old, string $new): b
2078
2078
$ attribute = new Document ();
2079
2079
2080
2080
foreach ($ attributes as $ value ) {
2081
- if ($ value ->getId () === $ old ){
2081
+ if ($ value ->getId () === $ old ) {
2082
2082
$ attribute = $ value ;
2083
2083
}
2084
2084
2085
- if ($ value ->getId () === $ new ){
2085
+ if ($ value ->getId () === $ new ) {
2086
2086
throw new DuplicateException ('Attribute name already used ' );
2087
2087
}
2088
2088
}
@@ -2098,10 +2098,10 @@ public function renameAttribute(string $collection, string $old, string $new): b
2098
2098
$ indexAttributes = $ index ->getAttribute ('attributes ' , []);
2099
2099
2100
2100
foreach ($ indexAttributes as $ key => $ indexAttribute ) {
2101
- if ($ indexAttribute === $ old ){
2102
- // if($attribute->getAttribute('array', false)){
2103
- // throw new DependencyException("Can't rename attribute because of functional index dependency must drop index first.");
2104
- // }
2101
+ if ($ indexAttribute === $ old ) {
2102
+ // if($attribute->getAttribute('array', false)){
2103
+ // throw new DependencyException("Can't rename attribute because of functional index dependency must drop index first.");
2104
+ // }
2105
2105
2106
2106
$ indexAttributes [$ key ] = $ new ;
2107
2107
}
0 commit comments