Replies: 4 comments 4 replies
-
Hey @JesperWe — I think this is something that we can likely add to Payload. Good call. I will add this to the roadmap and we should be able to get to it shortly! |
Beta Was this translation helpful? Give feedback.
-
Yep and integrated support for GIS would be awesome |
Beta Was this translation helpful? Give feedback.
-
Update here. PostGIS / Point field support will be very soon, check the comment from @ainsleyclark #8644 (comment) in the related discussion for this! As soon as Drizzle's PR will be released I think we can also merge this. |
Beta Was this translation helpful? Give feedback.
-
Was this closed because you can now add arbitrary views to the schema? I couldn't find where that was implemented if so. Or just because PostGIS now works? (This was just an example here, not the core of the issue) |
Beta Was this translation helpful? Give feedback.
-
Describe the Bug
The docs state about
beforeSchemaInit
:The ability to perserve existing database structure is however limited to databases that have tables that are not to be managed by Payload.
If the DB has SQL views defiend, Drizzle will attempt to delete those views and there is no way in the
PostgresSchema
type to add views, it only supports Enums, Relations and Tables.Drizzle itself supports adding
pgView
, but that feature does not seem to be propagated.Link to the code that reproduces this issue
https://github.com/payloadcms/payload/blob/beta/packages/drizzle/src/postgres/types.ts
Reproduction Steps
One easy way to reproduce is to enable the very popular PostGIS extension in a Postgres database
and then try to enable Payload for that database. The extra
spatial_ref_sys
table required by PostGIS can be handled inbeforeSchemaInit
but the required views can not. Drizzle will try to delete them, which will fail.Which area(s) are affected? (Select all that apply)
db-postgres
Environment Info
Binaries:
Node: 20.11.0
npm: 10.8.2
Yarn: 1.22.19
pnpm: 9.12.2
Relevant Packages:
payload: 3.0.0-beta.123
next: 15.0.1
@payloadcms/db-mongodb: 3.0.0-beta.123
@payloadcms/db-postgres: 3.0.0-beta.123
@payloadcms/graphql: 3.0.0-beta.123
@payloadcms/next/utilities: 3.0.0-beta.123
@payloadcms/richtext-lexical: 3.0.0-beta.123
@payloadcms/richtext-slate: 3.0.0-beta.123
@payloadcms/translations: 3.0.0-beta.123
@payloadcms/ui/shared: 3.0.0-beta.123
react: 19.0.0-rc-65a56d0e-20241020
react-dom: 19.0.0-rc-65a56d0e-20241020
Beta Was this translation helpful? Give feedback.
All reactions