Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 50 lines (40 sloc) 1.323 kb
2f542a2e »
2010-04-03 Specs passing, everything should be working
1 AlsoMigrate
4ab38af8 »
2009-11-06 [gem_template] First commit
2 ===========
3
9a65286d »
2010-04-03 Changing description
4 Migrate multiple tables with similar schema at once.
4ab38af8 »
2009-11-06 [gem_template] First commit
5
085cb142 »
2009-11-09 [gem_template] Updating README
6 Requirements
7 ------------
4ab38af8 »
2009-11-06 [gem_template] First commit
8
9 <pre>
944e5b62 »
2011-01-09 Merge branch 'rails' of github.com:winton/gem_template
10 gem install also_migrate
4ab38af8 »
2009-11-06 [gem_template] First commit
11 </pre>
12
57295350 »
2011-01-23 Opting for class variable configuration instead of model-based
13 Configure
14 ---------
085cb142 »
2009-11-09 [gem_template] Updating README
15
16 <pre>
57295350 »
2011-01-23 Opting for class variable configuration instead of model-based
17 AlsoMigrate.configuration = [
18 {
19 :source => 'articles',
20 :destination => 'article_archives',
069cce5f »
2010-12-12 Adding :add and :subtract options
21 :add => [
22 # Parameters to ActiveRecord::ConnectionAdapters::SchemaStatements#add_column
23 [ 'deleted_at', :datetime, {} ]
24 ],
25 :subtract => 'restored_at',
26 :ignore => 'deleted_at',
27 :indexes => 'id'
57295350 »
2011-01-23 Opting for class variable configuration instead of model-based
28 },
29 {
30 :source => 'users',
31 :destination => [ 'banned_users', 'deleted_users' ]
32 }
33 ]
085cb142 »
2009-11-09 [gem_template] Updating README
34 </pre>
35
2f542a2e »
2010-04-03 Specs passing, everything should be working
36 Options:
085cb142 »
2009-11-09 [gem_template] Updating README
37
57295350 »
2011-01-23 Opting for class variable configuration instead of model-based
38 * <code>source</code> Database schema source table
39 * <code>destination</code> Database schema destination table (can also be an array of tables)
069cce5f »
2010-12-12 Adding :add and :subtract options
40 * <code>add</code> Create columns that the original table doesn't have (defaults to none)
41 * <code>subtract</code> Exclude columns from the original table (defaults to none)
c7cce7d3 »
2010-04-03 README
42 * <code>ignore</code> Ignore migrations that apply to certain columns (defaults to none)
069cce5f »
2010-12-12 Adding :add and :subtract options
43 * <code>indexes</code> Only index certain columns (duplicates all indexes by default)
085cb142 »
2009-11-09 [gem_template] Updating README
44
2f542a2e »
2010-04-03 Specs passing, everything should be working
45 That's it!
46 ----------
47
48 Next time you migrate, <code>article_archives</code> is created if it doesn't exist.
085cb142 »
2009-11-09 [gem_template] Updating README
49
2f542a2e »
2010-04-03 Specs passing, everything should be working
50 Any new migration applied to <code>articles</code> is automatically applied to <code>article_archives</code>.
Something went wrong with that request. Please try again.