@@ -84,7 +84,7 @@ private void CloneSchemas(Catalog newCatalog, Catalog source, Dictionary<string,
8484 private void CloneAssertions ( Schema newSchema , Schema sourceSchema )
8585 {
8686 foreach ( var assertion in sourceSchema . Assertions ) {
87- var newAssertion = newSchema . CreateAssertion ( assertion . Name , ( SqlExpression ) assertion . Condition . Clone ( ) , assertion . IsDeferrable , assertion . IsInitiallyDeferred ) ;
87+ var newAssertion = newSchema . CreateAssertion ( assertion . Name , assertion . Condition . Clone ( ) , assertion . IsDeferrable , assertion . IsInitiallyDeferred ) ;
8888 CopyDbName ( newAssertion , assertion ) ;
8989 }
9090 }
@@ -113,9 +113,9 @@ private void CloneDomains(Schema newSchema, Schema sourceSchema, Dictionary<Coll
113113 if ( sourceDomain . Collation != null )
114114 newDomain . Collation = collationsMap [ sourceDomain . Collation ] ;
115115 if ( sourceDomain . DefaultValue != null )
116- newDomain . DefaultValue = ( SqlExpression ) sourceDomain . DefaultValue . Clone ( ) ;
116+ newDomain . DefaultValue = sourceDomain . DefaultValue . Clone ( ) ;
117117 foreach ( var domainConstraint in sourceDomain . DomainConstraints ) {
118- var newConstraint = newDomain . CreateConstraint ( domainConstraint . Name , ( SqlExpression ) domainConstraint . Condition . Clone ( ) ) ;
118+ var newConstraint = newDomain . CreateConstraint ( domainConstraint . Name , domainConstraint . Condition . Clone ( ) ) ;
119119 CopyDbName ( newConstraint , domainConstraint ) ;
120120 }
121121 }
@@ -181,7 +181,7 @@ private void CloneTableColumns(Table newTable, Table sourceTable, Dictionary<Col
181181 CopyDbName ( newColumn , sourceTableColumn ) ;
182182
183183 if ( sourceTableColumn . DefaultValue != null )
184- newColumn . DefaultValue = ( SqlExpression ) sourceTableColumn . DefaultValue . Clone ( ) ;
184+ newColumn . DefaultValue = sourceTableColumn . DefaultValue . Clone ( ) ;
185185
186186 var schema = newTable . Schema ;
187187 if ( sourceTableColumn . Collation != null ) {
@@ -196,7 +196,7 @@ private void CloneTableColumns(Table newTable, Table sourceTable, Dictionary<Col
196196 if ( sourceTableColumn . Domain != null )
197197 newColumn . Domain = schema . Domains [ sourceTableColumn . Domain . Name ] ;
198198 if ( sourceTableColumn . Expression != null )
199- newColumn . Expression = ( SqlExpression ) sourceTableColumn . Expression . Clone ( ) ;
199+ newColumn . Expression = sourceTableColumn . Expression . Clone ( ) ;
200200 newColumn . IsNullable = sourceTableColumn . IsNullable ;
201201 newColumn . IsPersisted = sourceTableColumn . IsPersisted ;
202202 if ( sourceTableColumn . SequenceDescriptor != null )
@@ -251,7 +251,7 @@ private void CloneIndex(DataTable newTable, Index sourceIndex)
251251 ft . IsUnique = ftIndex . IsUnique ;
252252 ft . UnderlyingUniqueIndex = ftIndex . UnderlyingUniqueIndex ;
253253 if ( ftIndex . Where != null )
254- ft . Where = ( SqlExpression ) ftIndex . Where . Clone ( ) ;
254+ ft . Where = ftIndex . Where . Clone ( ) ;
255255 ClonePartitionDescriptor ( ft , sourceIndex ) ;
256256 return ;
257257 }
@@ -269,7 +269,7 @@ private void CloneIndex(DataTable newTable, Index sourceIndex)
269269 spatial . IsClustered = spatialIndex . IsClustered ;
270270 spatial . IsUnique = spatialIndex . IsUnique ;
271271 if ( spatialIndex . Where != null )
272- spatial . Where = ( SqlExpression ) spatialIndex . Where . Clone ( ) ;
272+ spatial . Where = spatialIndex . Where . Clone ( ) ;
273273 ClonePartitionDescriptor ( spatialIndex , sourceIndex ) ;
274274 return ;
275275 }
@@ -283,7 +283,7 @@ private void CloneIndex(DataTable newTable, Index sourceIndex)
283283 index . IsUnique = sourceIndex . IsUnique ;
284284 index . IsClustered = sourceIndex . IsClustered ;
285285 if ( sourceIndex . Where != null )
286- index . Where = ( SqlExpression ) sourceIndex . Where . Clone ( ) ;
286+ index . Where = sourceIndex . Where . Clone ( ) ;
287287 index . NonkeyColumns . AddRange ( GetNonKeyColumns ( newTable , sourceIndex ) ) ;
288288 index . IsBitmap = sourceIndex . IsBitmap ;
289289 ClonePartitionDescriptor ( index , sourceIndex ) ;
@@ -319,7 +319,7 @@ private void CloneTableConstraint(Table newTable, TableConstraint sourceConstrai
319319 {
320320 var checkConstraint = sourceConstraint as CheckConstraint ;
321321 if ( checkConstraint != null ) {
322- var c = newTable . CreateCheckConstraint ( checkConstraint . Name , ( SqlExpression ) checkConstraint . Condition . Clone ( ) ) ;
322+ var c = newTable . CreateCheckConstraint ( checkConstraint . Name , checkConstraint . Condition . Clone ( ) ) ;
323323 CopyDbName ( c , checkConstraint ) ;
324324 return ;
325325 }
0 commit comments