mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-21 05:43:19 -07:00
Added our own custom migrations, a lot easier to migrate DB versions now.
This commit is contained in:
parent
171c64fe8e
commit
6e3339ad3c
16 changed files with 492 additions and 30 deletions
|
@ -59,6 +59,12 @@ CREATE TABLE IF NOT EXISTS DBInfo
|
|||
SchemaVersion INTEGER
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS VersionInfo
|
||||
(
|
||||
Version INTEGER NOT NULL,
|
||||
Description VARCHAR(100) NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS ScheduledJobs
|
||||
(
|
||||
Id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
|
|
|
@ -24,6 +24,8 @@
|
|||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
// ***********************************************************************
|
||||
#endregion
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using Dapper;
|
||||
|
@ -109,7 +111,29 @@ namespace PlexRequests.Store
|
|||
con.Close();
|
||||
}
|
||||
|
||||
public static IEnumerable<VersionInfo> GetVersionInfo(this IDbConnection con)
|
||||
{
|
||||
con.Open();
|
||||
var result = con.Query<VersionInfo>("SELECT * FROM VersionInfo");
|
||||
con.Close();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static void AddVersionInfo(this IDbConnection con, VersionInfo ver)
|
||||
{
|
||||
con.Open();
|
||||
con.Insert(ver);
|
||||
con.Close();
|
||||
}
|
||||
|
||||
|
||||
[Table("VersionInfo")]
|
||||
public class VersionInfo
|
||||
{
|
||||
public int Version { get; set; }
|
||||
public string Description { get; set; }
|
||||
}
|
||||
|
||||
[Table("DBInfo")]
|
||||
public class DbInfo
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue