dm-constraints 1.2.0.rc1 → 1.2.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +14 -5
- data/VERSION +1 -1
- data/dm-constraints.gemspec +5 -5
- data/lib/data_mapper/constraints/adapters/oracle_adapter.rb +7 -5
- metadata +19 -19
data/Gemfile
CHANGED
@@ -5,11 +5,14 @@ source 'http://rubygems.org'
|
|
5
5
|
SOURCE = ENV.fetch('SOURCE', :git).to_sym
|
6
6
|
REPO_POSTFIX = SOURCE == :path ? '' : '.git'
|
7
7
|
DATAMAPPER = SOURCE == :path ? Pathname(__FILE__).dirname.parent : 'http://github.com/datamapper'
|
8
|
-
DM_VERSION = '~> 1.2.0.
|
8
|
+
DM_VERSION = '~> 1.2.0.rc2'
|
9
9
|
DO_VERSION = '~> 0.10.6'
|
10
10
|
DM_DO_ADAPTERS = %w[ sqlite postgres mysql oracle sqlserver ]
|
11
|
+
CURRENT_BRANCH = ENV.fetch('GIT_BRANCH', 'master')
|
11
12
|
|
12
|
-
gem 'dm-core',
|
13
|
+
gem 'dm-core', DM_VERSION,
|
14
|
+
SOURCE => "#{DATAMAPPER}/dm-core#{REPO_POSTFIX}",
|
15
|
+
:branch => CURRENT_BRANCH
|
13
16
|
|
14
17
|
group :development do
|
15
18
|
|
@@ -45,18 +48,24 @@ group :datamapper do
|
|
45
48
|
gem "do_#{adapter}", DO_VERSION, do_options.dup
|
46
49
|
end
|
47
50
|
|
48
|
-
gem 'dm-do-adapter', DM_VERSION,
|
51
|
+
gem 'dm-do-adapter', DM_VERSION,
|
52
|
+
SOURCE => "#{DATAMAPPER}/dm-do-adapter#{REPO_POSTFIX}",
|
53
|
+
:branch => CURRENT_BRANCH
|
49
54
|
end
|
50
55
|
|
51
56
|
adapters.each do |adapter|
|
52
|
-
gem "dm-#{adapter}-adapter", DM_VERSION,
|
57
|
+
gem "dm-#{adapter}-adapter", DM_VERSION,
|
58
|
+
SOURCE => "#{DATAMAPPER}/dm-#{adapter}-adapter#{REPO_POSTFIX}",
|
59
|
+
:branch => CURRENT_BRANCH
|
53
60
|
end
|
54
61
|
|
55
62
|
plugins = ENV['PLUGINS'] || ENV['PLUGIN']
|
56
63
|
plugins = plugins.to_s.tr(',', ' ').split.push('dm-migrations').uniq
|
57
64
|
|
58
65
|
plugins.each do |plugin|
|
59
|
-
gem plugin, DM_VERSION,
|
66
|
+
gem plugin, DM_VERSION,
|
67
|
+
SOURCE => "#{DATAMAPPER}/#{plugin}#{REPO_POSTFIX}",
|
68
|
+
:branch => CURRENT_BRANCH
|
60
69
|
end
|
61
70
|
|
62
71
|
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.2.0.
|
1
|
+
1.2.0.rc2
|
data/dm-constraints.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "dm-constraints"
|
8
|
-
s.version = "1.2.0.
|
8
|
+
s.version = "1.2.0.rc2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Dirkjan Bussink"]
|
12
|
-
s.date = "2011-09-
|
12
|
+
s.date = "2011-09-14"
|
13
13
|
s.description = "DataMapper plugin constraining relationships"
|
14
14
|
s.email = "d.bussink [a] gmail [d] com"
|
15
15
|
s.extra_rdoc_files = [
|
@@ -59,18 +59,18 @@ Gem::Specification.new do |s|
|
|
59
59
|
s.specification_version = 3
|
60
60
|
|
61
61
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
62
|
-
s.add_runtime_dependency(%q<dm-core>, ["~> 1.2.0.
|
62
|
+
s.add_runtime_dependency(%q<dm-core>, ["~> 1.2.0.rc2"])
|
63
63
|
s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
|
64
64
|
s.add_development_dependency(%q<rake>, ["~> 0.9.2"])
|
65
65
|
s.add_development_dependency(%q<rspec>, ["~> 1.3.2"])
|
66
66
|
else
|
67
|
-
s.add_dependency(%q<dm-core>, ["~> 1.2.0.
|
67
|
+
s.add_dependency(%q<dm-core>, ["~> 1.2.0.rc2"])
|
68
68
|
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
69
69
|
s.add_dependency(%q<rake>, ["~> 0.9.2"])
|
70
70
|
s.add_dependency(%q<rspec>, ["~> 1.3.2"])
|
71
71
|
end
|
72
72
|
else
|
73
|
-
s.add_dependency(%q<dm-core>, ["~> 1.2.0.
|
73
|
+
s.add_dependency(%q<dm-core>, ["~> 1.2.0.rc2"])
|
74
74
|
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
75
75
|
s.add_dependency(%q<rake>, ["~> 0.9.2"])
|
76
76
|
s.add_dependency(%q<rspec>, ["~> 1.3.2"])
|
@@ -21,7 +21,8 @@ module DataMapper
|
|
21
21
|
AND constraint_name = ?
|
22
22
|
SQL
|
23
23
|
|
24
|
-
select(statement, storage_name, constraint_name).first > 0
|
24
|
+
select(statement, oracle_upcase(storage_name)[0, self.class::IDENTIFIER_MAX_LENGTH].gsub('"', '_'), oracle_upcase(constraint_name)[0, self.class::IDENTIFIER_MAX_LENGTH].gsub('"', '_')).first > 0
|
25
|
+
|
25
26
|
end
|
26
27
|
|
27
28
|
|
@@ -30,12 +31,13 @@ module DataMapper
|
|
30
31
|
# @api private
|
31
32
|
#
|
32
33
|
# TODO: is it desirable to always set `INITIALLY DEFERRED DEFERRABLE`?
|
33
|
-
def create_constraints_statement(
|
34
|
+
def create_constraints_statement(constraint_name, constraint_type, source_storage_name, source_keys, target_storage_name, target_keys)
|
34
35
|
DataMapper::Ext::String.compress_lines(<<-SQL)
|
35
|
-
ALTER TABLE #{quote_name(
|
36
|
+
ALTER TABLE #{quote_name(source_storage_name)}
|
36
37
|
ADD CONSTRAINT #{quote_name(constraint_name)}
|
37
|
-
FOREIGN KEY (#{
|
38
|
-
REFERENCES #{quote_name(
|
38
|
+
FOREIGN KEY (#{source_keys.join(', ')})
|
39
|
+
REFERENCES #{quote_name(target_storage_name)} (#{target_keys.join(', ')})
|
40
|
+
#{"ON DELETE " + constraint_type if constraint_type && constraint_type != "NO ACTION"}
|
39
41
|
INITIALLY DEFERRED DEFERRABLE
|
40
42
|
SQL
|
41
43
|
end
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dm-constraints
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 15424017
|
5
5
|
prerelease: 6
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 2
|
9
9
|
- 0
|
10
10
|
- rc
|
11
|
-
-
|
12
|
-
version: 1.2.0.
|
11
|
+
- 2
|
12
|
+
version: 1.2.0.rc2
|
13
13
|
platform: ruby
|
14
14
|
authors:
|
15
15
|
- Dirkjan Bussink
|
@@ -17,29 +17,30 @@ autorequire:
|
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
19
|
|
20
|
-
date: 2011-09-
|
20
|
+
date: 2011-09-21 00:00:00 Z
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
23
23
|
type: :runtime
|
24
|
-
|
24
|
+
prerelease: false
|
25
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
26
|
none: false
|
26
27
|
requirements:
|
27
28
|
- - ~>
|
28
29
|
- !ruby/object:Gem::Version
|
29
|
-
hash:
|
30
|
+
hash: 15424017
|
30
31
|
segments:
|
31
32
|
- 1
|
32
33
|
- 2
|
33
34
|
- 0
|
34
35
|
- rc
|
35
|
-
-
|
36
|
-
version: 1.2.0.
|
37
|
-
|
38
|
-
requirement: *id001
|
36
|
+
- 2
|
37
|
+
version: 1.2.0.rc2
|
38
|
+
version_requirements: *id001
|
39
39
|
name: dm-core
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
type: :development
|
42
|
-
|
42
|
+
prerelease: false
|
43
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
43
44
|
none: false
|
44
45
|
requirements:
|
45
46
|
- - ~>
|
@@ -50,12 +51,12 @@ dependencies:
|
|
50
51
|
- 6
|
51
52
|
- 4
|
52
53
|
version: 1.6.4
|
53
|
-
|
54
|
-
requirement: *id002
|
54
|
+
version_requirements: *id002
|
55
55
|
name: jeweler
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
type: :development
|
58
|
-
|
58
|
+
prerelease: false
|
59
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
59
60
|
none: false
|
60
61
|
requirements:
|
61
62
|
- - ~>
|
@@ -66,12 +67,12 @@ dependencies:
|
|
66
67
|
- 9
|
67
68
|
- 2
|
68
69
|
version: 0.9.2
|
69
|
-
|
70
|
-
requirement: *id003
|
70
|
+
version_requirements: *id003
|
71
71
|
name: rake
|
72
72
|
- !ruby/object:Gem::Dependency
|
73
73
|
type: :development
|
74
|
-
|
74
|
+
prerelease: false
|
75
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
75
76
|
none: false
|
76
77
|
requirements:
|
77
78
|
- - ~>
|
@@ -82,8 +83,7 @@ dependencies:
|
|
82
83
|
- 3
|
83
84
|
- 2
|
84
85
|
version: 1.3.2
|
85
|
-
|
86
|
-
requirement: *id004
|
86
|
+
version_requirements: *id004
|
87
87
|
name: rspec
|
88
88
|
description: DataMapper plugin constraining relationships
|
89
89
|
email: d.bussink [a] gmail [d] com
|