diff --git a/src/Migrator/Migrations/Migration201911121400Logging.cs b/src/Migrator/Migrations/Migration201911121400Logging.cs new file mode 100644 index 0000000000000000000000000000000000000000..e18931a621cfc2f14c203d9e947869c323ef7474 --- /dev/null +++ b/src/Migrator/Migrations/Migration201911121400Logging.cs @@ -0,0 +1,39 @@ +using FluentMigrator; +using System; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Xml; +using System.Xml.Linq; + +namespace Coscine.Database.Migration.Migrations +{ + //yyyymmddhhmm + [Migration(201911121400)] + public class Migration201911121400Logging : FluentMigrator.Migration + { + public override void Down() + { + Delete.Table("Log"); + } + + public override void Up() + { + Create.Table("Log") + .WithColumn("Id").AsGuid().PrimaryKey().WithDefault(SystemMethods.NewGuid) + .WithColumn("ServerTimestamp").AsDateTime().WithDefault(SystemMethods.CurrentDateTime).Nullable() + .WithColumn("ClientTimestamp").AsDateTime().WithDefault(SystemMethods.CurrentDateTime).Nullable() + .WithColumn("LogLevel").AsString(20).Nullable() + .WithColumn("Message").AsString(500).Nullable() + .WithColumn("Stacktrace").AsString(8000).Nullable() + .WithColumn("UserId").AsGuid().Nullable() + .WithColumn("URI").AsString(500).Nullable() + .WithColumn("Server").AsString(200).Nullable() + .WithColumn("CorrolationId").AsGuid().Nullable() + .WithColumn("Status").AsString(200).Nullable() + .WithColumn("Source").AsString(200).Nullable(); + + } + + } +} \ No newline at end of file diff --git a/src/Migrator/Migrator.csproj b/src/Migrator/Migrator.csproj index 0f32d6f591086df07f028883ecb49607d0bafcca..2985d6de3e863336d3ba3bcae2b13b78d95ce502 100644 --- a/src/Migrator/Migrator.csproj +++ b/src/Migrator/Migrator.csproj @@ -159,6 +159,7 @@ <Compile Include="Migrations\Migration201911040900EnglishDFG.cs" /> <Compile Include="Migrations\Migration201912060900BucketApplication.cs" /> <Compile Include="Migrations\Migration201912091553ShibbolethAddition.cs" /> + <Compile Include="Migrations\Migration201911121400Logging.cs" /> <Compile Include="Migrator.cs" /> <Compile Include="Program.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />