Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions database.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ type Database struct {
GlobalBlacklist *GlobalBlacklist
GuildLeaveTime *GuildLeaveTime
GuildMetadata *GuildMetadataTable
ImportLogs *ImportLogsTable
ImportMappingTable *ImportMappingTable
LegacyPremiumEntitlementGuilds *LegacyPremiumEntitlementGuilds
LegacyPremiumEntitlements *LegacyPremiumEntitlements
MultiPanels *MultiPanelTable
Expand Down Expand Up @@ -147,8 +145,6 @@ func NewDatabase(pool *pgxpool.Pool) *Database {
GlobalBlacklist: newGlobalBlacklist(pool),
GuildLeaveTime: newGuildLeaveTime(pool),
GuildMetadata: newGuildMetadataTable(pool),
ImportLogs: newImportLogs(pool),
ImportMappingTable: newImportMapping(pool),
LegacyPremiumEntitlementGuilds: newLegacyPremiumEntitlementGuildsTable(pool),
LegacyPremiumEntitlements: newLegacyPremiumEntitlement(pool),
MultiPanels: newMultiMultiPanelTable(pool),
Expand Down Expand Up @@ -262,8 +258,6 @@ func (d *Database) CreateTables(ctx context.Context, pool *pgxpool.Pool) {
d.GlobalBlacklist,
d.GuildLeaveTime,
d.GuildMetadata,
d.ImportLogs,
d.ImportMappingTable,
d.LegacyPremiumEntitlements,
d.LegacyPremiumEntitlementGuilds,
d.MultiPanels,
Expand Down
2 changes: 0 additions & 2 deletions guildpurge.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ func (d *Database) PurgeGuildData(ctx context.Context, guildId uint64, logger *z
"custom_colours",
"feedback_enabled",
"guild_metadata",
"import_logs",
"import_mapping",
"legacy_premium_entitlement_guilds",
"naming_scheme",
"on_call",
Expand Down
155 changes: 0 additions & 155 deletions importlogs.go

This file was deleted.

83 changes: 0 additions & 83 deletions importmapping.go

This file was deleted.

13 changes: 0 additions & 13 deletions participants.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,19 +101,6 @@ SELECT EXISTS(
return
}

func (p *ParticipantTable) ImportBulk(ctx context.Context, guildId uint64, participantMap map[int][]uint64) (err error) {
rows := make([][]interface{}, 0)

for ticketId, participants := range participantMap {
for _, userId := range participants {
rows = append(rows, []interface{}{guildId, ticketId, userId})
}
}

_, err = p.CopyFrom(ctx, pgx.Identifier{"participant"}, []string{"guild_id", "ticket_id", "user_id"}, pgx.CopyFromRows(rows))
return
}

func (p *ParticipantTable) Set(ctx context.Context, guildId uint64, ticketId int, userId uint64) (err error) {
query := `
INSERT INTO participant("guild_id", "ticket_id", "user_id")
Expand Down
12 changes: 0 additions & 12 deletions serviceratings.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,18 +150,6 @@ func (r *ServiceRatings) GetRange(ctx context.Context, guildId uint64, lowerId,
return ratings, nil
}

func (r *ServiceRatings) ImportBulk(ctx context.Context, guildId uint64, ratings map[int]uint8) (err error) {
rows := make([][]interface{}, 0)

for ticketId, rating := range ratings {
rows = append(rows, []interface{}{guildId, ticketId, rating})
}

_, err = r.CopyFrom(ctx, pgx.Identifier{"service_ratings"}, []string{"guild_id", "ticket_id", "rating"}, pgx.CopyFromRows(rows))

return
}

func (r *ServiceRatings) Set(ctx context.Context, guildId uint64, ticketId int, rating uint8) (err error) {
query := `
INSERT INTO service_ratings("guild_id", "ticket_id", "rating")
Expand Down
29 changes: 0 additions & 29 deletions sql/import_logs/schema.sql

This file was deleted.

4 changes: 0 additions & 4 deletions sql/import_logs/set.sql

This file was deleted.

4 changes: 0 additions & 4 deletions sql/import_logs/set_run.sql

This file was deleted.

10 changes: 0 additions & 10 deletions sql/import_mapping/schema.sql

This file was deleted.

3 changes: 0 additions & 3 deletions sql/import_mapping/set.sql

This file was deleted.

11 changes: 0 additions & 11 deletions ticketclaims.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,6 @@ func (c *TicketClaims) Get(ctx context.Context, guildId uint64, ticketId int) (u
return
}

func (c *TicketClaims) ImportBulk(ctx context.Context, guildId uint64, claims map[int]uint64) (err error) {
rows := make([][]interface{}, 0)

for ticketId, userId := range claims {
rows = append(rows, []interface{}{guildId, ticketId, userId})
}

_, err = c.CopyFrom(ctx, pgx.Identifier{"ticket_claims"}, []string{"guild_id", "ticket_id", "user_id"}, pgx.CopyFromRows(rows))
return
}

func (c *TicketClaims) Set(ctx context.Context, guildId uint64, ticketId int, userId uint64) (err error) {
query := `INSERT INTO ticket_claims("guild_id", "ticket_id", "user_id") VALUES($1, $2, $3) ON CONFLICT("guild_id", "ticket_id") DO UPDATE SET "user_id" = $3;`
_, err = c.Exec(ctx, query, guildId, ticketId, userId)
Expand Down
Loading