mirror of
https://github.com/Radarr/Radarr
synced 2025-01-19 06:00:27 +00:00
7603d8e1ba
model tables are automatically created.
22 lines
509 B
C#
22 lines
509 B
C#
using System.Data;
|
|
using System.Linq;
|
|
using ServiceStack.OrmLite;
|
|
|
|
namespace NzbDrone.Core.Datastore
|
|
{
|
|
public static class Migration
|
|
{
|
|
public static void CreateTables(IDbConnection dbConnection)
|
|
{
|
|
var types = typeof(ModelBase).Assembly.GetTypes();
|
|
|
|
var models = types.Where(c => c.BaseType == typeof(ModelBase));
|
|
|
|
foreach (var model in models)
|
|
{
|
|
dbConnection.CreateTable(true, model);
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|