mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 18:57:39 -07:00
added log trim command
This commit is contained in:
parent
279f8b5d73
commit
73f3459264
16 changed files with 62 additions and 69 deletions
|
@ -1,8 +0,0 @@
|
|||
namespace NzbDrone.Core.Datastore
|
||||
{
|
||||
public interface IReadModels<T> where T : ModelBase
|
||||
{
|
||||
T All();
|
||||
T Get(int id);
|
||||
}
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
namespace NzbDrone.Core.Datastore
|
||||
{
|
||||
public interface IWriteModels<T> where T : ModelBase
|
||||
{
|
||||
T Add(T model);
|
||||
T Update(T model);
|
||||
void Delete(int id);
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,9 +1,4 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace NzbDrone.Core.Datastore
|
||||
namespace NzbDrone.Core.Datastore
|
||||
{
|
||||
public enum MigrationType
|
||||
{
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
using System.Data;
|
||||
using System.Diagnostics;
|
||||
using Marr.Data;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace NzbDrone.Core.Datastore
|
||||
{
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace NzbDrone.Core.Datastore
|
||||
{
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
|
||||
namespace NzbDrone.Core.Datastore
|
||||
{
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using Marr.Data;
|
||||
using Marr.Data.Mapping;
|
||||
using NzbDrone.Core.Configuration;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue