mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-14 17:22:54 -07:00
Added Migrations rather than a manual DB Script #865
This commit is contained in:
parent
77f9e90c0e
commit
b69b322bd5
13 changed files with 1206 additions and 433 deletions
|
@ -1,5 +1,4 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Ombi.Helpers;
|
||||
|
@ -16,20 +15,7 @@ namespace Ombi.Store.Context
|
|||
if (_created) return;
|
||||
|
||||
_created = true;
|
||||
Database.EnsureCreated();
|
||||
Database.Migrate();
|
||||
|
||||
#if DEBUG
|
||||
var location = System.Reflection.Assembly.GetEntryAssembly().Location;
|
||||
var directory = System.IO.Path.GetDirectoryName(location);
|
||||
var file = File.ReadAllText(Path.Combine(directory,"SqlTables.sql"));
|
||||
#else
|
||||
|
||||
var file = File.ReadAllText("SqlTables.sql");
|
||||
#endif
|
||||
// Run Script
|
||||
|
||||
Database.ExecuteSqlCommand(file, 0);
|
||||
|
||||
// Add the notifcation templates
|
||||
AddAllTemplates();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue