60 lines
2.8 KiB
C#
60 lines
2.8 KiB
C#
using DysonNetwork.Common.Models;
|
|
using DysonNetwork.Sphere.Realm;
|
|
using DysonNetwork.Sphere.Sticker;
|
|
using DysonNetwork.Sphere.Connection;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Query;
|
|
using Microsoft.Extensions.Configuration;
|
|
|
|
namespace DysonNetwork.Sphere.Data;
|
|
|
|
public class AppDatabase : DbContext
|
|
{
|
|
private readonly IConfiguration _configuration;
|
|
|
|
public AppDatabase(DbContextOptions<AppDatabase> options, IConfiguration configuration)
|
|
: base(options)
|
|
{
|
|
_configuration = configuration;
|
|
}
|
|
|
|
public DbSet<CloudFile> Files { get; set; } = null!;
|
|
public DbSet<CloudFileReference> FileReferences { get; set; } = null!;
|
|
public DbSet<Common.Models.Publisher> Publishers { get; set; } = null!;
|
|
public DbSet<PublisherFeature> PublisherFeatures { get; set; } = null!;
|
|
public DbSet<Common.Models.Post> Posts { get; set; } = null!;
|
|
public DbSet<PostReaction> PostReactions { get; set; } = null!;
|
|
public DbSet<PostTag> PostTags { get; set; } = null!;
|
|
public DbSet<PostCategory> PostCategories { get; set; } = null!;
|
|
public DbSet<PostCollection> PostCollections { get; set; } = null!;
|
|
public DbSet<Common.Models.Realm> Realms { get; set; } = null!;
|
|
public DbSet<RealmMember> RealmMembers { get; set; } = null!;
|
|
public DbSet<Tag> Tags { get; set; } = null!;
|
|
public DbSet<RealmTag> RealmTags { get; set; } = null!;
|
|
public DbSet<ChatRoom> ChatRooms { get; set; } = null!;
|
|
public DbSet<ChatMember> ChatMembers { get; set; } = null!;
|
|
public DbSet<Message> ChatMessages { get; set; } = null!;
|
|
public DbSet<RealtimeCall> ChatRealtimeCall { get; set; } = null!;
|
|
public DbSet<MessageReaction> ChatReactions { get; set; } = null!;
|
|
public DbSet<Sticker.Sticker> Stickers { get; set; } = null!;
|
|
public DbSet<StickerPack> StickerPacks { get; set; } = null!;
|
|
public DbSet<Common.Models.Wallet> Wallets { get; set; } = null!;
|
|
public DbSet<WalletPocket> WalletPockets { get; set; } = null!;
|
|
public DbSet<Order> PaymentOrders { get; set; } = null!;
|
|
public DbSet<Transaction> PaymentTransactions { get; set; } = null!;
|
|
public DbSet<CustomApp> CustomApps { get; set; } = null!;
|
|
public DbSet<CustomAppSecret> CustomAppSecrets { get; set; } = null!;
|
|
public DbSet<Subscription> WalletSubscriptions { get; set; } = null!;
|
|
// TODO: Fix Connection type - no Connection class found in DysonNetwork.Sphere.Connection
|
|
// public DbSet<Connection> Connections { get; set; } = null!;
|
|
// public DbSet<Connection> Followers { get; set; } = null!;
|
|
|
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
{
|
|
base.OnModelCreating(modelBuilder);
|
|
|
|
// Configure the database schema and relationships here
|
|
// This will be moved from the original AppDatabase class
|
|
}
|
|
}
|