modified: serv_nginx/api_bb/Makefile
modified: serv_nginx/api_bb/internal/database/migrate.go set auto migrate for api_bb reviews table
This commit is contained in:
@@ -6,7 +6,7 @@ stop_bb:
|
|||||||
docker compose down api_bb
|
docker compose down api_bb
|
||||||
|
|
||||||
build_bb:
|
build_bb:
|
||||||
docker compose build ${BB} --no-cache
|
docker compose build api_bb --no-cache
|
||||||
|
|
||||||
run_bb: build
|
run_bb: build
|
||||||
docker compose up api_bb -d
|
docker compose up api_bb -d
|
||||||
@@ -18,6 +18,7 @@ func (d *Database) Migrate() error {
|
|||||||
&models.User{},
|
&models.User{},
|
||||||
&models.News{},
|
&models.News{},
|
||||||
&models.Comment{},
|
&models.Comment{},
|
||||||
|
&models.Review{},
|
||||||
// Добавьте другие модели здесь
|
// Добавьте другие модели здесь
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,6 +73,8 @@ func getModelName(model interface{}) string {
|
|||||||
return "News"
|
return "News"
|
||||||
case *models.Comment:
|
case *models.Comment:
|
||||||
return "Comment"
|
return "Comment"
|
||||||
|
case *models.Review:
|
||||||
|
return "Reviews"
|
||||||
default:
|
default:
|
||||||
return "Unknown"
|
return "Unknown"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user