-
Notifications
You must be signed in to change notification settings - Fork 4
/
database.cs
33 lines (28 loc) · 945 Bytes
/
database.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using System;
using Microsoft.EntityFrameworkCore;
namespace firefly_plaid_connector
{
// We need a tiny database to keep track of imported transaction IDs
public class ImportDbContext : DbContext
{
public DbSet<ImportedTransaction> Transactions { get; set; }
public DbSet<LastPoll> Poll { get; set; }
public static string database_file = "import-db.sqlite3";
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseSqlite($"Data Source={database_file}");
}
}
public class LastPoll
{
public int LastPollId { get; set; }
public string PlaidId { get; set; }
public DateTime Time { get; set; }
}
public class ImportedTransaction
{
public int ImportedTransactionId { get; set; }
public string PlaidId { get; set; }
public int? FireflyId { get; set; }
}
}