You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can add comments to your .sql file generated by Scenic. However, when the SQL file is run, Postgres saves the structure of the view, not the contents of the SQL file. So the comment is essentially discarded and won't appear in schema.rb either.
I have just learned, however, that Postgres supports a COMMENT command (as of Postgres 12) which can be used to add metadata to objects including views. Scenic does not support this. You could add a comment using execute but it wouldn't be dumped by the schema dumper.
It looks like some time ago, Rails did add support for comments to columns, fields, indexes, etc. Scenic does not support this. We almost definitely could support it (adding comment: as an argument to create_view, adding methods to manage view comments, adding support to dump them), but I'm honestly not sure I've ever had a desire to have a schema-persisted comment. Seems like a lot of work for something I can't really think of a use case for.
We're also using the strong_migrations gem
The text was updated successfully, but these errors were encountered: