title: Yii2: How to add a CHECK CONSTRAINT to my model?
body: <p>I have a <strong>CHECK CONTRAINT</strong> of a table in my PostgreSQL database:</p>
  
  <pre><code>CHECK (since &lt;= until)
  </code></pre>
  
  <p><strong>since</strong> and <strong>until</strong> are dates.</p>
  
  <p>I would like to add this constraint to my model but I don't know how to do it:</p>
  
  <pre><code>public function rules()
  {
      return [
          [['since', 'until'], 'required'],
          [['since', 'until'], 'safe'],
      ];
  }
  </code></pre>