Versioned database views for Rails
refresh_materialized_view
now accepts a cascade
option, which defaults to
false
. Setting this option to true
will refresh any materialized views the
current view depends on first, ensuring the view being refreshed has the most
up-to-date information.sql_definition
argument is now supported when using update_view
.ar_internal_metadata
is no longer included in the schema dump for Rails 5
and newer apps.scenic:model
generator will no longer create a fixture or factory.Added
CREATE OR REPLACE VIEW
rather than CREATE VIEW
or DROP VIEW
and CREATE VIEW
.scenic.searches
Fixed
rails generate scenic:view my_app.users
.db/schema.rb
. This was
an oversight in previous releases, meaning rake db:schema:load
was missing
indexes.update_view
for a materialized view now properly finds associated
indexes for automatic reapplication. An issue in the previous index query was
returning no indexes.Note: Dumping materialized view indexes will produce an invalid
db/schema.rb
file under Rails 5 beta 1 and beta 2. This is fixed on Rails
master.
rake db:schema:load
.We've arrived at 1.0. Please enjoy!
Scenic::Configuration
.schema.rb
.alias_method_chain
deprecation when running with Rails master
(5.0).Scenic makes it easier to work with Postgres views in Rails.
It introduces view methods to ActiveRecord::Migration and allows views to be dumped to db/schema.rb.
It provides generators for models, view definitions, and migrations.
It is build around a basic versioning system for view definition files.
In short, go add a view to your app.