module Sequent::Migrations::Sql
Public Instance Methods
Source
# File lib/sequent/migrations/sql.rb, line 14 def exec_sql(sql) Sequent::ApplicationRecord.connection.execute(sql) end
Source
# File lib/sequent/migrations/sql.rb, line 8 def sql_file_to_statements(file_location) sql_string = File.read(file_location, encoding: 'bom|utf-8') sql_string = yield(sql_string) if block_given? sql_string.split(/;$/).reject { |statement| statement.remove("\n").blank? } end