kemen_foreigner 0.0.2 → 0.0.3
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.
@@ -17,7 +17,7 @@ module Foreigner
|
|
17
17
|
execute "alter table #{table} add constraint #{constraint_name} primary key (#{options[:column]})"
|
18
18
|
end
|
19
19
|
|
20
|
-
def remove_primary_key(table,
|
20
|
+
def remove_primary_key(table, options)
|
21
21
|
constraint_name = "pk_#{table}_#{options[:column]}"
|
22
22
|
execute "alter table #{table} drop constraint #{constraint_name}"
|
23
23
|
end
|
@@ -40,7 +40,6 @@ module Foreigner
|
|
40
40
|
if (primary_keys = @connection.pk(table_name)).any?
|
41
41
|
|
42
42
|
add_primary_keys_statement = primary_keys.map do |primary_key|
|
43
|
-
p primary_key
|
44
43
|
if primary_key[:pk] != 'id'
|
45
44
|
statement_parts = [('add_primary_key ' + table_name.inspect)]
|
46
45
|
statement_parts << (':column => ' + primary_key[:pk].inspect)
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 3
|
9
|
+
version: 0.0.3
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Cloned by Matthew Higgins
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-01-
|
17
|
+
date: 2011-01-26 00:00:00 +01:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|