data_miner 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/data_miner/schema.rb +5 -1
- metadata +4 -4
data/lib/data_miner/schema.rb
CHANGED
@@ -206,7 +206,11 @@ module DataMiner
|
|
206
206
|
place_column ideal_primary_key_name
|
207
207
|
unless ideal.type.to_s == 'primary_key'
|
208
208
|
DataMiner.log_debug "SETTING #{ideal_primary_key_name} AS PRIMARY KEY"
|
209
|
-
connection.
|
209
|
+
if ActiveRecord::Base.connection.adapter_name.downcase == 'sqlite'
|
210
|
+
connection.execute "CREATE UNIQUE INDEX IDX_#{table_name}_#{ideal_primary_key_name} ON #{table_name} (#{ideal_primary_key_name} ASC)"
|
211
|
+
else
|
212
|
+
connection.execute "ALTER TABLE `#{table_name}` ADD PRIMARY KEY (`#{ideal_primary_key_name}`)"
|
213
|
+
end
|
210
214
|
end
|
211
215
|
end
|
212
216
|
resource.reset_column_information
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: data_miner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 9
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 0.5.
|
9
|
+
- 1
|
10
|
+
version: 0.5.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Seamus Abshere
|
@@ -17,7 +17,7 @@ autorequire:
|
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
19
|
|
20
|
-
date: 2010-07-
|
20
|
+
date: 2010-07-19 00:00:00 -04:00
|
21
21
|
default_executable:
|
22
22
|
dependencies:
|
23
23
|
- !ruby/object:Gem::Dependency
|