Class: Snapshots::DatabaseDumper

Inherits:
ActiveRecord::SchemaDumper
  • Object
show all
Defined in:
lib/snapshots/database_dumper.rb

Instance Method Summary collapse

Instance Method Details

#dump(stream) ⇒ Object



5
6
7
8
9
# File 'lib/snapshots/database_dumper.rb', line 5

def dump(stream)
  super(stream)
  tables_for_data(stream)
  stream
end

#header(stream) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/snapshots/database_dumper.rb', line 11

def header(stream)
  stream.puts <<-EOC
# This file was generated by the Snapshots::DatabaseDumper and
# can be loaded with the Snapshots::DatabaseLoader.

ActiveRecord::Schema.define do

  create_table "schema_migrations", :id => false, :force => true do |t|
t.string "version", :null => false
  end

  add_index "schema_migrations", ["version"], :name => "unique_schema_migrations", :unique => true

EOC
end