Class: Slick::Database::Migration

Inherits:
Object
  • Object
show all
Extended by:
Registry
Includes:
Helpers
Defined in:
lib/slick/database/migration.rb

Constant Summary

Constants included from Helpers

Helpers::SELF_CLOSING_TAGS, Helpers::TAGS, Helpers::TEXT_ONLY_TAGS

Instance Attribute Summary

Attributes included from Registry

#name

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Registry

create, for, register, registered?, registered_classes

Methods included from Helpers

#html_tag, #indent, #line, #text

Class Method Details

.register(name, *args) ⇒ Object



11
12
13
14
# File 'lib/slick/database/migration.rb', line 11

def register(name, *args)
    throw "Invalid migration name '#{name}' - it must begin with a unix timestamp" if !name.to_s.match(/\A\d+/)
    super
end

.schema_versionObject



16
17
18
19
20
21
22
# File 'lib/slick/database/migration.rb', line 16

def schema_version
    if matches = name.to_s.match(/\A(\d+)/)
        matches[0].to_i
    else
        0
    end
end

Instance Method Details

#downObject



32
33
34
# File 'lib/slick/database/migration.rb', line 32

def down

end

#upObject



28
29
30
# File 'lib/slick/database/migration.rb', line 28

def up

end