Sha256: 6151beeed926724db69eed2e0e6aa05091b6293bbdbcde75eaf933ab18de81ab
Contents?: true
Size: 540 Bytes
Versions: 15
Compression:
Stored size: 540 Bytes
Contents
class CreateCurrent<%= @data[:classname_downcase] %> < ActiveRecord::Migration[<%= @data[:ar_version] %>] def self.up execute <<-SQL CREATE VIEW current<%= @data[:plural] %> AS SELECT id as org_id, <%= @data[:ary].map{|x| x.name }.join(" , ") %> FROM <%= @data[:plural] %> where not exists (select * from invalid<%= @data[:plural] %> where invalid<%= @data[:plural] %>.org_id = <%= @data[:plural] %>.id ) SQL end def self.down execute <<-SQL DROP VIEW current<%= @data[:plural] %> SQL end end
Version data entries
15 entries across 15 versions & 1 rubygems