Skip to content

Commit

Permalink
RevEng: Swap out type alias with actual store type in DatabaseModelFa…
Browse files Browse the repository at this point in the history
…ctory

Reacting to dotnet/efcore#13293
  • Loading branch information
roji committed Oct 18, 2018
1 parent d094c16 commit 7b7378e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,7 @@ nspname NOT IN ('pg_catalog', 'information_schema') AND
else
{
// This is a domain type
column.StoreType = formattedTypeName;
column.SetUnderlyingStoreType(AdjustFormattedTypeName(formattedBaseTypeName));
column.StoreType = formattedBaseTypeName;
systemTypeName = record.GetValueOrDefault<string>("basetypname");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -649,16 +649,13 @@ char_domain public.char_domain NULL
dbModel =>
{
var textDomainColumn = Assert.Single(dbModel.Tables.Single().Columns.Where(c => c.Name == "text_domain"));
Assert.Equal("text_domain", textDomainColumn.StoreType);
Assert.Equal("text", textDomainColumn.GetUnderlyingStoreType());
Assert.Equal("text", textDomainColumn.StoreType);

var charDomainColumn = Assert.Single(dbModel.Tables.Single().Columns.Where(c => c.Name == "char_domain"));
Assert.Equal("char_domain", charDomainColumn.StoreType);
Assert.Equal("character(3)", charDomainColumn.GetUnderlyingStoreType());
Assert.Equal("character(3)", charDomainColumn.StoreType);

var nonDomainColumn = Assert.Single(dbModel.Tables.Single().Columns.Where(c => c.Name == "id"));
Assert.Equal("integer", nonDomainColumn.StoreType);
Assert.Null(nonDomainColumn.GetUnderlyingStoreType());
},
@"
DROP TABLE domains;
Expand Down

0 comments on commit 7b7378e

Please sign in to comment.