Skip to content

Commit 59df166

Browse files
authored
Remove warning about composite primary key adjustment in articles_tags migration (#8355)
1 parent 74820d0 commit 59df166

1 file changed

Lines changed: 1 addition & 22 deletions

File tree

‎docs/en/tutorials-and-examples/cms/database.md‎

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -96,28 +96,7 @@ class CreateArticles extends BaseMigration
9696

9797
:::
9898

99-
::: warning Composite Primary Key Adjustment
100-
The `articles_tags` migration will need manual adjustment. The generated migration sets both columns to auto-increment:
101-
102-
```php
103-
$table->addColumn('article_id', 'integer', [
104-
'autoIncrement' => true, // [!code --]
105-
'default' => null,
106-
'limit' => 11,
107-
'null' => false,
108-
]);
109-
$table->addColumn('tag_id', 'integer', [
110-
'autoIncrement' => true, // [!code --]
111-
'default' => null,
112-
'limit' => 11,
113-
'null' => false,
114-
]);
115-
```
116-
117-
Remove the `autoIncrement` lines before running the migration to prevent foreign key problems.
118-
:::
119-
120-
Once the `articles_tags` migration is corrected, run the migrations to create the tables:
99+
Run the migrations to create the tables:
121100

122101
```bash
123102
bin/cake migrations migrate

0 commit comments

Comments
 (0)