Skip to content

Commit 4e5363d

Browse files
committed
Create pgcrypto extension on migrate
1 parent f8e346b commit 4e5363d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Common/Migrations/20241123181710_Hash API tokens.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ protected override void Up(MigrationBuilder migrationBuilder)
2222

2323
migrationBuilder.Sql(
2424
$"""
25-
UPDATE api_tokens SET token_hash = encode(digest(token_hash, 'sha256'), 'hex')
25+
CREATE EXTENSION IF NOT EXISTS pgcrypto;
26+
UPDATE api_tokens SET token_hash = encode(digest(token_hash, 'sha256'), 'hex');
2627
"""
2728
);
2829
}

0 commit comments

Comments
 (0)