1, Quản lý migration : golang-migrate

Fiber KHÔNG có migration built-in như Laravel, nhưng bạn hoàn toàn có thể dùng migration thông qua các tool bên ngoài (rất phổ biến trong Go). Và phổ biến nhất trong đó là

Cách cài đặt

Tạo file migration

Khởi tạo lệnh sẽ tạo ra 2 file

000001_create_users_table.up.sql

000002_create_users_table.down.sql

Ví dụ về nội dung up

Ví dụ về nội dung down

Chạy migration

2, QUản lý biến môi trường godotenv

Cài đặt

 

 

 

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments