Skip to content

Commit 1fac3f6

Browse files
committed
Sakila sql tests: dropping veiws fixed
1 parent 48fcdca commit 1fac3f6

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Orm/Xtensive.Orm.Tests.Sql/MySQL/Sakila.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// Copyright (C) 2003-2010 Xtensive LLC.
2-
// All rights reserved.
3-
// For conditions of distribution and use, see license.
1+
// Copyright (C) 2011-2022 Xtensive LLC.
2+
// This code is distributed under MIT license terms.
3+
// See the License.txt file in the project root for more information.
44
// Created by: Malisa Ncube
55
// Created: 2011.03.17
66

@@ -464,7 +464,9 @@ private void DropAllTables(Schema schema, bool extractCatalogAfterDropping)
464464
batch.Add(SqlDdl.Alter(foreignKey.Table, SqlDdl.DropConstraint(foreignKey)));
465465
foreach (var view in schema.Views) {
466466
batch.Add(SqlDdl.Drop(view));
467-
schema.Tables.Remove(schema.Tables[view.Name]);
467+
if (schema.Tables[view.Name] != null) {
468+
_ = schema.Tables.Remove(schema.Tables[view.Name]);
469+
}
468470
}
469471
foreach (var table in schema.Tables)
470472
batch.Add(SqlDdl.Drop(table));

0 commit comments

Comments
 (0)