20190713000001_group_dependent_macros.rb 517 B

1234567891011121314151617181920
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class GroupDependentMacros < ActiveRecord::Migration[4.2]
  3. def up
  4. create_table :groups_macros, id: false do |t|
  5. t.references :macro, null: false
  6. t.references :group, null: false
  7. end
  8. add_index :groups_macros, [:macro_id]
  9. add_index :groups_macros, [:group_id]
  10. add_foreign_key :groups_macros, :macros
  11. add_foreign_key :groups_macros, :groups
  12. end
  13. def self.down
  14. drop_table :groups_macros
  15. end
  16. end