Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 40 lines (29 sloc) 0.788 kb
4a7df40 @bernerdschaefer Hoe setup for dm-is-example, dm-is-list, dm-is-nested_set,
bernerdschaefer authored
1 = dm-migrations
d4341e5 @myabc Cleaned up README, TODOs
myabc authored
2
3 DataMapper plugin for writing and specing migrations.
3047904 @xaviershay Add an example to the README, with a find out more reference to the exam...
xaviershay authored
4
5 == Example
6
7 require 'dm-migrations/migration_runner'
8
9 DataMapper.setup(:default, "sqlite3::memory")
10
11 DataMapper::Logger.new(STDOUT, :debug)
12 DataMapper.logger.debug( "Starting Migration" )
13
14 migration 1, :create_people_table do
15 up do
16 create_table :people do
17 column :id, Integer, :serial => true
d6458a5 @xaviershay Add an example of change_column and a note that it's kind of retarded.
xaviershay authored
18 column :desc, String
3047904 @xaviershay Add an example to the README, with a find out more reference to the exam...
xaviershay authored
19 end
20 end
21
22 down do
23 drop_table :people
24 end
25 end
26
d6458a5 @xaviershay Add an example of change_column and a note that it's kind of retarded.
xaviershay authored
27 migration 2, :make_desc_text do
28 up do
29 modify_table :people do
30 # You currently have to use the underlying DB type here, rather than
31 # a DataMapper type
32 change_column :desc, 'text'
33 end
34 end
35 end
36
3047904 @xaviershay Add an example to the README, with a find out more reference to the exam...
xaviershay authored
37 migrate_up!
38
39 For more, see the examples directory.
Something went wrong with that request. Please try again.