Rename tables and properties

This commit is contained in:
Laura Hausmann 2024-01-07 19:14:39 +01:00
parent e391196eb2
commit 99e2e18c3d
No known key found for this signature in database
GPG key ID: D044E84C5BE01605
17 changed files with 12631 additions and 161 deletions

View file

@ -17,74 +17,74 @@ public class DatabaseContext : DbContext {
_config = config;
}
public virtual DbSet<AbuseUserReport> AbuseUserReports { get; init; } = null!;
public virtual DbSet<AccessToken> AccessTokens { get; init; } = null!;
public virtual DbSet<Announcement> Announcements { get; init; } = null!;
public virtual DbSet<AnnouncementRead> AnnouncementReads { get; init; } = null!;
public virtual DbSet<Antenna> Antennas { get; init; } = null!;
public virtual DbSet<App> Apps { get; init; } = null!;
public virtual DbSet<AttestationChallenge> AttestationChallenges { get; init; } = null!;
public virtual DbSet<AuthSession> AuthSessions { get; init; } = null!;
public virtual DbSet<Blocking> Blockings { get; init; } = null!;
public virtual DbSet<Channel> Channels { get; init; } = null!;
public virtual DbSet<ChannelFollowing> ChannelFollowings { get; init; } = null!;
public virtual DbSet<ChannelNotePining> ChannelNotePinings { get; init; } = null!;
public virtual DbSet<Clip> Clips { get; init; } = null!;
public virtual DbSet<ClipNote> ClipNotes { get; init; } = null!;
public virtual DbSet<DriveFile> DriveFiles { get; init; } = null!;
public virtual DbSet<DriveFolder> DriveFolders { get; init; } = null!;
public virtual DbSet<Emoji> Emojis { get; init; } = null!;
public virtual DbSet<FollowRequest> FollowRequests { get; init; } = null!;
public virtual DbSet<Following> Followings { get; init; } = null!;
public virtual DbSet<GalleryLike> GalleryLikes { get; init; } = null!;
public virtual DbSet<GalleryPost> GalleryPosts { get; init; } = null!;
public virtual DbSet<Hashtag> Hashtags { get; init; } = null!;
public virtual DbSet<HtmlNoteCacheEntry> HtmlNoteCacheEntries { get; init; } = null!;
public virtual DbSet<HtmlUserCacheEntry> HtmlUserCacheEntries { get; init; } = null!;
public virtual DbSet<Instance> Instances { get; init; } = null!;
public virtual DbSet<MessagingMessage> MessagingMessages { get; init; } = null!;
public virtual DbSet<Metum> Meta { get; init; } = null!;
public virtual DbSet<ModerationLog> ModerationLogs { get; init; } = null!;
public virtual DbSet<Muting> Mutings { get; init; } = null!;
public virtual DbSet<Note> Notes { get; init; } = null!;
public virtual DbSet<NoteEdit> NoteEdits { get; init; } = null!;
public virtual DbSet<NoteFavorite> NoteFavorites { get; init; } = null!;
public virtual DbSet<NoteReaction> NoteReactions { get; init; } = null!;
public virtual DbSet<NoteThreadMuting> NoteThreadMutings { get; init; } = null!;
public virtual DbSet<NoteUnread> NoteUnreads { get; init; } = null!;
public virtual DbSet<NoteWatching> NoteWatchings { get; init; } = null!;
public virtual DbSet<Notification> Notifications { get; init; } = null!;
public virtual DbSet<OauthApp> OauthApps { get; init; } = null!;
public virtual DbSet<OauthToken> OauthTokens { get; init; } = null!;
public virtual DbSet<Page> Pages { get; init; } = null!;
public virtual DbSet<PageLike> PageLikes { get; init; } = null!;
public virtual DbSet<PasswordResetRequest> PasswordResetRequests { get; init; } = null!;
public virtual DbSet<Poll> Polls { get; init; } = null!;
public virtual DbSet<PollVote> PollVotes { get; init; } = null!;
public virtual DbSet<PromoNote> PromoNotes { get; init; } = null!;
public virtual DbSet<PromoRead> PromoReads { get; init; } = null!;
public virtual DbSet<RegistrationTicket> RegistrationTickets { get; init; } = null!;
public virtual DbSet<RegistryItem> RegistryItems { get; init; } = null!;
public virtual DbSet<Relay> Relays { get; init; } = null!;
public virtual DbSet<RenoteMuting> RenoteMutings { get; init; } = null!;
public virtual DbSet<Session> Sessions { get; init; } = null!;
public virtual DbSet<Signin> Signins { get; init; } = null!;
public virtual DbSet<SwSubscription> SwSubscriptions { get; init; } = null!;
public virtual DbSet<UsedUsername> UsedUsernames { get; init; } = null!;
public virtual DbSet<User> Users { get; init; } = null!;
public virtual DbSet<UserGroup> UserGroups { get; init; } = null!;
public virtual DbSet<UserGroupInvitation> UserGroupInvitations { get; init; } = null!;
public virtual DbSet<UserGroupInvite> UserGroupInvites { get; init; } = null!;
public virtual DbSet<UserGroupJoining> UserGroupJoinings { get; init; } = null!;
public virtual DbSet<UserKeypair> UserKeypairs { get; init; } = null!;
public virtual DbSet<UserList> UserLists { get; init; } = null!;
public virtual DbSet<UserListJoining> UserListJoinings { get; init; } = null!;
public virtual DbSet<UserNotePining> UserNotePinings { get; init; } = null!;
public virtual DbSet<UserPending> UserPendings { get; init; } = null!;
public virtual DbSet<UserProfile> UserProfiles { get; init; } = null!;
public virtual DbSet<UserPublickey> UserPublickeys { get; init; } = null!;
public virtual DbSet<UserSecurityKey> UserSecurityKeys { get; init; } = null!;
public virtual DbSet<Webhook> Webhooks { get; init; } = null!;
public virtual DbSet<AbuseUserReport> AbuseUserReports { get; init; } = null!;
public virtual DbSet<AccessToken> AccessTokens { get; init; } = null!;
public virtual DbSet<Announcement> Announcements { get; init; } = null!;
public virtual DbSet<AnnouncementRead> AnnouncementReads { get; init; } = null!;
public virtual DbSet<Antenna> Antennas { get; init; } = null!;
public virtual DbSet<App> Apps { get; init; } = null!;
public virtual DbSet<AttestationChallenge> AttestationChallenges { get; init; } = null!;
public virtual DbSet<AuthSession> AuthSessions { get; init; } = null!;
public virtual DbSet<Blocking> Blockings { get; init; } = null!;
public virtual DbSet<Channel> Channels { get; init; } = null!;
public virtual DbSet<ChannelFollowing> ChannelFollowings { get; init; } = null!;
public virtual DbSet<ChannelNotePin> ChannelNotePins { get; init; } = null!;
public virtual DbSet<Clip> Clips { get; init; } = null!;
public virtual DbSet<ClipNote> ClipNotes { get; init; } = null!;
public virtual DbSet<DriveFile> DriveFiles { get; init; } = null!;
public virtual DbSet<DriveFolder> DriveFolders { get; init; } = null!;
public virtual DbSet<Emoji> Emojis { get; init; } = null!;
public virtual DbSet<FollowRequest> FollowRequests { get; init; } = null!;
public virtual DbSet<Following> Followings { get; init; } = null!;
public virtual DbSet<GalleryLike> GalleryLikes { get; init; } = null!;
public virtual DbSet<GalleryPost> GalleryPosts { get; init; } = null!;
public virtual DbSet<Hashtag> Hashtags { get; init; } = null!;
public virtual DbSet<HtmlNoteCacheEntry> HtmlNoteCacheEntries { get; init; } = null!;
public virtual DbSet<HtmlUserCacheEntry> HtmlUserCacheEntries { get; init; } = null!;
public virtual DbSet<Instance> Instances { get; init; } = null!;
public virtual DbSet<MessagingMessage> MessagingMessages { get; init; } = null!;
public virtual DbSet<Meta> Meta { get; init; } = null!;
public virtual DbSet<ModerationLog> ModerationLogs { get; init; } = null!;
public virtual DbSet<Muting> Mutings { get; init; } = null!;
public virtual DbSet<Note> Notes { get; init; } = null!;
public virtual DbSet<NoteEdit> NoteEdits { get; init; } = null!;
public virtual DbSet<NoteFavorite> NoteFavorites { get; init; } = null!;
public virtual DbSet<NoteReaction> NoteReactions { get; init; } = null!;
public virtual DbSet<NoteThreadMuting> NoteThreadMutings { get; init; } = null!;
public virtual DbSet<NoteUnread> NoteUnreads { get; init; } = null!;
public virtual DbSet<NoteWatching> NoteWatchings { get; init; } = null!;
public virtual DbSet<Notification> Notifications { get; init; } = null!;
public virtual DbSet<OauthApp> OauthApps { get; init; } = null!;
public virtual DbSet<OauthToken> OauthTokens { get; init; } = null!;
public virtual DbSet<Page> Pages { get; init; } = null!;
public virtual DbSet<PageLike> PageLikes { get; init; } = null!;
public virtual DbSet<PasswordResetRequest> PasswordResetRequests { get; init; } = null!;
public virtual DbSet<Poll> Polls { get; init; } = null!;
public virtual DbSet<PollVote> PollVotes { get; init; } = null!;
public virtual DbSet<PromoNote> PromoNotes { get; init; } = null!;
public virtual DbSet<PromoRead> PromoReads { get; init; } = null!;
public virtual DbSet<RegistrationTicket> RegistrationTickets { get; init; } = null!;
public virtual DbSet<RegistryItem> RegistryItems { get; init; } = null!;
public virtual DbSet<Relay> Relays { get; init; } = null!;
public virtual DbSet<RenoteMuting> RenoteMutings { get; init; } = null!;
public virtual DbSet<Session> Sessions { get; init; } = null!;
public virtual DbSet<Signin> Signins { get; init; } = null!;
public virtual DbSet<SwSubscription> SwSubscriptions { get; init; } = null!;
public virtual DbSet<UsedUsername> UsedUsernames { get; init; } = null!;
public virtual DbSet<User> Users { get; init; } = null!;
public virtual DbSet<UserGroup> UserGroups { get; init; } = null!;
public virtual DbSet<UserGroupInvitation> UserGroupInvitations { get; init; } = null!;
public virtual DbSet<UserGroupInvite> UserGroupInvites { get; init; } = null!;
public virtual DbSet<UserGroupMember> UserGroupMembers { get; init; } = null!;
public virtual DbSet<UserKeypair> UserKeypairs { get; init; } = null!;
public virtual DbSet<UserList> UserLists { get; init; } = null!;
public virtual DbSet<UserListMember> UserListMembers { get; init; } = null!;
public virtual DbSet<UserNotePin> UserNotePins { get; init; } = null!;
public virtual DbSet<UserPending> UserPendings { get; init; } = null!;
public virtual DbSet<UserProfile> UserProfiles { get; init; } = null!;
public virtual DbSet<UserPublickey> UserPublickeys { get; init; } = null!;
public virtual DbSet<UserSecurityKey> UserSecurityKeys { get; init; } = null!;
public virtual DbSet<Webhook> Webhooks { get; init; } = null!;
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) {
var dataSourceBuilder = new NpgsqlDataSourceBuilder();
@ -112,7 +112,10 @@ public class DatabaseContext : DbContext {
protected override void OnModelCreating(ModelBuilder modelBuilder) {
modelBuilder
.HasPostgresEnum<Antenna.AntennaSource>()
.HasPostgresEnum("log_level_enum", ["error", "warning", "info", "success", "debug"]) // TODO: not in use, add migration that removes this if it exists
.HasPostgresEnum("log_level_enum",
[
"error", "warning", "info", "success", "debug"
]) // TODO: not in use, add migration that removes this if it exists
.HasPostgresEnum<Note.NoteVisibility>()
.HasPostgresEnum<Notification.NotificationType>()
.HasPostgresEnum<Page.PageVisibility>()
@ -191,7 +194,7 @@ public class DatabaseContext : DbContext {
entity.Property(e => e.Users).HasDefaultValueSql("'{}'::character varying[]");
entity.Property(e => e.WithReplies).HasDefaultValue(false);
entity.HasOne(d => d.UserGroupJoining).WithMany(p => p.Antennas)
entity.HasOne(d => d.UserGroupMember).WithMany(p => p.Antennas)
.OnDelete(DeleteBehavior.Cascade)
.HasConstraintName("FK_ccbf5a8c0be4511133dcc50ddeb");
@ -295,15 +298,15 @@ public class DatabaseContext : DbContext {
.HasConstraintName("FK_6d8084ec9496e7334a4602707e1");
});
modelBuilder.Entity<ChannelNotePining>(entity => {
modelBuilder.Entity<ChannelNotePin>(entity => {
entity.HasKey(e => e.Id).HasName("PK_44f7474496bcf2e4b741681146d");
entity.Property(e => e.CreatedAt).HasComment("The created date of the ChannelNotePining.");
entity.Property(e => e.CreatedAt).HasComment("The created date of the ChannelNotePin.");
entity.HasOne(d => d.Channel).WithMany(p => p.ChannelNotePinings)
entity.HasOne(d => d.Channel).WithMany(p => p.ChannelNotePins)
.HasConstraintName("FK_8125f950afd3093acb10d2db8a8");
entity.HasOne(d => d.Note).WithMany(p => p.ChannelNotePinings)
entity.HasOne(d => d.Note).WithMany(p => p.ChannelNotePins)
.HasConstraintName("FK_10b19ef67d297ea9de325cd4502");
});
@ -535,7 +538,7 @@ public class DatabaseContext : DbContext {
.HasConstraintName("FK_5377c307783fce2b6d352e1203b");
});
modelBuilder.Entity<Metum>(entity => {
modelBuilder.Entity<Meta>(entity => {
entity.HasKey(e => e.Id).HasName("PK_c4c17a6c2bd7651338b60fc590b");
entity.Property(e => e.AllowedHosts).HasDefaultValueSql("'{}'::character varying[]");
@ -1059,17 +1062,17 @@ public class DatabaseContext : DbContext {
.HasConstraintName("FK_1039988afa3bf991185b277fe03");
});
modelBuilder.Entity<UserGroupJoining>(entity => {
modelBuilder.Entity<UserGroupMember>(entity => {
entity.HasKey(e => e.Id).HasName("PK_15f2425885253c5507e1599cfe7");
entity.Property(e => e.CreatedAt).HasComment("The created date of the UserGroupJoining.");
entity.Property(e => e.CreatedAt).HasComment("The created date of the UserGroupMember.");
entity.Property(e => e.UserGroupId).HasComment("The group ID.");
entity.Property(e => e.UserId).HasComment("The user ID.");
entity.HasOne(d => d.UserGroup).WithMany(p => p.UserGroupJoinings)
entity.HasOne(d => d.UserGroup).WithMany(p => p.UserGroupMembers)
.HasConstraintName("FK_67dc758bc0566985d1b3d399865");
entity.HasOne(d => d.User).WithMany(p => p.UserGroupJoinings)
entity.HasOne(d => d.User).WithMany(p => p.UserGroupMembers)
.HasConstraintName("FK_f3a1b4bd0c7cabba958a0c0b231");
});
@ -1092,29 +1095,29 @@ public class DatabaseContext : DbContext {
entity.HasOne(d => d.User).WithMany(p => p.UserLists).HasConstraintName("FK_b7fcefbdd1c18dce86687531f99");
});
modelBuilder.Entity<UserListJoining>(entity => {
modelBuilder.Entity<UserListMember>(entity => {
entity.HasKey(e => e.Id).HasName("PK_11abb3768da1c5f8de101c9df45");
entity.Property(e => e.CreatedAt).HasComment("The created date of the UserListJoining.");
entity.Property(e => e.CreatedAt).HasComment("The created date of the UserListMember.");
entity.Property(e => e.UserId).HasComment("The user ID.");
entity.Property(e => e.UserListId).HasComment("The list ID.");
entity.HasOne(d => d.User).WithMany(p => p.UserListJoinings)
entity.HasOne(d => d.User).WithMany(p => p.UserListMembers)
.HasConstraintName("FK_d844bfc6f3f523a05189076efaa");
entity.HasOne(d => d.UserList).WithMany(p => p.UserListJoinings)
entity.HasOne(d => d.UserList).WithMany(p => p.UserListMembers)
.HasConstraintName("FK_605472305f26818cc93d1baaa74");
});
modelBuilder.Entity<UserNotePining>(entity => {
modelBuilder.Entity<UserNotePin>(entity => {
entity.HasKey(e => e.Id).HasName("PK_a6a2dad4ae000abce2ea9d9b103");
entity.Property(e => e.CreatedAt).HasComment("The created date of the UserNotePinings.");
entity.Property(e => e.CreatedAt).HasComment("The created date of the UserNotePins.");
entity.HasOne(d => d.Note).WithMany(p => p.UserNotePinings)
entity.HasOne(d => d.Note).WithMany(p => p.UserNotePins)
.HasConstraintName("FK_68881008f7c3588ad7ecae471cf");
entity.HasOne(d => d.User).WithMany(p => p.UserNotePinings)
entity.HasOne(d => d.User).WithMany(p => p.UserNotePins)
.HasConstraintName("FK_bfbc6f79ba4007b4ce5097f08d6");
});

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,119 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Iceshrimp.Backend.Core.Database.Migrations
{
/// <inheritdoc />
public partial class RenameProperties : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "userGroupJoiningId",
table: "antenna",
newName: "UserGroupMemberId");
migrationBuilder.RenameIndex(
name: "IX_antenna_userGroupJoiningId",
table: "antenna",
newName: "IX_antenna_UserGroupMemberId");
migrationBuilder.AlterColumn<DateTime>(
name: "createdAt",
table: "user_note_pining",
type: "timestamp with time zone",
nullable: false,
comment: "The created date of the UserNotePins.",
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone",
oldComment: "The created date of the UserNotePinings.");
migrationBuilder.AlterColumn<DateTime>(
name: "createdAt",
table: "user_list_joining",
type: "timestamp with time zone",
nullable: false,
comment: "The created date of the UserListMember.",
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone",
oldComment: "The created date of the UserListJoining.");
migrationBuilder.AlterColumn<DateTime>(
name: "createdAt",
table: "user_group_joining",
type: "timestamp with time zone",
nullable: false,
comment: "The created date of the UserGroupMember.",
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone",
oldComment: "The created date of the UserGroupJoining.");
migrationBuilder.AlterColumn<DateTime>(
name: "createdAt",
table: "channel_note_pining",
type: "timestamp with time zone",
nullable: false,
comment: "The created date of the ChannelNotePin.",
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone",
oldComment: "The created date of the ChannelNotePining.");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "UserGroupMemberId",
table: "antenna",
newName: "userGroupJoiningId");
migrationBuilder.RenameIndex(
name: "IX_antenna_UserGroupMemberId",
table: "antenna",
newName: "IX_antenna_userGroupJoiningId");
migrationBuilder.AlterColumn<DateTime>(
name: "createdAt",
table: "user_note_pining",
type: "timestamp with time zone",
nullable: false,
comment: "The created date of the UserNotePinings.",
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone",
oldComment: "The created date of the UserNotePins.");
migrationBuilder.AlterColumn<DateTime>(
name: "createdAt",
table: "user_list_joining",
type: "timestamp with time zone",
nullable: false,
comment: "The created date of the UserListJoining.",
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone",
oldComment: "The created date of the UserListMember.");
migrationBuilder.AlterColumn<DateTime>(
name: "createdAt",
table: "user_group_joining",
type: "timestamp with time zone",
nullable: false,
comment: "The created date of the UserGroupJoining.",
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone",
oldComment: "The created date of the UserGroupMember.");
migrationBuilder.AlterColumn<DateTime>(
name: "createdAt",
table: "channel_note_pining",
type: "timestamp with time zone",
nullable: false,
comment: "The created date of the ChannelNotePining.",
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone",
oldComment: "The created date of the ChannelNotePin.");
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,70 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Iceshrimp.Backend.Core.Database.Migrations
{
/// <inheritdoc />
public partial class RenameTables : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameTable(
name: "user_note_pining",
newName: "user_note_pin");
migrationBuilder.RenameTable(
name: "user_list_joining",
newName: "user_list_member");
migrationBuilder.RenameTable(
name: "user_group_joining",
newName: "user_group_member");
migrationBuilder.RenameTable(
name: "channel_note_pining",
newName: "channel_note_pin");
migrationBuilder.RenameIndex(
name: "IX_user_note_pining_noteId",
table: "user_note_pin",
newName: "IX_user_note_pin_noteId");
migrationBuilder.RenameIndex(
name: "IX_channel_note_pining_noteId",
table: "channel_note_pin",
newName: "IX_channel_note_pin_noteId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameTable(
name: "user_note_pin",
newName: "user_note_pining");
migrationBuilder.RenameTable(
name: "user_list_member",
newName: "user_list_joining");
migrationBuilder.RenameTable(
name: "user_group_member",
newName: "user_group_joining");
migrationBuilder.RenameTable(
name: "channel_note_pin",
newName: "channel_note_pining");
migrationBuilder.RenameIndex(
name: "IX_user_note_pin_noteId",
table: "user_note_pining",
newName: "IX_user_note_pining_noteId");
migrationBuilder.RenameIndex(
name: "IX_channel_note_pin_noteId",
table: "channel_note_pining",
newName: "IX_channel_note_pining_noteId");
}
}
}

View file

@ -351,10 +351,10 @@ namespace Iceshrimp.Backend.Core.Database.Migrations
.HasColumnType("antenna_src_enum")
.HasColumnName("src");
b.Property<string>("UserGroupJoiningId")
b.Property<string>("UserGroupMemberId")
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasColumnName("userGroupJoiningId");
.HasColumnName("UserGroupMemberId");
b.Property<string>("UserId")
.IsRequired()
@ -388,7 +388,7 @@ namespace Iceshrimp.Backend.Core.Database.Migrations
b.HasKey("Id")
.HasName("PK_c170b99775e1dccca947c9f2d5f");
b.HasIndex("UserGroupJoiningId");
b.HasIndex("UserGroupMemberId");
b.HasIndex("UserListId");
@ -697,7 +697,7 @@ namespace Iceshrimp.Backend.Core.Database.Migrations
b.ToTable("channel_following");
});
modelBuilder.Entity("Iceshrimp.Backend.Core.Database.Tables.ChannelNotePining", b =>
modelBuilder.Entity("Iceshrimp.Backend.Core.Database.Tables.ChannelNotePin", b =>
{
b.Property<string>("Id")
.HasMaxLength(32)
@ -713,7 +713,7 @@ namespace Iceshrimp.Backend.Core.Database.Migrations
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("createdAt")
.HasComment("The created date of the ChannelNotePining.");
.HasComment("The created date of the ChannelNotePin.");
b.Property<string>("NoteId")
.IsRequired()
@ -731,7 +731,7 @@ namespace Iceshrimp.Backend.Core.Database.Migrations
b.HasIndex(new[] { "ChannelId", "NoteId" }, "IDX_f36fed37d6d4cdcc68c803cd9c")
.IsUnique();
b.ToTable("channel_note_pining");
b.ToTable("channel_note_pin");
});
modelBuilder.Entity("Iceshrimp.Backend.Core.Database.Tables.Clip", b =>
@ -1777,7 +1777,7 @@ namespace Iceshrimp.Backend.Core.Database.Migrations
b.ToTable("messaging_message");
});
modelBuilder.Entity("Iceshrimp.Backend.Core.Database.Tables.Metum", b =>
modelBuilder.Entity("Iceshrimp.Backend.Core.Database.Tables.Meta", b =>
{
b.Property<string>("Id")
.HasMaxLength(32)
@ -4177,7 +4177,7 @@ namespace Iceshrimp.Backend.Core.Database.Migrations
b.ToTable("user_group_invite");
});
modelBuilder.Entity("Iceshrimp.Backend.Core.Database.Tables.UserGroupJoining", b =>
modelBuilder.Entity("Iceshrimp.Backend.Core.Database.Tables.UserGroupMember", b =>
{
b.Property<string>("Id")
.HasMaxLength(32)
@ -4187,7 +4187,7 @@ namespace Iceshrimp.Backend.Core.Database.Migrations
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("createdAt")
.HasComment("The created date of the UserGroupJoining.");
.HasComment("The created date of the UserGroupMember.");
b.Property<string>("UserGroupId")
.IsRequired()
@ -4213,7 +4213,7 @@ namespace Iceshrimp.Backend.Core.Database.Migrations
b.HasIndex(new[] { "UserId" }, "IDX_f3a1b4bd0c7cabba958a0c0b23");
b.ToTable("user_group_joining");
b.ToTable("user_group_member");
});
modelBuilder.Entity("Iceshrimp.Backend.Core.Database.Tables.UserKeypair", b =>
@ -4282,7 +4282,7 @@ namespace Iceshrimp.Backend.Core.Database.Migrations
b.ToTable("user_list");
});
modelBuilder.Entity("Iceshrimp.Backend.Core.Database.Tables.UserListJoining", b =>
modelBuilder.Entity("Iceshrimp.Backend.Core.Database.Tables.UserListMember", b =>
{
b.Property<string>("Id")
.HasMaxLength(32)
@ -4292,7 +4292,7 @@ namespace Iceshrimp.Backend.Core.Database.Migrations
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("createdAt")
.HasComment("The created date of the UserListJoining.");
.HasComment("The created date of the UserListMember.");
b.Property<string>("UserId")
.IsRequired()
@ -4318,10 +4318,10 @@ namespace Iceshrimp.Backend.Core.Database.Migrations
b.HasIndex(new[] { "UserId" }, "IDX_d844bfc6f3f523a05189076efa");
b.ToTable("user_list_joining");
b.ToTable("user_list_member");
});
modelBuilder.Entity("Iceshrimp.Backend.Core.Database.Tables.UserNotePining", b =>
modelBuilder.Entity("Iceshrimp.Backend.Core.Database.Tables.UserNotePin", b =>
{
b.Property<string>("Id")
.HasMaxLength(32)
@ -4331,7 +4331,7 @@ namespace Iceshrimp.Backend.Core.Database.Migrations
b.Property<DateTime>("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("createdAt")
.HasComment("The created date of the UserNotePinings.");
.HasComment("The created date of the UserNotePins.");
b.Property<string>("NoteId")
.IsRequired()
@ -4355,7 +4355,7 @@ namespace Iceshrimp.Backend.Core.Database.Migrations
b.HasIndex(new[] { "UserId" }, "IDX_bfbc6f79ba4007b4ce5097f08d");
b.ToTable("user_note_pining");
b.ToTable("user_note_pin");
});
modelBuilder.Entity("Iceshrimp.Backend.Core.Database.Tables.UserPending", b =>
@ -4861,9 +4861,9 @@ namespace Iceshrimp.Backend.Core.Database.Migrations
modelBuilder.Entity("Iceshrimp.Backend.Core.Database.Tables.Antenna", b =>
{
b.HasOne("Iceshrimp.Backend.Core.Database.Tables.UserGroupJoining", "UserGroupJoining")
b.HasOne("Iceshrimp.Backend.Core.Database.Tables.UserGroupMember", "UserGroupMember")
.WithMany("Antennas")
.HasForeignKey("UserGroupJoiningId")
.HasForeignKey("UserGroupMemberId")
.OnDelete(DeleteBehavior.Cascade)
.HasConstraintName("FK_ccbf5a8c0be4511133dcc50ddeb");
@ -4882,7 +4882,7 @@ namespace Iceshrimp.Backend.Core.Database.Migrations
b.Navigation("User");
b.Navigation("UserGroupJoining");
b.Navigation("UserGroupMember");
b.Navigation("UserList");
});
@ -4991,17 +4991,17 @@ namespace Iceshrimp.Backend.Core.Database.Migrations
b.Navigation("Follower");
});
modelBuilder.Entity("Iceshrimp.Backend.Core.Database.Tables.ChannelNotePining", b =>
modelBuilder.Entity("Iceshrimp.Backend.Core.Database.Tables.ChannelNotePin", b =>
{
b.HasOne("Iceshrimp.Backend.Core.Database.Tables.Channel", "Channel")
.WithMany("ChannelNotePinings")
.WithMany("ChannelNotePins")
.HasForeignKey("ChannelId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("FK_8125f950afd3093acb10d2db8a8");
b.HasOne("Iceshrimp.Backend.Core.Database.Tables.Note", "Note")
.WithMany("ChannelNotePinings")
.WithMany("ChannelNotePins")
.HasForeignKey("NoteId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
@ -5729,17 +5729,17 @@ namespace Iceshrimp.Backend.Core.Database.Migrations
b.Navigation("UserGroup");
});
modelBuilder.Entity("Iceshrimp.Backend.Core.Database.Tables.UserGroupJoining", b =>
modelBuilder.Entity("Iceshrimp.Backend.Core.Database.Tables.UserGroupMember", b =>
{
b.HasOne("Iceshrimp.Backend.Core.Database.Tables.UserGroup", "UserGroup")
.WithMany("UserGroupJoinings")
.WithMany("UserGroupMembers")
.HasForeignKey("UserGroupId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("FK_67dc758bc0566985d1b3d399865");
b.HasOne("Iceshrimp.Backend.Core.Database.Tables.User", "User")
.WithMany("UserGroupJoinings")
.WithMany("UserGroupMembers")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
@ -5774,17 +5774,17 @@ namespace Iceshrimp.Backend.Core.Database.Migrations
b.Navigation("User");
});
modelBuilder.Entity("Iceshrimp.Backend.Core.Database.Tables.UserListJoining", b =>
modelBuilder.Entity("Iceshrimp.Backend.Core.Database.Tables.UserListMember", b =>
{
b.HasOne("Iceshrimp.Backend.Core.Database.Tables.User", "User")
.WithMany("UserListJoinings")
.WithMany("UserListMembers")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("FK_d844bfc6f3f523a05189076efaa");
b.HasOne("Iceshrimp.Backend.Core.Database.Tables.UserList", "UserList")
.WithMany("UserListJoinings")
.WithMany("UserListMembers")
.HasForeignKey("UserListId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
@ -5795,17 +5795,17 @@ namespace Iceshrimp.Backend.Core.Database.Migrations
b.Navigation("UserList");
});
modelBuilder.Entity("Iceshrimp.Backend.Core.Database.Tables.UserNotePining", b =>
modelBuilder.Entity("Iceshrimp.Backend.Core.Database.Tables.UserNotePin", b =>
{
b.HasOne("Iceshrimp.Backend.Core.Database.Tables.Note", "Note")
.WithMany("UserNotePinings")
.WithMany("UserNotePins")
.HasForeignKey("NoteId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("FK_68881008f7c3588ad7ecae471cf");
b.HasOne("Iceshrimp.Backend.Core.Database.Tables.User", "User")
.WithMany("UserNotePinings")
.WithMany("UserNotePins")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
@ -5893,7 +5893,7 @@ namespace Iceshrimp.Backend.Core.Database.Migrations
{
b.Navigation("ChannelFollowings");
b.Navigation("ChannelNotePinings");
b.Navigation("ChannelNotePins");
b.Navigation("Notes");
});
@ -5935,7 +5935,7 @@ namespace Iceshrimp.Backend.Core.Database.Migrations
modelBuilder.Entity("Iceshrimp.Backend.Core.Database.Tables.Note", b =>
{
b.Navigation("ChannelNotePinings");
b.Navigation("ChannelNotePins");
b.Navigation("ClipNotes");
@ -5965,7 +5965,7 @@ namespace Iceshrimp.Backend.Core.Database.Migrations
b.Navigation("PromoReads");
b.Navigation("UserNotePinings");
b.Navigation("UserNotePins");
});
modelBuilder.Entity("Iceshrimp.Backend.Core.Database.Tables.OauthApp", b =>
@ -6082,17 +6082,17 @@ namespace Iceshrimp.Backend.Core.Database.Migrations
b.Navigation("UserGroupInvites");
b.Navigation("UserGroupJoinings");
b.Navigation("UserGroupMembers");
b.Navigation("UserGroups");
b.Navigation("UserKeypair");
b.Navigation("UserListJoinings");
b.Navigation("UserListMembers");
b.Navigation("UserLists");
b.Navigation("UserNotePinings");
b.Navigation("UserNotePins");
b.Navigation("UserProfile");
@ -6111,7 +6111,7 @@ namespace Iceshrimp.Backend.Core.Database.Migrations
b.Navigation("UserGroupInvites");
b.Navigation("UserGroupJoinings");
b.Navigation("UserGroupMembers");
});
modelBuilder.Entity("Iceshrimp.Backend.Core.Database.Tables.UserGroupInvitation", b =>
@ -6119,7 +6119,7 @@ namespace Iceshrimp.Backend.Core.Database.Migrations
b.Navigation("Notifications");
});
modelBuilder.Entity("Iceshrimp.Backend.Core.Database.Tables.UserGroupJoining", b =>
modelBuilder.Entity("Iceshrimp.Backend.Core.Database.Tables.UserGroupMember", b =>
{
b.Navigation("Antennas");
});
@ -6128,7 +6128,7 @@ namespace Iceshrimp.Backend.Core.Database.Migrations
{
b.Navigation("Antennas");
b.Navigation("UserListJoinings");
b.Navigation("UserListMembers");
});
#pragma warning restore 612, 618
}

View file

@ -54,9 +54,9 @@ public class Antenna {
[Column("withReplies")] public bool WithReplies { get; set; }
[Column("userGroupJoiningId")]
[Column("UserGroupMemberId")]
[StringLength(32)]
public string? UserGroupJoiningId { get; set; }
public string? UserGroupMemberId { get; set; }
[Column("users", TypeName = "character varying(1024)[]")]
public List<string> Users { get; set; } = null!;
@ -71,9 +71,9 @@ public class Antenna {
[InverseProperty("Antennas")]
public virtual User User { get; set; } = null!;
[ForeignKey("UserGroupJoiningId")]
[ForeignKey("UserGroupMemberId")]
[InverseProperty("Antennas")]
public virtual UserGroupJoining? UserGroupJoining { get; set; }
public virtual UserGroupMember? UserGroupMember { get; set; }
[ForeignKey("UserListId")]
[InverseProperty("Antennas")]

View file

@ -72,7 +72,7 @@ public class Channel {
public virtual ICollection<ChannelFollowing> ChannelFollowings { get; set; } = new List<ChannelFollowing>();
[InverseProperty("Channel")]
public virtual ICollection<ChannelNotePining> ChannelNotePinings { get; set; } = new List<ChannelNotePining>();
public virtual ICollection<ChannelNotePin> ChannelNotePins { get; set; } = new List<ChannelNotePin>();
[InverseProperty("Channel")] public virtual ICollection<Note> Notes { get; set; } = new List<Note>();

View file

@ -4,17 +4,17 @@ using Microsoft.EntityFrameworkCore;
namespace Iceshrimp.Backend.Core.Database.Tables;
[Table("channel_note_pining")]
[Table("channel_note_pin")]
[Index("ChannelId", Name = "IDX_8125f950afd3093acb10d2db8a")]
[Index("ChannelId", "NoteId", Name = "IDX_f36fed37d6d4cdcc68c803cd9c", IsUnique = true)]
public class ChannelNotePining {
public class ChannelNotePin {
[Key]
[Column("id")]
[StringLength(32)]
public string Id { get; set; } = null!;
/// <summary>
/// The created date of the ChannelNotePining.
/// The created date of the ChannelNotePin.
/// </summary>
[Column("createdAt")]
public DateTime CreatedAt { get; set; }
@ -26,10 +26,10 @@ public class ChannelNotePining {
[Column("noteId")] [StringLength(32)] public string NoteId { get; set; } = null!;
[ForeignKey("ChannelId")]
[InverseProperty("ChannelNotePinings")]
[InverseProperty("ChannelNotePins")]
public virtual Channel Channel { get; set; } = null!;
[ForeignKey("NoteId")]
[InverseProperty("ChannelNotePinings")]
[InverseProperty("ChannelNotePins")]
public virtual Note Note { get; set; } = null!;
}

View file

@ -4,7 +4,7 @@ using System.ComponentModel.DataAnnotations.Schema;
namespace Iceshrimp.Backend.Core.Database.Tables;
[Table("meta")]
public class Metum {
public class Meta {
[Key]
[Column("id")]
[StringLength(32)]

View file

@ -168,7 +168,7 @@ public class Note {
public virtual Channel? Channel { get; set; }
[InverseProperty("Note")]
public virtual ICollection<ChannelNotePining> ChannelNotePinings { get; set; } = new List<ChannelNotePining>();
public virtual ICollection<ChannelNotePin> ChannelNotePins { get; set; } = new List<ChannelNotePin>();
[InverseProperty("Note")] public virtual ICollection<ClipNote> ClipNotes { get; set; } = new List<ClipNote>();
@ -215,7 +215,7 @@ public class Note {
public virtual User User { get; set; } = null!;
[InverseProperty("Note")]
public virtual ICollection<UserNotePining> UserNotePinings { get; set; } = new List<UserNotePining>();
public virtual ICollection<UserNotePin> UserNotePins { get; set; } = new List<UserNotePin>();
[PgName("note_visibility_enum")]
public enum NoteVisibility {

View file

@ -403,19 +403,19 @@ public class User {
public virtual ICollection<UserGroupInvite> UserGroupInvites { get; set; } = new List<UserGroupInvite>();
[InverseProperty("User")]
public virtual ICollection<UserGroupJoining> UserGroupJoinings { get; set; } = new List<UserGroupJoining>();
public virtual ICollection<UserGroupMember> UserGroupMembers { get; set; } = new List<UserGroupMember>();
[InverseProperty("User")] public virtual ICollection<UserGroup> UserGroups { get; set; } = new List<UserGroup>();
[InverseProperty("User")] public virtual UserKeypair? UserKeypair { get; set; }
[InverseProperty("User")]
public virtual ICollection<UserListJoining> UserListJoinings { get; set; } = new List<UserListJoining>();
public virtual ICollection<UserListMember> UserListMembers { get; set; } = new List<UserListMember>();
[InverseProperty("User")] public virtual ICollection<UserList> UserLists { get; set; } = new List<UserList>();
[InverseProperty("User")]
public virtual ICollection<UserNotePining> UserNotePinings { get; set; } = new List<UserNotePining>();
public virtual ICollection<UserNotePin> UserNotePins { get; set; } = new List<UserNotePin>();
[InverseProperty("User")] public virtual UserProfile? UserProfile { get; set; }

View file

@ -45,5 +45,5 @@ public class UserGroup {
public virtual ICollection<UserGroupInvite> UserGroupInvites { get; set; } = new List<UserGroupInvite>();
[InverseProperty("UserGroup")]
public virtual ICollection<UserGroupJoining> UserGroupJoinings { get; set; } = new List<UserGroupJoining>();
public virtual ICollection<UserGroupMember> UserGroupMembers { get; set; } = new List<UserGroupMember>();
}

View file

@ -4,18 +4,18 @@ using Microsoft.EntityFrameworkCore;
namespace Iceshrimp.Backend.Core.Database.Tables;
[Table("user_group_joining")]
[Table("user_group_member")]
[Index("UserGroupId", Name = "IDX_67dc758bc0566985d1b3d39986")]
[Index("UserId", "UserGroupId", Name = "IDX_d9ecaed8c6dc43f3592c229282", IsUnique = true)]
[Index("UserId", Name = "IDX_f3a1b4bd0c7cabba958a0c0b23")]
public class UserGroupJoining {
public class UserGroupMember {
[Key]
[Column("id")]
[StringLength(32)]
public string Id { get; set; } = null!;
/// <summary>
/// The created date of the UserGroupJoining.
/// The created date of the UserGroupMember.
/// </summary>
[Column("createdAt")]
public DateTime CreatedAt { get; set; }
@ -34,14 +34,14 @@ public class UserGroupJoining {
[StringLength(32)]
public string UserGroupId { get; set; } = null!;
[InverseProperty("UserGroupJoining")]
[InverseProperty("UserGroupMember")]
public virtual ICollection<Antenna> Antennas { get; set; } = new List<Antenna>();
[ForeignKey("UserId")]
[InverseProperty("UserGroupJoinings")]
[InverseProperty("UserGroupMembers")]
public virtual User User { get; set; } = null!;
[ForeignKey("UserGroupId")]
[InverseProperty("UserGroupJoinings")]
[InverseProperty("UserGroupMembers")]
public virtual UserGroup UserGroup { get; set; } = null!;
}

View file

@ -45,5 +45,5 @@ public class UserList {
public virtual User User { get; set; } = null!;
[InverseProperty("UserList")]
public virtual ICollection<UserListJoining> UserListJoinings { get; set; } = new List<UserListJoining>();
public virtual ICollection<UserListMember> UserListMembers { get; set; } = new List<UserListMember>();
}

View file

@ -4,18 +4,18 @@ using Microsoft.EntityFrameworkCore;
namespace Iceshrimp.Backend.Core.Database.Tables;
[Table("user_list_joining")]
[Table("user_list_member")]
[Index("UserListId", Name = "IDX_605472305f26818cc93d1baaa7")]
[Index("UserId", "UserListId", Name = "IDX_90f7da835e4c10aca6853621e1", IsUnique = true)]
[Index("UserId", Name = "IDX_d844bfc6f3f523a05189076efa")]
public class UserListJoining {
public class UserListMember {
[Key]
[Column("id")]
[StringLength(32)]
public string Id { get; set; } = null!;
/// <summary>
/// The created date of the UserListJoining.
/// The created date of the UserListMember.
/// </summary>
[Column("createdAt")]
public DateTime CreatedAt { get; set; }
@ -35,10 +35,10 @@ public class UserListJoining {
public string UserListId { get; set; } = null!;
[ForeignKey("UserId")]
[InverseProperty("UserListJoinings")]
[InverseProperty("UserListMembers")]
public virtual User User { get; set; } = null!;
[ForeignKey("UserListId")]
[InverseProperty("UserListJoinings")]
[InverseProperty("UserListMembers")]
public virtual UserList UserList { get; set; } = null!;
}

View file

@ -4,17 +4,17 @@ using Microsoft.EntityFrameworkCore;
namespace Iceshrimp.Backend.Core.Database.Tables;
[Table("user_note_pining")]
[Table("user_note_pin")]
[Index("UserId", "NoteId", Name = "IDX_410cd649884b501c02d6e72738", IsUnique = true)]
[Index("UserId", Name = "IDX_bfbc6f79ba4007b4ce5097f08d")]
public class UserNotePining {
public class UserNotePin {
[Key]
[Column("id")]
[StringLength(32)]
public string Id { get; set; } = null!;
/// <summary>
/// The created date of the UserNotePinings.
/// The created date of the UserNotePins.
/// </summary>
[Column("createdAt")]
public DateTime CreatedAt { get; set; }
@ -24,10 +24,10 @@ public class UserNotePining {
[Column("noteId")] [StringLength(32)] public string NoteId { get; set; } = null!;
[ForeignKey("NoteId")]
[InverseProperty("UserNotePinings")]
[InverseProperty("UserNotePins")]
public virtual Note Note { get; set; } = null!;
[ForeignKey("UserId")]
[InverseProperty("UserNotePinings")]
[InverseProperty("UserNotePins")]
public virtual User User { get; set; } = null!;
}