Skip to content

Commit

Permalink
Moves database to subfolder
Browse files Browse the repository at this point in the history
  • Loading branch information
sei-dupdyke committed Dec 19, 2023
1 parent 6d3b8fd commit a5f8a93
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ public DataContext(IConfiguration configuration)

protected override void OnConfiguring(DbContextOptionsBuilder options)
{
Directory.CreateDirectory($"{AppContext.BaseDirectory}/db");
// Console.WriteLine($"Database here: {AppContext.BaseDirectory}socializer.db");
// in memory database used for simplicity, change to a real db for production applications
options.UseSqlite($"Data Source={AppContext.BaseDirectory}socializer.db");
options.UseSqlite($"Data Source={AppContext.BaseDirectory}/db/socializer.db");
}

public DbSet<Post> Posts { get; set; }
Expand Down

0 comments on commit a5f8a93

Please sign in to comment.