Conversation
45ff08b to
8979af0
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8979af09a5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
8979af0 to
7374b89
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7374b89422
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| info!("Dropping type '{}'", type_name); | ||
| let mut stmt = Type::drop(); | ||
| stmt.name(Alias::new(&type_name)); | ||
| stmt.name(Alias::new(&type_name)).if_exists().cascade(); |
There was a problem hiding this comment.
Restrict cascading type drops to the target schema
query_pg_types() intentionally limits this cleanup to get_current_schema(db) (sea-orm-migration/src/migrator/queries.rs:117-142), and the migration tests explicitly support custom schema_search_path values (sea-orm-migration/tests/main.rs:58-63). Adding CASCADE here changes the failure mode for PostgreSQL: if another schema has a table/function/operator that references one of these types, DROP TYPE ... CASCADE will recursively delete that external object instead of stopping with a dependency error. In shared-database or multi-schema deployments, Migrator::fresh() can now destroy objects outside the schema it is supposed to be refreshing.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Yeah, that’s the problem. Users might not want objects in other schemas to get dropped. I think we can add a flag to control this behavior.
PR Info
Bug Fixes
drop_everythingnow drops custom types withCASCADE