def create_materialized_view(name, sql_definition, no_data: false)
        raise_unless_materialized_views_supported

        execute <<-SQL
  CREATE MATERIALIZED VIEW #{quote_table_name(name)} AS
  #{sql_definition.rstrip.chomp(";")}
  #{"WITH NO DATA" if no_data};
        SQL
      end
Creates a materialized view in the database

@param name The name of the materialized view to create
@param sql_definition The SQL schema that defines the materialized view.
@param no_data [Boolean] Default: false. Set to true to create
materialized view without running the associated query. You will need
to perform a refresh to populate with data.

This is typically called in a migration via {Statements#create_view}.

@raise [MaterializedViewsNotSupportedError] if the version of Postgres
in use does not support materialized views.

@return [void]