Skip to content

Commit

Permalink
fix: s3 migration
Browse files Browse the repository at this point in the history
  • Loading branch information
achauve committed Oct 3, 2024
1 parent ff63000 commit 2326fcd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .talismanrc
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ fileignoreconfig:
- filename: packages/migrations/src/migrations/20240710125537_eig.js
checksum: c358c5f8cf7a408173e9ff8d273f05c8e1a193c3369ec2389bfd713ff1bab716
- filename: packages/migrations/src/migrations/20240918085236_migrate_files_to_minio.js
checksum: e064a2ee73c2ecb4da219f78c7458302383d264330cc7bf645239519f906f64f
checksum: a6a55d4495524bb170cba9db237704f0a61aacf8425984b614213f535b416c8a
- filename: packages/shared/src/components/Chat.vue
checksum: f2dbbf72bf098c7abd2c3aee230d220f5a5a106952883c0e116eb49f4f9d4db7
- filename: packages/shared/src/components/PasswordInput.vue
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const { S3Client, PutObjectCommand } = require("@aws-sdk/client-s3");

const S3_BUCKET_NAME = process.env.S3_BUCKET_NAME;
const S3_ROOT_DIR = process.env.S3_ROOT_DIR;

const s3Client = new S3Client({
credentials: {
Expand Down Expand Up @@ -28,7 +29,7 @@ exports.up = (knex) => {
new PutObjectCommand({
Body: row.file,
Bucket: S3_BUCKET_NAME,
Key: `${row.uuid}.pdf`,
Key: `${S3_ROOT_DIR}/${row.uuid}.pdf`,
Metadata: {
category: String(row.category),
created_at: String(row.created_at),
Expand Down

0 comments on commit 2326fcd

Please sign in to comment.