Skip to content

raw SQL doesn't get interpreted by apartment to use schemas #659

@DonGiulio

Description

@DonGiulio

Steps to reproduce

create a migration with raw sql in it,

for example:

`

class createListView < ActiveRecord::Migration
  def up
    execute <<-SQL
    create view list as
      SELECT
      'House' AS type,
      houses.id AS id
      FROM houses
      WHERE houses.id IS NOT NULL
      UNION
      SELECT
      'Apartment' AS type,
      apartments.id AS id,
      FROM apartments
      WHERE apartments.id IS NOT NULL;
    SQL
  end

  def down
    execute 'drop view list'
  end
end

`

Expected behavior

a view is created on all tenant schemas

Actual behavior

schemas don't have the view, only the public schema has it.

System configuration

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions