mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
parent
d694d0cdd9
commit
79afd537fa
3 changed files with 10 additions and 6 deletions
|
|
@ -37,7 +37,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FilterLists.Agent", "src\Fi
|
|||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sql", "sql", "{A4BB2C81-5232-4162-B410-704D123D2C01}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
scripts\sql\cantSnapshot.sql = scripts\sql\cantSnapshot.sql
|
||||
scripts\sql\createDb.sql = scripts\sql\createDb.sql
|
||||
scripts\sql\snapshotTimeAnalysis.sql = scripts\sql\snapshotTimeAnalysis.sql
|
||||
EndProjectSection
|
||||
|
|
|
|||
|
|
@ -1,5 +0,0 @@
|
|||
--TODO: https://github.com/collinbarrett/FilterLists/issues/200
|
||||
--TODO: https://github.com/collinbarrett/FilterLists/issues/201
|
||||
|
||||
UPDATE filterlists SET CantSnapshot = 1
|
||||
WHERE id IN (48, 149, 173, 185, 186, 187, 188, 189, 352)
|
||||
|
|
@ -25,6 +25,7 @@ public static void SeedOrUpdate(this FilterListsDbContext dbContext, string data
|
|||
dbContext.InsertOnDuplicateKeyUpdate<Fork>(dataPath);
|
||||
dbContext.InsertOnDuplicateKeyUpdate<Merge>(dataPath);
|
||||
dbContext.InsertOnDuplicateKeyUpdate<SoftwareSyntax>(dataPath);
|
||||
SetCantSnapshot(dbContext);
|
||||
}
|
||||
|
||||
private static void InsertOnDuplicateKeyUpdate<TEntity>(this DbContext dbContext, string dataPath)
|
||||
|
|
@ -104,5 +105,14 @@ private static string GetUpdateUnchangedColumnHack(IEnumerable<IProperty> proper
|
|||
var firstId = properties.First(x => x.IsPrimaryKey()).Name;
|
||||
return firstId + " = VALUES(" + firstId + ")";
|
||||
}
|
||||
|
||||
//TODO: https://github.com/collinbarrett/FilterLists/issues/200
|
||||
//TODO: https://github.com/collinbarrett/FilterLists/issues/201
|
||||
private static void SetCantSnapshot(DbContext dbContext)
|
||||
{
|
||||
const string rawSqlString = "UPDATE filterlists SET CantSnapshot = 1 WHERE id IN(48, 149, 173, 185, 186, 187, 188, 189, 352)";
|
||||
dbContext.Database.ExecuteSqlCommand(rawSqlString);
|
||||
dbContext.SaveChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue