lib/ridgepole/dsl_parser/context.rb in ridgepole-1.0.7 vs lib/ridgepole/dsl_parser/context.rb in ridgepole-1.1.0
- old
+ new
@@ -89,28 +89,9 @@
to_table: to_table,
options: options,
}
end
- def add_partition(table_name, type, columns, partition_definitions: [])
- partition_definitions.each do |partition_definition|
- values = partition_definition.fetch(:values)
- raise ArgumentError unless values.is_a?(Hash)
-
- if values.key?(:in)
- values[:in] = Array.wrap(values[:in])
- values[:in] = values[:in].map(&:to_s) if Ridgepole::ConnectionAdapters.postgresql?
- end
- values[:to] = Array.wrap(values[:to]) if values.key?(:to)
- values[:from] = Array.wrap(values[:from]) if values.key?(:from)
- end
- @__definition[table_name][:partition] = {
- type: type,
- columns: Array.wrap(columns),
- partition_definitions: partition_definitions,
- }
- end
-
def require(file)
schemafile = %r{\A/}.match?(file) ? file : File.join(@__working_dir, file)
if File.exist?(schemafile)
instance_eval(File.read(schemafile), schemafile)