Skip to content

Commit

Permalink
Merge branch 'hotfix/1.1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
roji committed Jul 25, 2017
2 parents 67a924c + 31c5713 commit a3132b9
Show file tree
Hide file tree
Showing 47 changed files with 405 additions and 1,225 deletions.
26 changes: 26 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,29 @@ indent_style = space
indent_size = 4
; trim_trailing_whitespace = true
insert_final_newline = true

[*.cs]
dotnet_style_qualification_for_field = false:error
dotnet_style_qualification_for_property = false:error
dotnet_style_qualification_for_method = false:error
dotnet_style_qualification_for_event = false:error
dotnet_style_predefined_type_for_locals_parameters_members = true:error
dotnet_style_predefined_type_for_member_access = true:error
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_coalesce_expression = true:suggestion
csharp_style_var_for_built_in_types = true:error
csharp_style_var_when_type_is_apparent = true:error
csharp_style_var_elsewhere = true:suggestion
csharp_style_expression_bodied_methods = true:suggestion
csharp_style_expression_bodied_constructors = true:suggestion
csharp_style_expression_bodied_operators = true:suggestion
csharp_style_expression_bodied_properties = true:suggestion
csharp_style_expression_bodied_indexers = true:suggestion
csharp_style_expression_bodied_accessors = true:suggestion
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
csharp_style_inlined_variable_declaration = true:suggestion
csharp_style_throw_expression = true:suggestion
csharp_style_conditional_delegate_call = true:suggestion
114 changes: 0 additions & 114 deletions Npgsql.EntityFrameworkCore.PostgreSQL-xproj.sln

This file was deleted.

