Skip to content

Add a command to invalidate/remove the state of a sqlmesh entity #4464

@Happily-Coding

Description

@Happily-Coding

Recently, sqlmesh started failing to cleanup a few tables, so i could not execute sqlmesh run, or sqlmesh janitor, or sqlmesh destroy.

The staring cause remains unknown, butt It turns out it was trying to remove a table which did not exist during the cleanup stage.

Please add a command to make sqlmesh remove all state tables/references for a model and begin from scratch. That way if you come across this type of bug you have a reasonable solution to deal with it

One would think that changing the stamp, and executing plan with restate would do it but it didn't, and there seems to be no way to achieve it.

The work around I did was to manually delete all sqlmesh related schemas and restart the project, but its obviously not a reasonable approach for using this tool in production.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeatureAdds new functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions