ar_firebird_adapter 1.0.2 → 1.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.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d1d31b12f68b28b88b65f3d1dbe9ba2316424758d38f0048db9e6d393325ba48
|
|
4
|
+
data.tar.gz: c88dff39a172d01ab3e85544a4d0743c2df121dbe91433bb402043ff00c87cc2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1fe65acaac638e4852c4be5f4bc00d9c86af87d5898af3eb48853ac323a4e81d95a7e05e6742345f45ecb8ec8173665f361c08efcad99809924193f11b18d655
|
|
7
|
+
data.tar.gz: a411a7096d1f7337d49da8a1d4b088b3471b55ac8b6b8bd6836daf1ffb186af339e3e707a9dab85e5331225f611215cf4ca9e6fe481ce4e0632ba4e5fed2ff04
|
|
@@ -107,6 +107,21 @@ module ActiveRecord::ConnectionAdapters::ArFirebird::SchemaStatements
|
|
|
107
107
|
end
|
|
108
108
|
end
|
|
109
109
|
|
|
110
|
+
def change_column(table_name, column_name, type, options = {}) #:nodoc:
|
|
111
|
+
clear_cache!
|
|
112
|
+
type = type_to_sql(type)
|
|
113
|
+
column = column_definitions(table_name.to_sym).find {|column| column["name"] == column_name.to_s }
|
|
114
|
+
if options[:limit]
|
|
115
|
+
type = "#{type.gsub(/\(.*\)/,'')}(#{options[:limit]})"
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
sql = []
|
|
119
|
+
if type != column["sql_type"]
|
|
120
|
+
sql << "ALTER COLUMN #{column["name"]} TYPE #{type}"
|
|
121
|
+
end
|
|
122
|
+
execute "ALTER TABLE #{table_name} #{sql.join(', ')}" if sql.any?
|
|
123
|
+
end
|
|
124
|
+
|
|
110
125
|
private
|
|
111
126
|
|
|
112
127
|
def column_definitions(table_name)
|
|
@@ -144,4 +159,5 @@ private
|
|
|
144
159
|
)
|
|
145
160
|
end
|
|
146
161
|
|
|
162
|
+
|
|
147
163
|
end
|