29 changes: 26 additions & 3 deletions Npgsql.EntityFrameworkCore.PostgreSQL.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25123.0
# Visual Studio 15
VisualStudioVersion = 15.0.26206.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{4A5A60DD-41B6-40BF-B677-227A921ECCC8}"
ProjectSection(SolutionItems) = preProject
Expand All @@ -26,29 +25,53 @@ EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{FADDA2D1-03B4-4DEF-8D24-DD1CA4E81F4A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FADDA2D1-03B4-4DEF-8D24-DD1CA4E81F4A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FADDA2D1-03B4-4DEF-8D24-DD1CA4E81F4A}.Debug|x64.ActiveCfg = Debug|Any CPU
{FADDA2D1-03B4-4DEF-8D24-DD1CA4E81F4A}.Debug|x86.ActiveCfg = Debug|Any CPU
{FADDA2D1-03B4-4DEF-8D24-DD1CA4E81F4A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FADDA2D1-03B4-4DEF-8D24-DD1CA4E81F4A}.Release|Any CPU.Build.0 = Release|Any CPU
{FADDA2D1-03B4-4DEF-8D24-DD1CA4E81F4A}.Release|x64.ActiveCfg = Release|Any CPU
{FADDA2D1-03B4-4DEF-8D24-DD1CA4E81F4A}.Release|x86.ActiveCfg = Release|Any CPU
{8EDCED17-2D1D-45BE-9B61-0F715876DA94}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8EDCED17-2D1D-45BE-9B61-0F715876DA94}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8EDCED17-2D1D-45BE-9B61-0F715876DA94}.Debug|x64.ActiveCfg = Debug|Any CPU
{8EDCED17-2D1D-45BE-9B61-0F715876DA94}.Debug|x86.ActiveCfg = Debug|Any CPU
{8EDCED17-2D1D-45BE-9B61-0F715876DA94}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8EDCED17-2D1D-45BE-9B61-0F715876DA94}.Release|Any CPU.Build.0 = Release|Any CPU
{8EDCED17-2D1D-45BE-9B61-0F715876DA94}.Release|x64.ActiveCfg = Release|Any CPU
{8EDCED17-2D1D-45BE-9B61-0F715876DA94}.Release|x86.ActiveCfg = Release|Any CPU
{E1D99AD4-D88B-42BA-86DF-90B98B2E9A01}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E1D99AD4-D88B-42BA-86DF-90B98B2E9A01}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E1D99AD4-D88B-42BA-86DF-90B98B2E9A01}.Debug|x64.ActiveCfg = Debug|Any CPU
{E1D99AD4-D88B-42BA-86DF-90B98B2E9A01}.Debug|x86.ActiveCfg = Debug|Any CPU
{E1D99AD4-D88B-42BA-86DF-90B98B2E9A01}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E1D99AD4-D88B-42BA-86DF-90B98B2E9A01}.Release|Any CPU.Build.0 = Release|Any CPU
{E1D99AD4-D88B-42BA-86DF-90B98B2E9A01}.Release|x64.ActiveCfg = Release|Any CPU
{E1D99AD4-D88B-42BA-86DF-90B98B2E9A01}.Release|x86.ActiveCfg = Release|Any CPU
{05A7D0B7-4AE1-4BC8-A1BE-2389F1593B2D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{05A7D0B7-4AE1-4BC8-A1BE-2389F1593B2D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{05A7D0B7-4AE1-4BC8-A1BE-2389F1593B2D}.Debug|x64.ActiveCfg = Debug|Any CPU
{05A7D0B7-4AE1-4BC8-A1BE-2389F1593B2D}.Debug|x86.ActiveCfg = Debug|Any CPU
{05A7D0B7-4AE1-4BC8-A1BE-2389F1593B2D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{05A7D0B7-4AE1-4BC8-A1BE-2389F1593B2D}.Release|Any CPU.Build.0 = Release|Any CPU
{05A7D0B7-4AE1-4BC8-A1BE-2389F1593B2D}.Release|x64.ActiveCfg = Release|Any CPU
{05A7D0B7-4AE1-4BC8-A1BE-2389F1593B2D}.Release|x86.ActiveCfg = Release|Any CPU
{1410D291-C519-4E74-AE3D-6BC6C4A7C1DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1410D291-C519-4E74-AE3D-6BC6C4A7C1DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1410D291-C519-4E74-AE3D-6BC6C4A7C1DC}.Debug|x64.ActiveCfg = Debug|Any CPU
{1410D291-C519-4E74-AE3D-6BC6C4A7C1DC}.Debug|x86.ActiveCfg = Debug|Any CPU
{1410D291-C519-4E74-AE3D-6BC6C4A7C1DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1410D291-C519-4E74-AE3D-6BC6C4A7C1DC}.Release|Any CPU.Build.0 = Release|Any CPU
{1410D291-C519-4E74-AE3D-6BC6C4A7C1DC}.Release|x64.ActiveCfg = Release|Any CPU
{1410D291-C519-4E74-AE3D-6BC6C4A7C1DC}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Empty file modified bump.sh
100644 → 100755
Empty file.
6 changes: 0 additions & 6 deletions global.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,13 @@ public DatabaseModel Create(DbConnection connection, TableSelectionSet tableSele
GetIndexes();
GetConstraints();
GetSequences();

// We may have dropped columns. We load these because constraints take them into
// account when referencing columns, but must now get rid of them before returning
// the database model.
foreach (var table in _databaseModel.Tables)
while (table.Columns.Remove(null)) {}

return _databaseModel;
}
finally
Expand Down Expand Up @@ -148,7 +155,7 @@ void GetTables()

const string GetColumnsQuery = @"
SELECT
nspname, relname, attname, typ.typname, attnum, atttypmod,
nspname, relname, attisdropped, attname, typ.typname, attnum, atttypmod,
CASE WHEN pg_proc.proname='array_recv' THEN 'a' ELSE typ.typtype END AS typtype,
CASE
WHEN pg_proc.proname='array_recv' THEN elemtyp.typname
Expand All @@ -163,7 +170,6 @@ FROM pg_class AS cls
LEFT OUTER JOIN pg_proc ON pg_proc.oid = typ.typreceive
LEFT OUTER JOIN pg_type AS elemtyp ON (elemtyp.oid = typ.typelem)
WHERE
atttypid <> 0 AND
relkind = 'r' AND
nspname NOT IN ('pg_catalog', 'information_schema') AND
relname <> '" + HistoryRepository.DefaultTableName + @"' AND
Expand All @@ -180,21 +186,30 @@ void GetColumns()
var schemaName = reader.GetString(0);
var tableName = reader.GetString(1);
if (!_tableSelectionSet.Allows(schemaName, tableName))
continue;

var table = _tables[TableKey(tableName, schemaName)];

// We need to know about dropped columns because constraints take them into
// account when referencing columns. We'll get rid of them before returning the model.
var isDropped = reader.GetBoolean(2);
if (isDropped)
{
table.Columns.Add(null);
continue;
}

var columnName = reader.GetString(2);
var dataType = reader.GetString(3);
var ordinal = reader.GetInt32(4) - 1;
var typeModifier = reader.GetInt32(5);
var typeChar = reader.GetChar(6);
var elemDataType = reader.IsDBNull(7) ? null : reader.GetString(7);
var isNullable = reader.GetBoolean(8);
var columnName = reader.GetString(3);
var dataType = reader.GetString(4);
var ordinal = reader.GetInt32(5) - 1;
var typeModifier = reader.GetInt32(6);
var typeChar = reader.GetChar(7);
var elemDataType = reader.IsDBNull(8) ? null : reader.GetString(8);
var isNullable = reader.GetBoolean(9);
int? maxLength = null;
int? precision = null;
int? scale = null;
var defaultValue = reader.IsDBNull(9) ? null : reader.GetString(9);
var defaultValue = reader.IsDBNull(10) ? null : reader.GetString(10);

if (typeModifier != -1)
{
Expand All @@ -214,7 +229,6 @@ void GetColumns()
}
}

var table = _tables[TableKey(tableName, schemaName)];
var column = new ColumnModel
{
Table = table,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,17 @@
#endregion

using JetBrains.Annotations;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Storage;
using Microsoft.EntityFrameworkCore.Storage.Internal;
using Microsoft.Extensions.DependencyInjection;

namespace Microsoft.EntityFrameworkCore.Scaffolding.Internal
{
public class NpgsqlDesignTimeServices
public class NpgsqlDesignTimeServices : IDesignTimeServices
{
public virtual IServiceCollection ConfigureDesignTimeServices([NotNull] IServiceCollection serviceCollection)
public virtual void ConfigureDesignTimeServices([NotNull] IServiceCollection serviceCollection)
=> serviceCollection
.AddSingleton<IScaffoldingModelFactory, NpgsqlScaffoldingModelFactory>()
.AddSingleton<IRelationalAnnotationProvider, NpgsqlAnnotationProvider>()
Expand Down
Loading

0 comments on commit a3132b9

Please sign in to comment.