forked from templates/template-go-orm
[CI SKIP] Initial commit
This commit is contained in:
20
docs/DEVELOPER.md
Normal file
20
docs/DEVELOPER.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# Разработчику
|
||||
|
||||
## Окружение
|
||||
|
||||
Перейдите в каталог репозитория и настройте переменные окружения (см. `README.md`).
|
||||
|
||||
Пример `.env`:
|
||||
|
||||
```
|
||||
DEV_DB_URL=postgresql://user:pass@localhost:5432/project-dev?sslmode=disable
|
||||
DB_URL=postgresql://user:pass@localhost:5432/project?sslmode=disable
|
||||
```
|
||||
|
||||
## Миграции
|
||||
|
||||
- Первичная миграция: `make initial`.
|
||||
- Новая миграция после изменений схем: `make migration`.
|
||||
- Применить миграции: `make apply`.
|
||||
|
||||
Все команды используют `DEV_DB_URL` и `DB_URL` из окружения.
|
||||
14
docs/diagrams/mermaid.esm.min.mjs
Normal file
14
docs/diagrams/mermaid.esm.min.mjs
Normal file
File diff suppressed because one or more lines are too long
36
docs/diagrams/preview.html
Normal file
36
docs/diagrams/preview.html
Normal file
@@ -0,0 +1,36 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>ORM Template — User ERD</title>
|
||||
<style>
|
||||
body { font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, 'Helvetica Neue', Arial; padding: 16px; }
|
||||
h2 { margin-bottom: 4px; }
|
||||
h3 { margin-top: 28px; }
|
||||
.hint { color: #666; font-size: 0.9em; }
|
||||
pre.mermaid { border: 1px solid #ddd; border-radius: 8px; padding: 12px; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h2>ORM Template — ER-диаграмма</h2>
|
||||
<div class="hint">Единственная модель: User и ее атрибуты.</div>
|
||||
|
||||
<pre class="mermaid">
|
||||
erDiagram
|
||||
USER {
|
||||
uuid id PK "первичный ключ пользователя"
|
||||
text login "уникальный логин"
|
||||
text password "хэш пароля"
|
||||
text role "роль пользователя"
|
||||
bool is_active "активность"
|
||||
bool is_temporal "пароль временный, хранится в открытом виде"
|
||||
timestamptz created_at "дата создания"
|
||||
}
|
||||
</pre>
|
||||
|
||||
<script type="module">
|
||||
import mermaid from "https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs";
|
||||
mermaid.initialize({ startOnLoad: true, theme: "neutral" });
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user