-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Feature: add social category * Fix: tests * Fix: auth endpoints validation
- Loading branch information
1 parent
c4561f4
commit 6c0b40f
Showing
5 changed files
with
35 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
internal/storage/postgres/migrations/20241104_add_social_category.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// SPDX-FileCopyrightText: 2024 PK Lab AG <contact@pklab.io> | ||
// SPDX-License-Identifier: MIT | ||
|
||
package migrations | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/uptrace/bun" | ||
) | ||
|
||
func init() { | ||
Migrations.MustRegister(upSocialCategory, downSocialCategory) | ||
} | ||
|
||
func upSocialCategory(ctx context.Context, db *bun.DB) error { | ||
if _, err := db.ExecContext(ctx, `ALTER TYPE rollup_category ADD VALUE IF NOT EXISTS 'social' AFTER 'nft'`); err != nil { | ||
return err | ||
} | ||
return nil | ||
} | ||
|
||
func downSocialCategory(_ context.Context, _ *bun.DB) error { | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.