Migrations: add support for specifying column storage
I have to store precompressed data and it is important to not waste CPU on compression attempts which enlarge the data.
I tried
tbl.Propery(t => t.ByteArray).HasColumnType("bytea storage external")
and
tbl.Propery(t => t.ByteArray).UseCompressionMethod("external") // just worth a try, I know there is only pglz and lz4
tbl.Propery(t => t.ByteArray).UseCompressionMethod("none") // just worth a try, I know there is only pglz and lz4
BTW the documentation for UseCompressionMethod() isn't very helpful at all
@springy76 as far as I know, changing the storage of column is done via ALTER TABLE:
ALTER TABLE data ALTER COLUMN name SET STORAGE EXTERNAL;
It cannot be specified after the type name, nor is it related to the compression method.
There's no current support for having EF Core manage that for you, but it's trivial to use raw SQL in your migrations to add the ALTER TABLE.
Will keep this open to track adding support, though this is the first time anyone has ever mentioned it.