Module: ActiveRecord::Comments::ConnectionAdapters::SQLite3Adapter
- Includes:
- AbstractSQLiteAdapter
- Defined in:
- lib/active_record/comments/connection_adapters/sqlite3_adapter.rb
Instance Method Summary collapse
Methods included from AbstractSQLiteAdapter
#add_column_options!, #column_for, #comment_sql, #comments_supported?, #inline_comments?, #retrieve_column_comments, #retrieve_table_comment, #set_column_comment, #set_table_comment
Instance Method Details
#create_table(table_name, options = {}) {|td| ... } ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/active_record/comments/connection_adapters/sqlite3_adapter.rb', line 5 def create_table(table_name, = {}) td = create_table_definition table_name, [:temporary], [:options] td.base = self unless [:id] == false pk = .fetch(:primary_key) { ActiveRecord::Base.get_primary_key table_name.to_s.singularize } td.primary_key pk, .fetch(:id, :primary_key), end td.comment [:comment] if .has_key?(:comment) yield td if block_given? if [:force] && table_exists?(table_name) drop_table(table_name, ) end execute schema_creation.accept td td.indexes.each_pair { |c,o| add_index table_name, c, o } end |