bubble_chart StackLab

Database Migration

19 steps · pending Not started · person_outline Guest
arrow_back Back

Recommended project structure

As the PHP application grows, it is helpful to keep database changes separate from application logic. A clean structure could look like this:

code text
your-project/
│
├── database/
│   ├── migrations/
│   │   ├── 001_create_students.sql
│   │   ├── 002_create_books.sql
│   │   ├── 003_create_borrow.sql
│   │   └── 004_seed_data.sql
│   │
│   └── README.md
│
├── app/
│   ├── config/
│   │   └── database.php
│   │
│   ├── repositories/
│   │   ├── StudentRepository.php
│   │   ├── BookRepository.php
│   │   └── BorrowRepository.php
│   │
│   ├── services/
│   │   ├── StudentService.php
│   │   ├── BookService.php
│   │   └── BorrowService.php
│   │
│   └── ...
│
└── index.php
The responsibilities are easier to understand when separated ```

login Sign in to save your progress permanently. info Progress is saved in your browser session
format_list_numbered Step 18 of 19