Sha256: 6f32689f6a133523a2273837621d00549b400b8fbeb0d577832e158021b5daee

Contents?: true

Size: 1.08 KB

Versions: 45

Compression:

Stored size: 1.08 KB

Contents

class CreateEcomCoreMenus < ActiveRecord::Migration[6.0]
  def change
    create_table :ecom_core_menus do |t|
      t.string :label, null: false
      t.string :icon
      t.string :route, null: false
      t.references :parent,
                   null: true,
                   index: false,
                   foreign_key: { to_table: :ecom_core_menus }
      t.references :application_module,
                   null: false,
                   index: { name: 'menus_on_am_indx' },
                   foreign_key: { to_table: :ecom_core_application_modules }

      t.timestamps
    end

    create_table :ecom_core_menus_user_roles, id: false do |t|
      t.references :menu,
                   null: false,
                   index: false,
                   foreign_key: { to_table: :ecom_core_menus }
      t.references :user_role,
                   null: false,
                   index: false,
                   foreign_key: { to_table: :ecom_core_user_roles }
    end

    add_index :ecom_core_menus_user_roles, %i[menu_id user_role_id], unique: true, name: 'menus_user_roles_indx'
  end
end

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
ecom_core-1.2.11 db/migrate/20191202221423_create_ecom_core_menus.rb
ecom_core-1.2.10 db/migrate/20191202221423_create_ecom_core_menus.rb
ecom_core-1.2.9 db/migrate/20191202221423_create_ecom_core_menus.rb
ecom_core-1.2.7 db/migrate/20191202221423_create_ecom_core_menus.rb
ecom_core-1.2.6 db/migrate/20191202221423_create_ecom_core_menus.rb