Repository navigation
docs(readme,changelog): document Ent + Atlas + Goose; add operator upgrade notes - #1226
Merged
Merged
Conversation
|
Related Knowledge 1 document with suggested updates is ready for review. kalbasit's Space Development Environment with MinIOView Suggested Changes@@ -38,23 +38,27 @@
[See initialization script](https://github.com/kalbasit/ncps/blob/cf8e19f/nix/process-compose/init-minio.sh)
# Database Migration Transaction Handling
-**IMPORTANT:** Do NOT manually add `BEGIN`/`COMMIT` blocks to your migration files. The `dbmate` tool automatically wraps each migration in a transaction for atomicity. Adding manual transaction blocks will cause errors such as "cannot start a transaction within a transaction."
+**IMPORTANT:** Do NOT manually add `BEGIN`/`COMMIT` blocks to your migration files. Goose automatically wraps each migration in a transaction for atomicity. Adding manual transaction blocks will cause errors such as "cannot start a transaction within a transaction."
**Example:**
```sql
-- ❌ WRONG - Don't add manual transactions
--- migrate:up
BEGIN;
CREATE TABLE example (...);
COMMIT;
--- ✅ CORRECT - Let dbmate handle transactions
--- migrate:up
+-- ✅ CORRECT - Let Goose handle transactions
CREATE TABLE example (...);
```
-Letting dbmate manage transactions ensures that if any part of a migration fails, the entire migration is rolled back, preventing partial or inconsistent database states.
+Letting Goose manage transactions ensures that if any part of a migration fails, the entire migration is rolled back, preventing partial or inconsistent database states.
+
+**Migration Workflow:**
+
+- Schemas are authored under `ent/schema/*.go`
+- Migrations are generated via `go run ./cmd/generate-migrations --name=<descriptive_snake_case>`
+- Migrations are embedded at runtime and applied by `ncps migrate up --cache-database-url=<database-url>`
## Running MinIO and Initialization
Start MinIO and run the initialization process using: |
This was referenced May 21, 2026
kalbasit
force-pushed
the
docs-readme-changelog
branch
from
May 22, 2026 21:42
5801be2 to
300cb72
Compare
kalbasit
added a commit
that referenced
this pull request
May 22, 2026
- Lead with the Taskfile entrypoint (task migrations:gen NAME=...) for generating new migrations, since it regenerates the Ent client first via task ent:generate. Mention the underlying go run invocation in parentheses for users who want the raw command. - The schema_migrations adoption verifies row-count consistency, not parity — the new table intentionally adds a sentinel row, so the expected post-count is preCount + 1. Reword to make that explicit. Addresses gemini-code-assist comments on PR #1226 (PRRT_kwDONV6tZs6D3756, PRRT_kwDONV6tZs6D376E). Co-Authored-By: Claude Opus 4.7 <[email protected]>
kalbasit
force-pushed
the
docs-skills-rewrite-migrate-and-ent-schema
branch
from
May 22, 2026 21:54
711045f to
ed3bd4a
Compare
kalbasit
force-pushed
the
docs-readme-changelog
branch
from
May 22, 2026 21:54
300cb72 to
edc206f
Compare
kalbasit
added a commit
that referenced
this pull request
May 22, 2026
- Lead with the Taskfile entrypoint (task migrations:gen NAME=...) for generating new migrations, since it regenerates the Ent client first via task ent:generate. Mention the underlying go run invocation in parentheses for users who want the raw command. - The schema_migrations adoption verifies row-count consistency, not parity — the new table intentionally adds a sentinel row, so the expected post-count is preCount + 1. Reword to make that explicit. Addresses gemini-code-assist comments on PR #1226 (PRRT_kwDONV6tZs6D3756, PRRT_kwDONV6tZs6D376E). Co-Authored-By: Claude Opus 4.7 <[email protected]>
kalbasit
force-pushed
the
docs-skills-rewrite-migrate-and-ent-schema
branch
from
May 22, 2026 23:02
ed3bd4a to
056f388
Compare
kalbasit
force-pushed
the
docs-readme-changelog
branch
from
May 22, 2026 23:02
edc206f to
43acc87
Compare
kalbasit
added a commit
that referenced
this pull request
May 22, 2026
- Lead with the Taskfile entrypoint (task migrations:gen NAME=...) for generating new migrations, since it regenerates the Ent client first via task ent:generate. Mention the underlying go run invocation in parentheses for users who want the raw command. - The schema_migrations adoption verifies row-count consistency, not parity — the new table intentionally adds a sentinel row, so the expected post-count is preCount + 1. Reword to make that explicit. Addresses gemini-code-assist comments on PR #1226 (PRRT_kwDONV6tZs6D3756, PRRT_kwDONV6tZs6D376E). Co-Authored-By: Claude Opus 4.7 <[email protected]>
kalbasit
force-pushed
the
docs-skills-rewrite-migrate-and-ent-schema
branch
from
May 22, 2026 23:16
056f388 to
13a2787
Compare
kalbasit
force-pushed
the
docs-readme-changelog
branch
from
May 22, 2026 23:16
43acc87 to
04980f2
Compare
kalbasit
added a commit
that referenced
this pull request
May 22, 2026
- Lead with the Taskfile entrypoint (task migrations:gen NAME=...) for generating new migrations, since it regenerates the Ent client first via task ent:generate. Mention the underlying go run invocation in parentheses for users who want the raw command. - The schema_migrations adoption verifies row-count consistency, not parity — the new table intentionally adds a sentinel row, so the expected post-count is preCount + 1. Reword to make that explicit. Addresses gemini-code-assist comments on PR #1226 (PRRT_kwDONV6tZs6D3756, PRRT_kwDONV6tZs6D376E). Co-Authored-By: Claude Opus 4.7 <[email protected]>
kalbasit
force-pushed
the
docs-skills-rewrite-migrate-and-ent-schema
branch
from
May 22, 2026 23:28
13a2787 to
96faf37
Compare
kalbasit
force-pushed
the
docs-readme-changelog
branch
from
May 22, 2026 23:28
04980f2 to
5987ba9
Compare
kalbasit
added a commit
that referenced
this pull request
May 22, 2026
- Lead with the Taskfile entrypoint (task migrations:gen NAME=...) for generating new migrations, since it regenerates the Ent client first via task ent:generate. Mention the underlying go run invocation in parentheses for users who want the raw command. - The schema_migrations adoption verifies row-count consistency, not parity — the new table intentionally adds a sentinel row, so the expected post-count is preCount + 1. Reword to make that explicit. Addresses gemini-code-assist comments on PR #1226 (PRRT_kwDONV6tZs6D3756, PRRT_kwDONV6tZs6D376E). Co-Authored-By: Claude Opus 4.7 <[email protected]>
kalbasit
force-pushed
the
docs-skills-rewrite-migrate-and-ent-schema
branch
from
May 22, 2026 23:54
96faf37 to
7568b3c
Compare
kalbasit
force-pushed
the
docs-readme-changelog
branch
from
May 22, 2026 23:54
5987ba9 to
0ee1edf
Compare
kalbasit
added a commit
that referenced
this pull request
May 22, 2026
- Lead with the Taskfile entrypoint (task migrations:gen NAME=...) for generating new migrations, since it regenerates the Ent client first via task ent:generate. Mention the underlying go run invocation in parentheses for users who want the raw command. - The schema_migrations adoption verifies row-count consistency, not parity — the new table intentionally adds a sentinel row, so the expected post-count is preCount + 1. Reword to make that explicit. Addresses gemini-code-assist comments on PR #1226 (PRRT_kwDONV6tZs6D3756, PRRT_kwDONV6tZs6D376E). Co-Authored-By: Claude Opus 4.7 <[email protected]>
kalbasit
force-pushed
the
docs-skills-rewrite-migrate-and-ent-schema
branch
from
May 23, 2026 00:07
7568b3c to
f4141c3
Compare
kalbasit
force-pushed
the
docs-readme-changelog
branch
from
May 23, 2026 00:08
0ee1edf to
e59499f
Compare
kalbasit
added a commit
that referenced
this pull request
May 23, 2026
- Lead with the Taskfile entrypoint (task migrations:gen NAME=...) for generating new migrations, since it regenerates the Ent client first via task ent:generate. Mention the underlying go run invocation in parentheses for users who want the raw command. - The schema_migrations adoption verifies row-count consistency, not parity — the new table intentionally adds a sentinel row, so the expected post-count is preCount + 1. Reword to make that explicit. Addresses gemini-code-assist comments on PR #1226 (PRRT_kwDONV6tZs6D3756, PRRT_kwDONV6tZs6D376E). Co-Authored-By: Claude Opus 4.7 <[email protected]>
kalbasit
force-pushed
the
docs-skills-rewrite-migrate-and-ent-schema
branch
from
May 23, 2026 00:36
f4141c3 to
968ad67
Compare
kalbasit
force-pushed
the
docs-readme-changelog
branch
from
May 23, 2026 00:36
e59499f to
3e6f57a
Compare
kalbasit
added a commit
that referenced
this pull request
May 23, 2026
- Lead with the Taskfile entrypoint (task migrations:gen NAME=...) for generating new migrations, since it regenerates the Ent client first via task ent:generate. Mention the underlying go run invocation in parentheses for users who want the raw command. - The schema_migrations adoption verifies row-count consistency, not parity — the new table intentionally adds a sentinel row, so the expected post-count is preCount + 1. Reword to make that explicit. Addresses gemini-code-assist comments on PR #1226 (PRRT_kwDONV6tZs6D3756, PRRT_kwDONV6tZs6D376E). Co-Authored-By: Claude Opus 4.7 <[email protected]>
kalbasit
force-pushed
the
docs-skills-rewrite-migrate-and-ent-schema
branch
from
May 23, 2026 03:31
968ad67 to
94dec92
Compare
kalbasit
force-pushed
the
docs-readme-changelog
branch
from
May 23, 2026 03:31
3e6f57a to
c00cc0d
Compare
kalbasit
added a commit
that referenced
this pull request
May 23, 2026
- Lead with the Taskfile entrypoint (task migrations:gen NAME=...) for generating new migrations, since it regenerates the Ent client first via task ent:generate. Mention the underlying go run invocation in parentheses for users who want the raw command. - The schema_migrations adoption verifies row-count consistency, not parity — the new table intentionally adds a sentinel row, so the expected post-count is preCount + 1. Reword to make that explicit. Addresses gemini-code-assist comments on PR #1226 (PRRT_kwDONV6tZs6D3756, PRRT_kwDONV6tZs6D376E). Co-Authored-By: Claude Opus 4.7 <[email protected]>
Owner
Author
|
Automated stack merge failed during the rebase step. The |
…grade notes
Two doc-only changes:
- README.md
- Replace the docker quick-start `dbmate up` invocation with
`ncps migrate up` (the new migrator embeds the migrations and
applies them via goose).
- Add an Architecture section listing the new internal dependencies
(Ent, Atlas-as-library, Goose, Chi, storage backends) and pointing
at the docs for the full design.
- CHANGELOG.md (new file)
- Document the database tooling migration (sqlc + dbmate → Ent +
Atlas + Goose), the removal of `dbmate`/`dbmate-wrapper` and
the `pkg/database/*db/` wrapper packages.
- Operator upgrade procedure: backup first, then the one-shot
adoption that converts the legacy `schema_migrations` table to
the goose shape on first `ncps migrate up`. Calls out the
SQLite/Postgres transactional path and the MySQL backup-table
dance, plus the `--dry-run` preview for large databases.
- Lists the four new `nix flake check` derivations.
Marks tasks 14.7 and 14.8 complete in the migrate-to-ent-and-atlas
change.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1226 +/- ##
=====================================
Coverage 5.50% 5.50%
=====================================
Files 6 6
Lines 400 400
=====================================
Hits 22 22
Misses 374 374
Partials 4 4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two doc-only changes:
README.md
dbmate upinvocation withncps migrate up(the new migrator embeds the migrations andapplies them via goose).
(Ent, Atlas-as-library, Goose, Chi, storage backends) and pointing
at the docs for the full design.
CHANGELOG.md (new file)
Atlas + Goose), the removal of
dbmate/dbmate-wrapperandthe
pkg/database/*db/wrapper packages.adoption that converts the legacy
schema_migrationstable tothe goose shape on first
ncps migrate up. Calls out theSQLite/Postgres transactional path and the MySQL backup-table
dance, plus the
--dry-runpreview for large databases.nix flake checkderivations.Marks tasks 14.7 and 14.8 complete in the migrate-to-ent-and-atlas
change.