down migration independent of removed menu type

pull/9957/head
ulferts 3 years ago
parent 09ab5c8df0
commit d031a04863
No known key found for this signature in database
GPG Key ID: A205708DE1284017
  1. 18
      db/migrate/20211209092519_query_views.rb

@ -78,12 +78,20 @@ class QueryViews < ActiveRecord::Migration[6.1]
# Consciously avoiding the use of a PostgreSQL 13.0 feature (gen_random_uuid())
Query.where(starred: true).find_each do |query|
::MenuItem.create(
type: 'MenuItems::QueryMenuItem',
navigatable_id: query.id,
name: SecureRandom.uuid,
title: query.name
execute <<~SQL.squish
INSERT INTO
menu_items (
type,
navigatable_id,
name,
title
) VALUES (
'MenuItems::QueryMenuItem',
#{query.id},
'#{SecureRandom.uuid}',
'#{query.name}'
)
SQL
end
execute <<~SQL.squish

Loading…
Cancel
Save