Sha256: 57dc42bfe02cf3d5ad0b8ddb79d16d6b37f9c4e8a86a001b5cbac9e219435522
Contents?: true
Size: 536 Bytes
Versions: 9
Compression:
Stored size: 536 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
9 entries across 9 versions & 1 rubygems