From def97738ecd301b17fcc73a20c05c94374b603b2 Mon Sep 17 00:00:00 2001 From: Chris Nizzardini Date: Wed, 20 Apr 2022 19:54:53 -0400 Subject: [PATCH] Unique index sample Adds a unique index sample. --- docs/en/index.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/en/index.rst b/docs/en/index.rst index 2a4600e9..f3208f78 100644 --- a/docs/en/index.rst +++ b/docs/en/index.rst @@ -364,7 +364,10 @@ will generate:: { $table = $this->table('products'); $table->addColumn('name', 'string') + ->addColumn('email', 'string') ->addIndex(['name']) + // add a unique index: + ->addIndex('email', ['unique' => true]) ->update(); } }