visual_migrate 4.0.1.5 → 4.0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/migration_defs.rb +6 -5
- data/lib/visual_migrate/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ddc85a76c3395512020091f65cfb0e489d37f444
|
4
|
+
data.tar.gz: 8c2e76cf8d14c2bcac88dd06c9cc1a80661d8fa3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb6705dfdd0e72fc18ce62b5d6cfe824604b17ca432d9650b0811a203914dab5ee8b8887fdbae91c874273de166d0ab4e9bb7a1e094d32d60a57c092e5fd4baf
|
7
|
+
data.tar.gz: 912c2466269cda673f0b112b2d8954261ce24422ca9dce1d1c5fa93807fcc40c494ff1acdf36ffe45583f83b7e29bd86b48a9e18eedfb8dd48ebaf64838f9e22
|
data/lib/migration_defs.rb
CHANGED
@@ -36,6 +36,7 @@ module MigrationDefs
|
|
36
36
|
'boolean' => 'Boolean型',
|
37
37
|
'timestamps' => 'レコードの作成・更新日時',
|
38
38
|
'attachment' => 'attachment',
|
39
|
+
'belongs_to' => 'belongs_to',
|
39
40
|
}
|
40
41
|
|
41
42
|
class MigrationClass
|
@@ -211,7 +212,7 @@ module MigrationDefs
|
|
211
212
|
|
212
213
|
def get_str(prefix = 't.')
|
213
214
|
result = prefix + @type
|
214
|
-
result += " :#{@name}" if (@type != 'timestamps') && (@type != 'attachment')
|
215
|
+
result += " :#{@name}" if (@type != 'timestamps') && (@type != 'attachment') && (@type != 'belongs_to')
|
215
216
|
result += @option.get_str
|
216
217
|
end
|
217
218
|
end
|
@@ -285,7 +286,7 @@ module MigrationDefs
|
|
285
286
|
parse_params[:columns].each do |key, val|
|
286
287
|
next if val.nil?
|
287
288
|
|
288
|
-
if (val[:type] != 'timestamps') && (val[:type] != 'attachment')
|
289
|
+
if (val[:type] != 'timestamps') && (val[:type] != 'attachment') && (val[:type] != 'belongs_to')
|
289
290
|
c = add_column(val[:type], val[:name])
|
290
291
|
c.set_option 'limit', val[:limit]
|
291
292
|
c.set_option 'default', val[:default]
|
@@ -357,7 +358,7 @@ module MigrationDefs
|
|
357
358
|
end
|
358
359
|
|
359
360
|
def parse_from_params(parse_params)
|
360
|
-
if (parse_params[:type] != 'timestamps') && (parse_params[:type] != 'attachment')
|
361
|
+
if (parse_params[:type] != 'timestamps') && (parse_params[:type] != 'attachment') && (parse_params[:type] != 'belongs_to')
|
361
362
|
@column = add_column(parse_params[:type], parse_params[:column])
|
362
363
|
@column.set_option 'limit', parse_params[:limit]
|
363
364
|
@column.set_option 'default', parse_params[:default]
|
@@ -373,7 +374,7 @@ module MigrationDefs
|
|
373
374
|
if @column.nil?
|
374
375
|
return "add_column :#{@name}\n"
|
375
376
|
else
|
376
|
-
if (@column.type != 'timestamps') && (@column.type != 'attachment')
|
377
|
+
if (@column.type != 'timestamps') && (@column.type != 'attachment') && (@column.type != 'belongs_to')
|
377
378
|
return "add_column :#{@name}" + (@column.name.blank? ? "\n" : ", :#{@column.name}, :#{@column.type}#{@column.option.get_str}\n")
|
378
379
|
else
|
379
380
|
return "add_column :#{@name}, #{:@column.type}\n"
|
@@ -432,7 +433,7 @@ module MigrationDefs
|
|
432
433
|
if @column.nil?
|
433
434
|
return "change_column :#{@name}\n"
|
434
435
|
else
|
435
|
-
if (@column.type != 'timestamps') && (@column.type != 'attachment')
|
436
|
+
if (@column.type != 'timestamps') && (@column.type != 'attachment') && (@column.type != 'belongs_to')
|
436
437
|
return "change_column :#{@name}" + (@column.name.blank? ? "\n" : ", :#{@column.name}, :#{@column.type}#{@column.option.get_str}\n")
|
437
438
|
else
|
438
439
|
return "change_column :#{@name}, #{:@column.type}\n"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: visual_migrate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.1.
|
4
|
+
version: 4.0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jun'ya Shimoda(JironBach)
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-12-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|