Skip to content

Commit

Permalink
remove deprecated columns
Browse files Browse the repository at this point in the history
  • Loading branch information
itstolf committed Aug 10, 2023
1 parent 721ddd4 commit cd9fa99
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 34 deletions.
2 changes: 0 additions & 2 deletions ingester/ingester_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,6 @@ func TestFirehoseIngester(t *testing.T) {
out,
// We can't know IndexedAt ahead of time.
cmpopts.IgnoreFields(gen.CandidatePost{}, "IndexedAt"),
// Ignore tags, we're deprecating it.
cmpopts.IgnoreFields(gen.CandidatePost{}, "Tags"),
cmpopts.SortSlices(func(a, b string) bool { return a < b }),
),
)
Expand Down
2 changes: 1 addition & 1 deletion proto/bff/v1/moderation_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ message Actor {
// is_hidden is a deprecated flag that used to hide accounts. This no longer
// has any effect.
// Deprecated: Use status.
bool is_hidden = 2;
reserved 2;
// is_artist is a flag indicating this account is primarily an artist. It
// does not currently control any feed placement.
bool is_artist = 3;
Expand Down
20 changes: 5 additions & 15 deletions store/gen/candidate_actors.sql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 3 additions & 11 deletions store/gen/candidate_posts.sql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions store/gen/models.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions store/migrations/000016_remove_deprecated_columns.down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ALTER TABLE candidate_posts ADD COLUMN tags TEXT[] DEFAULT ARRAY[]::TEXT[] NOT NULL;
ALTER TABLE candidate_posts ADD COLUMN is_nsfw BOOLEAN NOT NULL DEFAULT FALSE;
ALTER TABLE candidate_actors ADD COLUMN is_nsfw BOOLEAN NOT NULL DEFAULT FALSE;
ALTER TABLE candidate_actors ADD COLUMN is_hidden BOOLEAN NOT NULL DEFAULT FALSE;
DELETE FROM candidate_posts WHERE raw IS NULL;
ALTER TABLE candidate_posts ALTER COLUMN raw SET NOT NULL;
4 changes: 4 additions & 0 deletions store/migrations/000016_remove_deprecated_columns.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ALTER TABLE candidate_posts DROP COLUMN tags;
ALTER TABLE candidate_posts DROP COLUMN is_nsfw;
ALTER TABLE candidate_actors DROP COLUMN is_nsfw;
ALTER TABLE candidate_actors DROP COLUMN is_hidden;
1 change: 0 additions & 1 deletion store/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ func actorToProto(actor gen.CandidateActor) (*v1.Actor, error) {
}
return &v1.Actor{
Did: actor.DID,
IsHidden: actor.IsHidden,
IsArtist: actor.IsArtist,
Comment: actor.Comment,
Status: status,
Expand Down

0 comments on commit cd9fa99

Please sign in to comment.