dm-migrations 0.9.6 → 0.9.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/LICENSE +1 -1
- data/Rakefile +1 -1
- data/lib/dm-migrations/version.rb +1 -1
- data/lib/migration.rb +9 -7
- data/spec/spec_helper.rb +1 -1
- data/spec/unit/sql/postgresql_spec.rb +2 -1
- data/spec/unit/sql/sqlite3_extensions_spec.rb +2 -1
- metadata +6 -6
data/LICENSE
CHANGED
@@ -17,4 +17,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
17
17
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
18
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
19
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
CHANGED
@@ -10,7 +10,7 @@ AUTHOR = "Paul Sadauskas"
|
|
10
10
|
EMAIL = "psadauskas@gmail.com"
|
11
11
|
GEM_NAME = "dm-migrations"
|
12
12
|
GEM_VERSION = DataMapper::Migration::VERSION
|
13
|
-
GEM_DEPENDENCIES = [["dm-core", '
|
13
|
+
GEM_DEPENDENCIES = [["dm-core", '~>0.9.7']]
|
14
14
|
GEM_CLEAN = ["log", "pkg"]
|
15
15
|
GEM_EXTRAS = { :has_rdoc => true, :extra_rdoc_files => %w[ README.txt LICENSE TODO ] }
|
16
16
|
|
data/lib/migration.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'rubygems'
|
2
|
-
gem 'dm-core', '
|
2
|
+
gem 'dm-core', '~>0.9.7'
|
3
3
|
require 'dm-core'
|
4
4
|
require 'benchmark'
|
5
5
|
require File.dirname(__FILE__) + '/sql'
|
@@ -53,12 +53,13 @@ module DataMapper
|
|
53
53
|
def perform_up
|
54
54
|
result = nil
|
55
55
|
if needs_up?
|
56
|
-
|
56
|
+
# TODO: fix this so it only does transactions for databases that support create/drop
|
57
|
+
# database.transaction.commit do
|
57
58
|
say_with_time "== Performing Up Migration ##{position}: #{name}", 0 do
|
58
59
|
result = @up_action.call
|
59
60
|
end
|
60
61
|
update_migration_info(:up)
|
61
|
-
end
|
62
|
+
# end
|
62
63
|
end
|
63
64
|
result
|
64
65
|
end
|
@@ -67,20 +68,21 @@ module DataMapper
|
|
67
68
|
def perform_down
|
68
69
|
result = nil
|
69
70
|
if needs_down?
|
70
|
-
|
71
|
+
# TODO: fix this so it only does transactions for databases that support create/drop
|
72
|
+
# database.transaction.commit do
|
71
73
|
say_with_time "== Performing Down Migration ##{position}: #{name}", 0 do
|
72
74
|
result = @down_action.call
|
73
75
|
end
|
74
76
|
update_migration_info(:down)
|
75
|
-
end
|
77
|
+
# end
|
76
78
|
end
|
77
79
|
result
|
78
80
|
end
|
79
81
|
|
80
82
|
# execute raw SQL
|
81
|
-
def execute(sql)
|
83
|
+
def execute(sql, *bind_values)
|
82
84
|
say_with_time(sql) do
|
83
|
-
@adapter.execute(sql)
|
85
|
+
@adapter.execute(sql, *bind_values)
|
84
86
|
end
|
85
87
|
end
|
86
88
|
|
data/spec/spec_helper.rb
CHANGED
@@ -40,10 +40,10 @@ describe "SQLite3 Extensions" do
|
|
40
40
|
|
41
41
|
@col1 = mock('SQLite3 Column')
|
42
42
|
@col2 = mock('SQLite3 Column')
|
43
|
-
SQL::Postgresql::Column.stub!(:new).and_return(@col1, @col2)
|
44
43
|
end
|
45
44
|
|
46
45
|
it 'should initialize columns by querying the table' do
|
46
|
+
SQL::Postgresql::Column.stub!(:new).and_return(@col1, @col2)
|
47
47
|
@adapter.should_receive(:query_table).with('users').and_return([@cs1,@cs2])
|
48
48
|
SQL::Postgresql::Table.new(@adapter, 'users')
|
49
49
|
end
|
@@ -55,6 +55,7 @@ describe "SQLite3 Extensions" do
|
|
55
55
|
end
|
56
56
|
|
57
57
|
it 'should set the @columns to the looked-up columns' do
|
58
|
+
SQL::Postgresql::Column.stub!(:new).and_return(@col1, @col2)
|
58
59
|
t = SQL::Postgresql::Table.new(@adapter, 'users')
|
59
60
|
t.columns.should == [@col1, @col2]
|
60
61
|
end
|
@@ -50,10 +50,10 @@ describe "SQLite3 Extensions" do
|
|
50
50
|
|
51
51
|
@col1 = mock('SQLite3 Column')
|
52
52
|
@col2 = mock('SQLite3 Column')
|
53
|
-
SQL::Sqlite3::Column.stub!(:new).and_return(@col1, @col2)
|
54
53
|
end
|
55
54
|
|
56
55
|
it 'should initialize columns by querying the table' do
|
56
|
+
SQL::Sqlite3::Column.stub!(:new).and_return(@col1, @col2)
|
57
57
|
@adapter.should_receive(:query_table).with('users').and_return([@cs1,@cs2])
|
58
58
|
SQL::Sqlite3::Table.new(@adapter, 'users')
|
59
59
|
end
|
@@ -65,6 +65,7 @@ describe "SQLite3 Extensions" do
|
|
65
65
|
end
|
66
66
|
|
67
67
|
it 'should set the @columns to the looked-up columns' do
|
68
|
+
SQL::Sqlite3::Column.stub!(:new).and_return(@col1, @col2)
|
68
69
|
t = SQL::Sqlite3::Table.new(@adapter, 'users')
|
69
70
|
t.columns.should == [@col1, @col2]
|
70
71
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dm-migrations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Sadauskas
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-
|
12
|
+
date: 2008-11-18 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -18,9 +18,9 @@ dependencies:
|
|
18
18
|
version_requirement:
|
19
19
|
version_requirements: !ruby/object:Gem::Requirement
|
20
20
|
requirements:
|
21
|
-
- -
|
21
|
+
- - ~>
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: 0.9.
|
23
|
+
version: 0.9.7
|
24
24
|
version:
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: hoe
|
@@ -30,7 +30,7 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.
|
33
|
+
version: 1.8.2
|
34
34
|
version:
|
35
35
|
description: DataMapper plugin for writing and speccing migrations
|
36
36
|
email:
|
@@ -105,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
105
105
|
requirements: []
|
106
106
|
|
107
107
|
rubyforge_project: datamapper
|
108
|
-
rubygems_version: 1.
|
108
|
+
rubygems_version: 1.3.1
|
109
109
|
signing_key:
|
110
110
|
specification_version: 2
|
111
111
|
summary: DataMapper plugin for writing and speccing migrations
|