Some of the database migrations I'm planning to perform are very slow if using SQL only or entirely impossible using the standard SQLite toolchain. I added a simple interface with "before SQL" and "after SQL" hooks so that a database upgrade can perform custom code operations as well.
27 lines
772 B
C#
27 lines
772 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Duplicati.Library.SQLiteHelper.DBUpdates
|
|
{
|
|
|
|
// TODO: Consider passing in a transaction and performing everything in one go.
|
|
|
|
public interface IDbSchemaUpgrade
|
|
{
|
|
/// <summary>
|
|
/// Executed before the textual SQL command is executed.
|
|
/// </summary>
|
|
/// <param name="connection"></param>
|
|
void BeforeSql(System.Data.IDbConnection connection);
|
|
|
|
/// <summary>
|
|
/// Executed after the textual SQL command is executed.
|
|
/// </summary>
|
|
/// <param name="connection"></param>
|
|
void AfterSql(System.Data.IDbConnection connection);
|
|
}
|
|
}
|