Skip to content

Changing the type of a function must drop it before creating the new one #326

@ludat

Description

@ludat

Old schema:

CREATE OR REPLACE FUNCTION somefunction(
    param1 text
)
[...]

New schema:

CREATE OR REPLACE FUNCTION somefunction(
    param2 uuid
)
[...]

Generated migration:

CREATE OR REPLACE FUNCTION somefunction(
    param2 uuid
)

Which results in the migration failing since postgres disallows changing types of params of functions, the migration should first drop the old function before creating the new one. This also includes the return type.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions