Class: ActiveRecord::ConnectionAdapters::SQLite3::SchemaDumper
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
|
|
Instance Chain:
|
|
Inherits: |
ActiveRecord::ConnectionAdapters::SchemaDumper
|
Defined in: | activerecord/lib/active_record/connection_adapters/sqlite3/schema_dumper.rb |
Constant Summary
Class Attribute Summary
::ActiveRecord::SchemaDumper
- Inherited
.chk_ignore_pattern | Specify a custom regular expression matching check constraints which name should not be dumped to db/schema.rb. |
.excl_ignore_pattern | Specify a custom regular expression matching exclusion constraints which name should not be dumped to db/schema.rb. |
.fk_ignore_pattern | Specify a custom regular expression matching foreign keys which name should not be dumped to db/schema.rb. |
.ignore_tables | A list of tables which should not be dumped to the schema. |
.unique_ignore_pattern | Specify a custom regular expression matching unique constraints which name should not be dumped to db/schema.rb. |
Class Method Summary
::ActiveRecord::ConnectionAdapters::SchemaDumper
- Inherited
::ActiveRecord::SchemaDumper
- Inherited
Instance Attribute Summary
::ActiveRecord::SchemaDumper
- Inherited
Instance Method Summary
- #default_primary_key?(column) ⇒ Boolean private
- #explicit_primary_key_default?(column) ⇒ Boolean private
- #extract_expression_for_virtual_column(column) private
- #prepare_column_options(column) private
- #virtual_tables(stream) private
::ActiveRecord::ConnectionAdapters::SchemaDumper
- Inherited
::ActiveRecord::SchemaDumper
- Inherited
#dump, #check_constraints_in_create, #define_params, | |
#extensions | extensions are only supported by |
#foreign_keys, #format_colspec, #format_index_parts, #format_options, | |
#formatted_version | turns 20170404131909 into “2017_04_04_131909”. |
#header, #ignored?, #index_parts, | |
#indexes | Keep it for indexing materialized views. |
#indexes_in_create, #remove_prefix_and_suffix, | |
#schemas | schemas are only supported by |
#table, #tables, #trailer, | |
#types | (enum) types are only supported by |
#virtual_tables | virtual tables are only supported by SQLite. |
Constructor Details
This class inherits a constructor from ActiveRecord::SchemaDumper
Instance Method Details
#default_primary_key?(column) ⇒ Boolean
(private)
# File 'activerecord/lib/active_record/connection_adapters/sqlite3/schema_dumper.rb', line 21
def default_primary_key?(column) schema_type(column) == :integer end
#explicit_primary_key_default?(column) ⇒ Boolean
(private)
# File 'activerecord/lib/active_record/connection_adapters/sqlite3/schema_dumper.rb', line 25
def explicit_primary_key_default?(column) column.bigint? end
#extract_expression_for_virtual_column(column) (private)
[ GitHub ]# File 'activerecord/lib/active_record/connection_adapters/sqlite3/schema_dumper.rb', line 41
def extract_expression_for_virtual_column(column) column.default_function.inspect end
#prepare_column_options(column) (private)
[ GitHub ]# File 'activerecord/lib/active_record/connection_adapters/sqlite3/schema_dumper.rb', line 29
def (column) spec = super if @connection.supports_virtual_columns? && column.virtual? spec[:as] = extract_expression_for_virtual_column(column) spec[:stored] = column.virtual_stored? spec = { type: schema_type(column).inspect }.merge!(spec) end spec end
#virtual_tables(stream) (private)
[ GitHub ]# File 'activerecord/lib/active_record/connection_adapters/sqlite3/schema_dumper.rb', line 8
def virtual_tables(stream) virtual_tables = @connection.virtual_tables if virtual_tables.any? stream.puts stream.puts " # Virtual tables defined in this database." stream.puts " # Note that virtual tables may not work with other database engines. Be careful if changing database." virtual_tables.sort.each do |table_name, | module_name, arguments = stream.puts " create_virtual_table #{table_name.inspect}, #{module_name.inspect}, #{arguments.split(", ").inspect}" end end end