mirror of
https://github.com/spacebarchat/server.git
synced 2026-03-30 13:55:39 +00:00
Sync CS db model
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Spacebar.Db.Models;
|
||||
using Stream = Spacebar.Db.Models.Stream;
|
||||
|
||||
@@ -344,6 +346,7 @@ public partial class SpacebarDbContext : DbContext
|
||||
{
|
||||
entity.HasKey(e => e.Id).HasName("PK_18325f38ae6de43878487eff986");
|
||||
|
||||
entity.Property(e => e.MessageSnapshots).HasDefaultValueSql("'[]'::text");
|
||||
entity.Property(e => e.Timestamp).HasDefaultValueSql("now()");
|
||||
|
||||
entity.HasOne(d => d.Application).WithMany(p => p.Messages).HasConstraintName("FK_5d3ec1cb962de6488637fd779d6");
|
||||
@@ -536,13 +539,12 @@ public partial class SpacebarDbContext : DbContext
|
||||
|
||||
modelBuilder.Entity<Session>(entity =>
|
||||
{
|
||||
entity.HasKey(e => e.Id).HasName("PK_3238ef96f18b355b671619111bc");
|
||||
entity.HasKey(e => e.SessionId).HasName("PK_9340188c93349808f10d1db74a8");
|
||||
|
||||
entity.Property(e => e.Activities).HasDefaultValueSql("'[]'::text");
|
||||
entity.Property(e => e.CreatedAt).HasDefaultValueSql("now()");
|
||||
|
||||
entity.HasOne(d => d.User).WithMany(p => p.Sessions)
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.HasConstraintName("FK_085d540d9f418cfbdc7bd55bb19");
|
||||
entity.HasOne(d => d.User).WithMany(p => p.Sessions).HasConstraintName("FK_085d540d9f418cfbdc7bd55bb19");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<Sticker>(entity =>
|
||||
|
||||
@@ -94,6 +94,9 @@ public partial class Message
|
||||
[Column("interaction_metadata")]
|
||||
public string? InteractionMetadata { get; set; }
|
||||
|
||||
[Column("message_snapshots")]
|
||||
public string MessageSnapshots { get; set; } = null!;
|
||||
|
||||
[ForeignKey("ApplicationId")]
|
||||
[InverseProperty("Messages")]
|
||||
public virtual Application? Application { get; set; }
|
||||
|
||||
@@ -7,15 +7,13 @@ using Microsoft.EntityFrameworkCore;
|
||||
namespace Spacebar.Db.Models;
|
||||
|
||||
[Table("sessions")]
|
||||
[Index("UserId", Name = "IDX_085d540d9f418cfbdc7bd55bb1")]
|
||||
public partial class Session
|
||||
{
|
||||
[Key]
|
||||
[Column("id", TypeName = "character varying")]
|
||||
public string Id { get; set; } = null!;
|
||||
|
||||
[Column("user_id", TypeName = "character varying")]
|
||||
public string? UserId { get; set; }
|
||||
public string UserId { get; set; } = null!;
|
||||
|
||||
[Key]
|
||||
[Column("session_id", TypeName = "character varying")]
|
||||
public string SessionId { get; set; } = null!;
|
||||
|
||||
@@ -31,7 +29,28 @@ public partial class Session
|
||||
[Column("client_status")]
|
||||
public string ClientStatus { get; set; } = null!;
|
||||
|
||||
[Column("is_admin_session")]
|
||||
public bool IsAdminSession { get; set; }
|
||||
|
||||
[Column("created_at", TypeName = "timestamp without time zone")]
|
||||
public DateTime CreatedAt { get; set; }
|
||||
|
||||
[Column("last_seen", TypeName = "timestamp without time zone")]
|
||||
public DateTime? LastSeen { get; set; }
|
||||
|
||||
[Column("last_seen_ip", TypeName = "character varying")]
|
||||
public string? LastSeenIp { get; set; }
|
||||
|
||||
[Column("last_seen_location", TypeName = "character varying")]
|
||||
public string? LastSeenLocation { get; set; }
|
||||
|
||||
[Column("last_seen_location_info")]
|
||||
public string? LastSeenLocationInfo { get; set; }
|
||||
|
||||
[Column("session_nickname", TypeName = "character varying")]
|
||||
public string? SessionNickname { get; set; }
|
||||
|
||||
[ForeignKey("UserId")]
|
||||
[InverseProperty("Sessions")]
|
||||
public virtual User? User { get; set; }
|
||||
public virtual User User { get; set; } = null!;
|
||||
}
|
||||
|
||||
@@ -89,14 +89,14 @@ public partial class User
|
||||
[Column("email", TypeName = "character varying")]
|
||||
public string? Email { get; set; }
|
||||
|
||||
[Column("flags")]
|
||||
[Column("flags", TypeName = "character varying")]
|
||||
public ulong Flags { get; set; }
|
||||
|
||||
[Column("public_flags")]
|
||||
public ulong PublicFlags { get; set; }
|
||||
|
||||
[Column("purchased_flags")]
|
||||
public ulong PurchasedFlags { get; set; }
|
||||
public long PurchasedFlags { get; set; }
|
||||
|
||||
[Column("premium_usage_flags")]
|
||||
public int PremiumUsageFlags { get; set; }
|
||||
@@ -110,9 +110,6 @@ public partial class User
|
||||
[Column("fingerprints")]
|
||||
public string Fingerprints { get; set; } = null!;
|
||||
|
||||
[Column("extended_settings")]
|
||||
public string ExtendedSettings { get; set; } = null!;
|
||||
|
||||
[Column("settingsIndex")]
|
||||
public int? SettingsIndex { get; set; }
|
||||
|
||||
|
||||
@@ -25,6 +25,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spacebar.ConfigModel", "Spa
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConfigTest", "ConfigTest\ConfigTest.csproj", "{3BB51E17-8D3E-42FE-AAE6-C33DA5D8D323}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spacebar.Cdn", "Spacebar.Cdn\Spacebar.Cdn.csproj", "{A2B0770E-D5E6-47BC-8595-4469F5C3E993}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -74,6 +76,10 @@ Global
|
||||
{3BB51E17-8D3E-42FE-AAE6-C33DA5D8D323}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{3BB51E17-8D3E-42FE-AAE6-C33DA5D8D323}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{3BB51E17-8D3E-42FE-AAE6-C33DA5D8D323}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{A2B0770E-D5E6-47BC-8595-4469F5C3E993}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{A2B0770E-D5E6-47BC-8595-4469F5C3E993}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A2B0770E-D5E6-47BC-8595-4469F5C3E993}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{A2B0770E-D5E6-47BC-8595-4469F5C3E993}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{F4E179D1-A3EB-4A1D-9C11-E7019F4B1EE2} = {04787943-EBB6-4DE4-96D5-4CFB4A2CEE99}
|
||||
|
||||
Reference in New Issue
Block a user