Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions docs/en/tutorials-and-examples/cms/database.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@ bin/cake bake migration CreateUsers email:string password:string created modifie
bin/cake bake migration CreateArticles user_id:integer title:string slug:string[191]:unique body:text published:boolean created modified
bin/cake bake migration CreateTags title:string[191]:unique created modified
bin/cake bake migration CreateArticlesTags article_id:integer:primary tag_id:integer:primary created modified

# Run migrations to create tables
bin/cake migrations migrate
```

```php [Migration Example]
Expand Down Expand Up @@ -120,6 +117,12 @@ $table->addColumn('tag_id', 'integer', [
Remove the `autoIncrement` lines before running the migration to prevent foreign key problems.
:::

Once the `articles_tags` migration is corrected, run the migrations to create the tables:

```bash
bin/cake migrations migrate
```

#### Adding Seed Data

Create seed files to populate initial data:
Expand Down