title: DEFAULT is not allowed in this context error
body: <p>Im trying to add an index to the database but I keep getting an error:</p>
  <blockquote>
  <p><code>PG::SyntaxError: ERROR:  DEFAULT is not allowed in this context</code></p>
  </blockquote>
  <p>After reading the documentation for hours I can't seem to fix the issue.</p>
  <p>I'm running this:</p>
  <pre><code>&quot;CREATE UNIQUE INDEX index_uniq_service_models_default ON service_models(zone_id) WHERE default&quot;
  </code></pre>
  <p>My table looks like this:</p>
  <pre><code>create_table :service_models do |t|
    t.string :name, null: false
    t.jsonb :configuration, null: false, default: &quot;{}&quot;
    t.boolean :default, null: false
    t.json :metadata, null: false, default: &quot;{}&quot;
    t.references :zone, foreign_key: true, null: false, index: { name: idx_name(:service_models, :zones) }
  
    t.timestamps
  end
  </code></pre>
  <p>What I want to do is for a ServiceModel to only have 1 default for a zone.</p>
  <p>A zone can have many ServiceModels but it can only have 1 default one.</p>