Sha256: fe84f987f448c58fe84ef56768be8898c346506a118cf55b41dab20500158bda
Contents?: true
Size: 1017 Bytes
Versions: 2
Compression:
Stored size: 1017 Bytes
Contents
# frozen_string_literal: true class CreateActiveFieldsTables < ActiveRecord::Migration[6.0] def change create_table :active_fields do |t| t.string :name, null: false t.string :type, null: false t.string :customizable_type, null: false t.jsonb :default_value_meta, null: false, default: {} t.jsonb :options, null: false, default: {} t.timestamps t.index %i[name customizable_type], unique: true t.index :customizable_type end create_table :active_fields_values do |t| t.references :customizable, polymorphic: true, null: false, index: false t.references :active_field, null: false, foreign_key: { to_table: :active_fields, name: "active_fields_values_active_field_id_fk" } t.jsonb :value_meta, null: false, default: {} t.timestamps t.index %i[customizable_type customizable_id active_field_id], unique: true, name: "index_active_fields_values_on_customizable_and_field" end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
active_fields-1.1.0 | db/migrate/20240229230000_create_active_fields_tables.rb |
active_fields-1.0.0 | db/migrate/20240229230000_create_active_fields_tables.rb |