Skip to content

Commit 50a661b

Browse files
authored
Merge pull request #1013 from constructive-io/devin/1776595653-fix-upload-requests-size
fix: remove non-existent 'size' column from upload_requests INSERTs
2 parents b816000 + 9e1579d commit 50a661b

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

  • graphile/graphile-presigned-url-plugin/src
  • graphql/server-test/__fixtures__/seed/simple-seed-storage

graphile/graphile-presigned-url-plugin/src/plugin.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -318,9 +318,9 @@ export function createPresignedUrlPlugin(
318318
// Track the dedup request
319319
await txClient.query({
320320
text: `INSERT INTO ${storageConfig.uploadRequestsQualifiedName}
321-
(file_id, bucket_id, key, content_type, content_hash, size, status, expires_at)
322-
VALUES ($1, $2, $3, $4, $5, $6, 'confirmed', NOW())`,
323-
values: [existingFile.id, bucket.id, s3Key, contentType, contentHash, size],
321+
(file_id, bucket_id, key, content_type, content_hash, status, expires_at)
322+
VALUES ($1, $2, $3, $4, $5, 'confirmed', NOW())`,
323+
values: [existingFile.id, bucket.id, s3Key, contentType, contentHash],
324324
});
325325

326326
return {
@@ -385,9 +385,9 @@ export function createPresignedUrlPlugin(
385385
// --- Track the upload request ---
386386
await txClient.query({
387387
text: `INSERT INTO ${storageConfig.uploadRequestsQualifiedName}
388-
(file_id, bucket_id, key, content_type, content_hash, size, status, expires_at)
389-
VALUES ($1, $2, $3, $4, $5, $6, 'issued', $7)`,
390-
values: [fileId, bucket.id, s3Key, contentType, contentHash, size, expiresAt],
388+
(file_id, bucket_id, key, content_type, content_hash, status, expires_at)
389+
VALUES ($1, $2, $3, $4, $5, 'issued', $6)`,
390+
values: [fileId, bucket.id, s3Key, contentType, contentHash, expiresAt],
391391
});
392392

393393
return {

graphql/server-test/__fixtures__/seed/simple-seed-storage/schema.sql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,16 @@ COMMENT ON TABLE "simple-storage-public".files IS E'@storageFiles\nStorage files
5656
CREATE TABLE IF NOT EXISTS "simple-storage-public".upload_requests (
5757
id uuid PRIMARY KEY DEFAULT uuid_generate_v4(),
5858
file_id uuid NOT NULL REFERENCES "simple-storage-public".files(id),
59+
actor_id uuid,
5960
bucket_id uuid NOT NULL REFERENCES "simple-storage-public".buckets(id),
6061
key text NOT NULL,
6162
content_type text NOT NULL,
6263
content_hash text,
63-
size bigint,
6464
status text NOT NULL DEFAULT 'issued',
6565
expires_at timestamptz,
6666
confirmed_at timestamptz,
67+
ip_address inet,
68+
user_agent text,
6769
created_at timestamptz DEFAULT now(),
6870
updated_at timestamptz DEFAULT now()
6971
);

0 commit comments

Comments
 (0)