Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/wicca #235

Open
wants to merge 2 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions AppServices/AppServices.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand All @@ -18,7 +18,6 @@
<Compile Remove="Class1.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.11" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion Domain/Domain.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
Expand Down
50 changes: 50 additions & 0 deletions Migrations/202110191404_modifying_company_tbl_nullable_url.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
using System;
using Domain.Framework.Constants;
using FluentMigrator;
using FluentMigrator.SqlServer;
using Migrations.Framework;

[Migration(202110191404)]
public class _202110191404_modifying_company_tbl_nullable_url : Migration
{
public override void Down()
{
Alter.Column("Url").OnTable(TableConstants.Companies)
.AsString()
.NotNullable();
}

public override void Up()
{

#if DEBUG
// There's no ALTER COLUMN in sqlite
//TODO: remove dummy data from migration
Delete.Table(TableConstants.Companies);
Create.Table(TableConstants.Companies)
.WithCommonColumns()
.WithColumn("Name").AsString().NotNullable()
.WithColumn("Url").AsString().Nullable()
.WithColumn("Email").AsString().NotNullable()
.WithColumn("LogoUrl").AsString().NotNullable()
.WithColumn("UserId").AsInt32().Nullable();

Insert.IntoTable(TableConstants.Companies)
.WithIdentityInsert()
.Row(new
{
Id = -1,
Name = "Megsoft",
CreatedAt = DateTime.UtcNow,
Email = "[email protected]",
Url = "https://megsoftconsulting.com",
LogoUrl = "https://megsoftconsulting.com/wp-content/uploads/2018/08/my_business.png",
UserId = -1
});
#else
Alter.Column("Url").OnTable(TableConstants.Companies)
.AsString()
.Nullable();
#endif
}
}
6 changes: 3 additions & 3 deletions Migrations/Migrations.csproj
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentMigrator.Generator" Version="1.0.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="FluentMigrator.Runner" Version="3.2.7" />
<PackageReference Include="FluentMigrator" Version="3.2.7" />
<PackageReference Include="FluentMigrator.Runner" Version="3.3.1" />
<PackageReference Include="FluentMigrator" Version="3.3.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Domain\Domain.csproj" />
Expand Down
2 changes: 1 addition & 1 deletion Migrations/Scripts/up.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
dotnet restore ../Migrations.csproj
dotnet build ../Migrations.csproj
dotnet fm migrate -p sqlite -c "Data Source=../../mydb.db" -a "../bin/Debug/netcoreapp3.1/Migrations.dll"
dotnet fm migrate -p sqlite -c "Data Source=../../mydb.db" -a "../bin/Debug/net5.0/Migrations.dll"
20 changes: 11 additions & 9 deletions Web/Web.csproj
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Domain\Domain.csproj">
<GlobalPropertiesToRemove></GlobalPropertiesToRemove>
<GlobalPropertiesToRemove>
</GlobalPropertiesToRemove>
</ProjectReference>
<ProjectReference Include="..\AppServices\AppServices.csproj">
<GlobalPropertiesToRemove></GlobalPropertiesToRemove>
<GlobalPropertiesToRemove>
</GlobalPropertiesToRemove>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="ElmahCore" Version="1.2.5" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="Microsoft.FeatureManagement.AspNetCore" Version="2.0.0" />
<PackageReference Include="Scrutor" Version="3.2.1" />
<PackageReference Include="Flurl" Version="2.8.2" />
<PackageReference Include="Flurl.Http" Version="2.4.2" />
<PackageReference Include="AspNet.Security.OAuth.GitHub" Version="3.1.3" />
<PackageReference Include="AspNet.Security.OAuth.LinkedIn" Version="3.1.3" />
Expand All @@ -26,10 +25,13 @@
<PackageReference Include="Microsoft.AspNetCore.Authentication.Facebook" Version="3.1.6" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.MicrosoftAccount" Version="3.1.6" />
<PackageReference Include="Microsoft.Azure.AppConfiguration.AspNetCore" Version="3.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.6" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.14.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="3.1.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.11" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="3.1.6" />
<PackageReference Include="Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers" Version="0.3.246501">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.20" />
</ItemGroup>
<ItemGroup>
<Content Remove="wwwroot\lib\icheck\skins\flat\aero%402x.png" />
Expand Down Expand Up @@ -70,4 +72,4 @@
<Folder Include="wwwroot\img\banners\" />
<Folder Include="Views\Banners\" />
</ItemGroup>
</Project>
</Project>
4 changes: 2 additions & 2 deletions init.bat
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

::# Getting Fluent Migrator CLI to Run Migrations
dotnet tool install -g FluentMigrator.DotNet.Cli --version 3.2.1
dotnet tool install -g FluentMigrator.DotNet.Cli --version 3.3.1

::# Update Fluent Migrator CLI
dotnet tool upgrade -g FluentMigrator.DotNet.Cli
Expand All @@ -19,6 +19,6 @@ libman restore
cd ../Migrations
dotnet restore Migrations.csproj
dotnet build Migrations.csproj
dotnet fm migrate -p sqlite -c "Data Source=../mydb.db" -a "bin/Debug/netcoreapp2.2/Migrations.dll"
dotnet fm migrate -p sqlite -c "Data Source=../mydb.db" -a "bin/Debug/net5.0/Migrations.dll"

cd ../
4 changes: 2 additions & 2 deletions init.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

# Getting Fluent Migrator CLI to Run Migrations
dotnet tool install -g FluentMigrator.DotNet.Cli --version 3.2.7
dotnet tool install -g FluentMigrator.DotNet.Cli --version 3.3.1

#Getting libman CLI for js package management
dotnet tool install -g Microsoft.Web.LibraryManager.Cli
Expand All @@ -16,6 +16,6 @@ libman restore
cd ../Migrations
dotnet restore Migrations.csproj
dotnet build Migrations.csproj
dotnet fm migrate -p sqlite -c "Data Source=../mydb.db" -a "bin/Debug/netcoreapp2.2/Migrations.dll"
dotnet fm migrate -p sqlite -c "Data Source=../mydb.db" -a "bin/Debug/net5.0/Migrations.dll"

cd ../