UPDATE: Add super admin
All checks were successful
Build and Release / release (push) Successful in 1m20s
All checks were successful
Build and Release / release (push) Successful in 1m20s
This commit is contained in:
@@ -47,8 +47,17 @@ services:
|
|||||||
- |
|
- |
|
||||||
DB_URL="postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}?sslmode=disable"
|
DB_URL="postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}?sslmode=disable"
|
||||||
|
|
||||||
echo "Running migrations..."
|
for i in 1 2 3; do
|
||||||
/migrate -path /migrations -database "$$DB_URL" up
|
echo "Migration attempt $$i..."
|
||||||
|
if /migrate -path /migrations -database "$$DB_URL" up; then
|
||||||
|
echo "Migration success"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
sleep 2
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "Migration failed after 3 attempts"
|
||||||
|
exit 1
|
||||||
networks:
|
networks:
|
||||||
- history-api-project
|
- history-api-project
|
||||||
|
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ func SeedSuperAdmin(pool *pgxpool.Pool) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
role, err := q.GetRoleByName(ctx, constants.USER.String())
|
role, err := q.GetRoleByName(ctx, constants.ADMIN.String())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user