retrospring/db/migrate/20231220130817_allow_multiple_themes.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
362 B
Ruby
Raw Permalink Normal View History

2023-12-20 14:49:05 +01:00
# frozen_string_literal: true
class AllowMultipleThemes < ActiveRecord::Migration[7.0]
def up
change_table :themes, bulk: true do |t|
t.boolean :active, default: true, null: false
t.string :name, null: true
end
change_column :themes, :active, :boolean, default: false, null: false
add_index :themes, %i[user_id active]
end
end