checkUniqueConstraintException example

'fields' => [
        'field' => [
          'type' => 'varchar',
          'length' => 50,
        ],
      ],
      'unique keys' => [
        'field' => [['field', 10]],
      ],
    ]);

    $this->checkUniqueConstraintException('test_unique', 'field');
  }

  /** * Tests adding a UNIQUE key to an existing table. * * @covers ::addUniqueKey */
  public function testAddUniqueKey(): void {
    $this->connection->schema()
      ->addUniqueKey('test_people', 'job', [['job', 10]]);

    
Home | Imprint | This part of the site doesn't use cookies.