neoorm 0.8.8 → 0.8.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/neoorm.d.ts.map +1 -1
- package/dist/bin/neoorm.js +49 -7
- package/dist/bin/neoorm.js.map +1 -1
- package/dist/migrate/runner.d.ts +14 -0
- package/dist/migrate/runner.d.ts.map +1 -1
- package/dist/migrate/runner.js +135 -24
- package/dist/migrate/runner.js.map +1 -1
- package/dist/runtime/error-codes.d.ts +1 -0
- package/dist/runtime/error-codes.d.ts.map +1 -1
- package/dist/runtime/error-codes.js +1 -0
- package/dist/runtime/error-codes.js.map +1 -1
- package/dist/runtime/errors.d.ts.map +1 -1
- package/dist/runtime/errors.js +4 -1
- package/dist/runtime/errors.js.map +1 -1
- package/dist/runtime/schema-error.d.ts +2 -0
- package/dist/runtime/schema-error.d.ts.map +1 -1
- package/dist/runtime/schema-error.js +18 -0
- package/dist/runtime/schema-error.js.map +1 -1
- package/dist/studio/er-layout.d.ts +23 -0
- package/dist/studio/er-layout.d.ts.map +1 -0
- package/dist/studio/er-layout.js +111 -0
- package/dist/studio/er-layout.js.map +1 -0
- package/dist/studio/server.d.ts +3 -0
- package/dist/studio/server.d.ts.map +1 -1
- package/dist/studio/server.js +51 -0
- package/dist/studio/server.js.map +1 -1
- package/dist/studio-ui/assets/{index-Leicgvwr.js → index-ByHGD2Z0.js} +6 -6
- package/dist/studio-ui/index.html +1 -1
- package/docs/cli.md +3 -2
- package/docs/migrations.md +8 -2
- package/docs/studio.md +2 -1
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<meta charset="utf-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
6
|
<title>NeoOrm Studio</title>
|
|
7
|
-
<script type="module" crossorigin src="./assets/index-
|
|
7
|
+
<script type="module" crossorigin src="./assets/index-ByHGD2Z0.js"></script>
|
|
8
8
|
<link rel="stylesheet" crossorigin href="./assets/index-wQS4sFQ_.css">
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
package/docs/cli.md
CHANGED
|
@@ -34,7 +34,7 @@ Options:
|
|
|
34
34
|
|
|
35
35
|
## `neoorm migrate dev`
|
|
36
36
|
|
|
37
|
-
Apply pending migrations, then generate a new migration if the schema changed.
|
|
37
|
+
Apply pending migrations, then generate a new migration if the schema changed. If a pending `CREATE TABLE` targets a relation that already exists, catch the live database up to `schema.ts` and record those files as applied instead of re-running the create.
|
|
38
38
|
|
|
39
39
|
```
|
|
40
40
|
neoorm migrate dev
|
|
@@ -42,7 +42,7 @@ neoorm migrate dev
|
|
|
42
42
|
|
|
43
43
|
## `neoorm migrate deploy`
|
|
44
44
|
|
|
45
|
-
Apply all pending migrations.
|
|
45
|
+
Apply all pending migrations. Throws `migration_drift` if a pending `CREATE TABLE` would hit an existing relation.
|
|
46
46
|
|
|
47
47
|
```
|
|
48
48
|
neoorm migrate deploy
|
|
@@ -113,6 +113,7 @@ Options:
|
|
|
113
113
|
- `--read-only` — block row mutations and non-read SQL
|
|
114
114
|
- `--verbose` — log SQL statements executed by Studio
|
|
115
115
|
- `--token <token>` — require this token for API access (generated automatically when binding a non-loopback host)
|
|
116
|
+
- `--er-layout <path>` — enable team-shared ER layout stored at `<path>` (e.g. `./neoorm.er-layout.json`); `PUT` is blocked under `--read-only`
|
|
116
117
|
|
|
117
118
|
See [Studio](studio.md) for features, keyboard shortcuts, and security notes.
|
|
118
119
|
|
package/docs/migrations.md
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
|---------|-------------|
|
|
7
7
|
| `neoorm init` | Scaffold `neoorm.config.ts`, `schema.ts`, `.env.example` only (no codegen or migrations; run `neoorm migrate dev` after) |
|
|
8
8
|
| `neoorm generate` | Emit manifest, typed client, models, includes, and migrations |
|
|
9
|
-
| `neoorm migrate dev` | Apply pending migrations, then generate a new one if
|
|
10
|
-
| `neoorm migrate deploy` | Apply pending migrations |
|
|
9
|
+
| `neoorm migrate dev` | Apply pending migrations (or record colliding CREATE TABLE files against the live schema), then generate a new one if `schema.ts` changed |
|
|
10
|
+
| `neoorm migrate deploy` | Apply pending migrations (throws `migration_drift` if a pending `CREATE TABLE` targets a relation that already exists) |
|
|
11
11
|
| `neoorm migrate status` | List applied vs pending migrations |
|
|
12
12
|
| `neoorm migrate down [--steps N]` | Roll back the last N applied migrations (default 1) |
|
|
13
13
|
| `neoorm migrate reset --force` | Drop the `public` schema (PostgreSQL) or all tables (SQLite / MySQL / MariaDB) and re-apply migrations (local dev) |
|
|
@@ -31,6 +31,12 @@ When migration is blocked, the CLI explains why — for example unsupported type
|
|
|
31
31
|
neoorm generate --accept-data-loss
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
+
## Existing tables vs pending CREATE TABLE
|
|
35
|
+
|
|
36
|
+
`generate` diffs `snapshot.json`. If that file is missing, the first migration is a full `CREATE TABLE` script. `migrate deploy` will not run that SQL when those relations already exist (for example after `db push`). It throws `migration_drift` before any user statement.
|
|
37
|
+
|
|
38
|
+
`neoorm migrate dev` detects the same collision, diffs the live database to `schema.ts`, applies that catch-up SQL (often none, sometimes `ALTER`), records the pending files in `_neoorm_migrations` using the on-disk checksums, and writes `snapshot.json`. Destructive catch-up still requires `--accept-data-loss`. Empty databases still run `CREATE TABLE` as before.
|
|
39
|
+
|
|
34
40
|
## Deploy locking and checksums
|
|
35
41
|
|
|
36
42
|
`neoorm migrate deploy` serializes concurrent runs and records a SHA-256 checksum of each applied `migration.sql`:
|
package/docs/studio.md
CHANGED
|
@@ -31,7 +31,8 @@ Build `findMany`, `findFirst`, `findUnique`, `findById`, `count`, `exists`, `agg
|
|
|
31
31
|
## Schema, ER, migrate
|
|
32
32
|
|
|
33
33
|
- Schema explorer: columns, kinds, constraints, indexes (including partial `WHERE`), foreign keys, and relations per table. Read-only — schema changes belong in `schema.ts` plus `migrate dev`.
|
|
34
|
-
- ER graph: tables as nodes, `1:1` / `1:n` / `n:n` edges, junction tables hidden by default. Click a node to open its data.
|
|
34
|
+
- ER graph: tables as nodes, `1:1` / `1:n` / `n:n` edges, junction tables hidden by default. Click a node to open its data. Drag tables to rearrange — positions, the junction toggle, and the viewport (pan/zoom) persist in `localStorage` per schema. `Reset layout` restores the auto-grid; `Export`/`Import JSON` moves a layout between browsers.
|
|
35
|
+
- Team-shared ER layout (opt-in): restart Studio with `neoorm studio --er-layout ./neoorm.er-layout.json`, switch Scope to `Team`, then `Push to team` / `Pull from team`. The file is committable so the whole team sees the same arrangement. Without the flag the server answers `404` and local layout still works.
|
|
35
36
|
- Migrate status: applied, pending, and orphan migrations. Studio never applies, resets, or rolls back migrations — use the CLI.
|
|
36
37
|
|
|
37
38
|
## Keyboard
|