<commit_before>class CreateAssetGroups < ActiveRecord::Migration
  def change
    create_table :asset_groups do |t|
      t.string    :type,            :null => false, :limit => 50
      t.string    :name,            :null => false, :limit => 200, :index => :unique

      # Nested set
      t.integer   :asset_group_id,  :null => true,  :on_delete => :cascade
      t.integer   :lft,             :null => true
      t.integer   :rgt,             :null => true
      t.integer   :depth,           :null => false, :limit => 3, :default => 1
      t.integer   :children_count,  :null => false, :limit => 3, :default => 0
<commit_msg>Change the unique constraints on the asset group name to apply only within a leaf of the hierarchy.<commit_after>class CreateAssetGroups < ActiveRecord::Migration
  def change
    create_table :asset_groups do |t|
      t.string    :type,            :null => false, :limit => 50
      t.string    :name,            :null => false, :limit => 200, :index => {:unique => true, :with => :asset_group_id}

      # Nested set
      t.integer   :asset_group_id,  :null => true,  :on_delete => :cascade
      t.integer   :lft,             :null => true
      t.integer   :rgt,             :null => true
      t.integer   :depth,           :null => false, :limit => 3, :default => 1
      t.integer   :children_count,  :null => false, :limit => 3, :default => 0

{'fraction_non_alphanumeric': 0.1315028901734104, 'fraction_numerical': 0.01300578034682081, 'mean_word_length': 2.1334841628959276, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '927509', 'n_tokens_mistral': 438, 'n_tokens_neox': 418, 'n_words': 130}