Sha256: 050af2131672df6c18f7691090227b2634388554e6442fe05a36e5f156954d65

Contents?: true

Size: 398 Bytes

Versions: 21

Compression:

Stored size: 398 Bytes

Contents

class AddThreeStateBooleanType < ActiveRecord::Migration[5.2]
  def up
  end
  def up
    execute <<-SQL
      DO $$
        BEGIN
          IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'three_state') THEN
            CREATE TYPE three_state AS ENUM ('Y', 'N', 'U');
          END IF;
        END
      $$;
    SQL
  end

  def down
    execute "DROP TYPE IF EXISTS three_state;"
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
better_record-0.25.2 db/migrate/20190416215152_add_three_state_boolean_type.rb
better_record-0.25.1 db/migrate/20190416215152_add_three_state_boolean_type.rb
better_record-0.25.0 db/migrate/20190416215152_add_three_state_boolean_type.rb
better_record-0.24.4 db/migrate/20190416215152_add_three_state_boolean_type.rb
better_record-0.24.3 db/migrate/20190416215152_add_three_state_boolean_type.rb
better_record-0.23.7 db/migrate/20190416215152_add_three_state_boolean_type.rb
better_record-0.23.6 db/migrate/20190416215152_add_three_state_boolean_type.rb
better_record-0.23.5 db/migrate/20190416215152_add_three_state_boolean_type.rb
better_record-0.23.4 db/migrate/20190416215152_add_three_state_boolean_type.rb
better_record-0.23.3 db/migrate/20190416215152_add_three_state_boolean_type.rb
better_record-0.22.9 db/migrate/20190416215152_add_three_state_boolean_type.rb
better_record-0.22.8 db/migrate/20190416215152_add_three_state_boolean_type.rb
better_record-0.22.7 db/migrate/20190416215152_add_three_state_boolean_type.rb
better_record-0.22.6 db/migrate/20190416215152_add_three_state_boolean_type.rb
better_record-0.22.5 db/migrate/20190416215152_add_three_state_boolean_type.rb
better_record-0.22.4 db/migrate/20190416215152_add_three_state_boolean_type.rb
better_record-0.22.3 db/migrate/20190416215152_add_three_state_boolean_type.rb
better_record-0.21.3 db/migrate/20190416215152_add_three_state_boolean_type.rb
better_record-0.22.2 db/migrate/20190416215152_add_three_state_boolean_type.rb
better_record-0.22.0 db/migrate/20190416215152_add_three_state_boolean_type.rb