mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-21 14:03:29 -07:00
added log trim command
This commit is contained in:
parent
279f8b5d73
commit
73f3459264
16 changed files with 62 additions and 69 deletions
|
@ -0,0 +1,24 @@
|
|||
using FluentMigrator;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Datastore.Migration
|
||||
{
|
||||
[Tags("")]
|
||||
[Migration(6)]
|
||||
public class add_index_to_log_time : NzbDroneMigrationBase
|
||||
{
|
||||
protected override void LogDbUpgrade()
|
||||
{
|
||||
Delete.Table("Logs");
|
||||
|
||||
Create.TableForModel("Logs")
|
||||
.WithColumn("Message").AsString()
|
||||
.WithColumn("Time").AsDateTime().Indexed()
|
||||
.WithColumn("Logger").AsString()
|
||||
.WithColumn("Method").AsString().Nullable()
|
||||
.WithColumn("Exception").AsString().Nullable()
|
||||
.WithColumn("ExceptionType").AsString().Nullable()
|
||||
.WithColumn("Level").AsString();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,7 +1,6 @@
|
|||
using System;
|
||||
using FluentMigrator.Runner;
|
||||
using NLog;
|
||||
using NzbDrone.Common.Composition;
|
||||
|
||||
namespace NzbDrone.Core.Datastore.Migration.Framework
|
||||
{
|
||||
|
|
|
@ -14,18 +14,18 @@ namespace NzbDrone.Core.Datastore.Migration.Framework
|
|||
|
||||
public override void Up()
|
||||
{
|
||||
if ((MigrationType)ApplicationContext == MigrationType.Main)
|
||||
switch ((MigrationType)ApplicationContext)
|
||||
{
|
||||
MainDbUpgrade();
|
||||
}
|
||||
else if ((MigrationType)ApplicationContext == MigrationType.Log)
|
||||
{
|
||||
LogDbUpgrade();
|
||||
}
|
||||
else
|
||||
{
|
||||
LogDbUpgrade();
|
||||
MainDbUpgrade();
|
||||
case MigrationType.Main:
|
||||
MainDbUpgrade();
|
||||
return;
|
||||
case MigrationType.Log:
|
||||
LogDbUpgrade();
|
||||
return;
|
||||
default:
|
||||
LogDbUpgrade();
|
||||
MainDbUpgrade();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue