Skip to content
Snippets Groups Projects
Commit cbba5749 authored by Marcel Nellesen's avatar Marcel Nellesen
Browse files

New: Create DB for collecting of logs (coscine/issues#460)

parent c7fa77c9
Branches
Tags
No related merge requests found
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
......@@ -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" />
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment