diff --git a/lib/DBIx/Class/Schema/Loader/Base.pm b/lib/DBIx/Class/Schema/Loader/Base.pm index 9103fafcf..c1a345446 100644 --- a/lib/DBIx/Class/Schema/Loader/Base.pm +++ b/lib/DBIx/Class/Schema/Loader/Base.pm @@ -66,6 +66,7 @@ __PACKAGE__->mk_group_ro_accessors('simple', qw/ generated_classes omit_version omit_timestamp + omit_view_definitions relationship_attrs @@ -904,6 +905,10 @@ Omit the package version from the signature comment. Omit the creation timestamp from the signature comment. +=head2 omit_view_definitions + +Omit the creation of view definitions + =head2 custom_column_info Hook for adding extra attributes to the @@ -2626,8 +2631,8 @@ sub _setup_src_meta { $self->_dbic_stmt($table_class, 'table', $table->dbic_name); # Must come after ->table - if ($is_view and my $view_def = $self->_view_definition($table)) { - $self->_dbic_stmt($table_class, 'result_source_instance->view_definition', $view_def); + if ( $is_view and my $view_def = $self->_view_definition( $table ) and not $self->omit_view_definitions ){ + $self->_dbic_stmt( $table_class,'result_source_instance->view_definition', $view_def ); } my $cols = $self->_table_columns($table);