Skip to content

Cap the state column at 1 GB - 1 so Postgres migrates - #74

Open
jpcamara wants to merge 1 commit into
mainfrom
fix/pg-binary-limit
Open

Cap the state column at 1 GB - 1 so Postgres migrates#74
jpcamara wants to merge 1 commit into
mainfrom
fix/pg-binary-limit

Conversation

@jpcamara

Copy link
Copy Markdown
Owner

The yrby:tables migration template set t.binary :state, limit: 4.gigabytes - 1. Postgres raises ArgumentError: No binary type has byte size 4294967295 for binary limits above 1 GB - 1 (every Rails from 7.0 through 8.1), so db:migrate on a fresh Postgres app failed — including installs arriving through gems that invoke yrby:tables. Verified against a real Postgres: the old limit raises, the new one creates bytea cleanly.

1.gigabyte - 1 is the largest limit every adapter accepts: MySQL maps anything over 16 MB to longblob (unchanged — the original value's intent), SQLite ignores limits, Postgres sits exactly at its cap. The payload column's 16 MB - 1 is under the cap and stays.

Apps that already migrated are unaffected; the generator comment and test track the new value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant