File tree 2 files changed +15
-9
lines changed
2 files changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -96,14 +96,17 @@ behavior:
96
96
=== Schema
97
97
98
98
Add the <tt>Songkick::OAuth2::Provider</tt> tables to your app's schema. This is
99
- done using <tt>Songkick::OAuth2::Model::Schema.up</tt>, which can be used inside
100
- an <tt>ActiveRecord</tt> migration like so:
101
-
102
- class CreateOauth2ProviderModels < ActiveRecord::Migration
103
- def up
104
- Songkick::OAuth2::Model::Schema.up
105
- end
106
- end
99
+ done using <tt>Songkick::OAuth2::Model::Schema.migrate</tt>, which will run all
100
+ the gem's migrations that have not yet been applied to your database.
101
+
102
+ Songkick::OAuth2::Model::Schema.migrate
103
+ I, [2012-10-31T14:52:33.801428 #7002] INFO -- : Migrating to SongkickOauth2SchemaOriginalSchema (20120828112156)
104
+ == SongkickOauth2SchemaOriginalSchema: migrating =============================
105
+ -- create_table(:oauth2_clients)
106
+ -> 0.0029s
107
+ -- add_index(:oauth2_clients, [:client_id])
108
+ -> 0.0009s
109
+ ...
107
110
108
111
109
112
=== Model Mixins
Original file line number Diff line number Diff line change @@ -2,10 +2,13 @@ module Songkick
2
2
module OAuth2
3
3
4
4
class Schema
5
- def self . up
5
+ def self . migrate
6
6
ActiveRecord ::Base . logger ||= Logger . new ( StringIO . new )
7
7
ActiveRecord ::Migrator . up ( migrations_path )
8
8
end
9
+ class << self
10
+ alias :up :migrate
11
+ end
9
12
10
13
def self . migrations_path
11
14
File . expand_path ( '../schema' , __FILE__ )
You can’t perform that action at this time.
0 commit comments