How to delete a stream
Created 6 years ago by kiltedup

Hi,

Is there a documented correct or recommended way to delete a stream that is no longer required in a module.

I have deleted one and ended up with a slew of class not found and migration not found errors.

Managed to clean it up but curious for next time the correct way to do it.

TIA, Dave

ryanthompson  —  6 years ago Best Answer

Usually you would use a migration for this: https://pyrocms.com/documentation/streams-platform/latest#database/migrations/generating-migrations/default-migrations

And it will clean things up. Sounds like you just deleted the migration / namespace? You can do that but definitely wanna run the migration to remove it first. $this->streams() in the example provided is just the StreamRepositoryInterface so you can do it programmatically that way too if it's not something you have a migration for.

Hope this helps!

kiltedup  —  6 years ago

Thanks for the reply - I was deleting the stream through the migration so not sure what went wrong. At least I was doing it right 😄