@c9up/atlas 0.2.0 → 0.2.1
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/README.md +8 -0
- package/db.darwin-arm64.node +0 -0
- package/db.darwin-x64.node +0 -0
- package/db.linux-arm64-gnu.node +0 -0
- package/db.linux-x64-gnu.node +0 -0
- package/db.win32-x64-msvc.node +0 -0
- package/dist/AtlasProvider.d.ts +60 -7
- package/dist/AtlasProvider.d.ts.map +1 -1
- package/dist/AtlasProvider.js +204 -38
- package/dist/AtlasProvider.js.map +1 -1
- package/dist/BaseEntity.d.ts +17 -0
- package/dist/BaseEntity.d.ts.map +1 -1
- package/dist/BaseEntity.js.map +1 -1
- package/dist/BaseModel.d.ts +63 -27
- package/dist/BaseModel.d.ts.map +1 -1
- package/dist/BaseModel.js +108 -51
- package/dist/BaseModel.js.map +1 -1
- package/dist/BaseRepository.d.ts +11 -1
- package/dist/BaseRepository.d.ts.map +1 -1
- package/dist/BaseRepository.js +95 -20
- package/dist/BaseRepository.js.map +1 -1
- package/dist/ConnectionManager.d.ts +106 -0
- package/dist/ConnectionManager.d.ts.map +1 -0
- package/dist/ConnectionManager.js +228 -0
- package/dist/ConnectionManager.js.map +1 -0
- package/dist/ModelQuery.d.ts +256 -43
- package/dist/ModelQuery.d.ts.map +1 -1
- package/dist/ModelQuery.js +899 -231
- package/dist/ModelQuery.js.map +1 -1
- package/dist/Transaction.d.ts +54 -1
- package/dist/Transaction.d.ts.map +1 -1
- package/dist/Transaction.js +121 -59
- package/dist/Transaction.js.map +1 -1
- package/dist/adapters/NapiDbAdapter.d.ts +11 -0
- package/dist/adapters/NapiDbAdapter.d.ts.map +1 -1
- package/dist/adapters/NapiDbAdapter.js +35 -7
- package/dist/adapters/NapiDbAdapter.js.map +1 -1
- package/dist/console/contract.d.ts +62 -0
- package/dist/console/contract.d.ts.map +1 -0
- package/dist/console/contract.js +38 -0
- package/dist/console/contract.js.map +1 -0
- package/dist/console/factoryCommands.d.ts +23 -0
- package/dist/console/factoryCommands.d.ts.map +1 -0
- package/dist/console/factoryCommands.js +62 -0
- package/dist/console/factoryCommands.js.map +1 -0
- package/dist/console/migrationCommands.d.ts +38 -8
- package/dist/console/migrationCommands.d.ts.map +1 -1
- package/dist/console/migrationCommands.js +157 -50
- package/dist/console/migrationCommands.js.map +1 -1
- package/dist/console/schemaCheckCommand.d.ts +11 -17
- package/dist/console/schemaCheckCommand.d.ts.map +1 -1
- package/dist/console/schemaCheckCommand.js +21 -15
- package/dist/console/schemaCheckCommand.js.map +1 -1
- package/dist/console/schemaDumpCommand.d.ts +30 -0
- package/dist/console/schemaDumpCommand.d.ts.map +1 -0
- package/dist/console/schemaDumpCommand.js +69 -0
- package/dist/console/schemaDumpCommand.js.map +1 -0
- package/dist/console/schemaGenerateCommand.d.ts +100 -0
- package/dist/console/schemaGenerateCommand.d.ts.map +1 -0
- package/dist/console/schemaGenerateCommand.js +246 -0
- package/dist/console/schemaGenerateCommand.js.map +1 -0
- package/dist/console/seederCommands.d.ts +46 -0
- package/dist/console/seederCommands.d.ts.map +1 -0
- package/dist/console/seederCommands.js +136 -0
- package/dist/console/seederCommands.js.map +1 -0
- package/dist/decorators/entity.d.ts +13 -2
- package/dist/decorators/entity.d.ts.map +1 -1
- package/dist/decorators/entity.js +10 -0
- package/dist/decorators/entity.js.map +1 -1
- package/dist/decorators/hooks.d.ts +3 -3
- package/dist/decorators/hooks.d.ts.map +1 -1
- package/dist/decorators/hooks.js.map +1 -1
- package/dist/events.d.ts +5 -0
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js.map +1 -1
- package/dist/factories.d.ts +8 -0
- package/dist/factories.d.ts.map +1 -0
- package/dist/factories.js +8 -0
- package/dist/factories.js.map +1 -0
- package/dist/index.d.ts +11 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -4
- package/dist/index.js.map +1 -1
- package/dist/lucid-schema.d.ts +15 -0
- package/dist/lucid-schema.d.ts.map +1 -0
- package/dist/lucid-schema.js +16 -0
- package/dist/lucid-schema.js.map +1 -0
- package/dist/orm.d.ts +14 -0
- package/dist/orm.d.ts.map +1 -0
- package/dist/orm.js +14 -0
- package/dist/orm.js.map +1 -0
- package/dist/query/DatabaseQueryBuilder.d.ts +557 -0
- package/dist/query/DatabaseQueryBuilder.d.ts.map +1 -0
- package/dist/query/DatabaseQueryBuilder.js +1798 -0
- package/dist/query/DatabaseQueryBuilder.js.map +1 -0
- package/dist/query/DmlBuilder.d.ts +62 -0
- package/dist/query/DmlBuilder.d.ts.map +1 -0
- package/dist/query/DmlBuilder.js +84 -0
- package/dist/query/DmlBuilder.js.map +1 -0
- package/dist/query/QueryBuilder.d.ts +5 -0
- package/dist/query/QueryBuilder.d.ts.map +1 -1
- package/dist/query/QueryBuilder.js +7 -0
- package/dist/query/QueryBuilder.js.map +1 -1
- package/dist/query/RawQueryBuilder.d.ts +47 -0
- package/dist/query/RawQueryBuilder.d.ts.map +1 -0
- package/dist/query/RawQueryBuilder.js +138 -0
- package/dist/query/RawQueryBuilder.js.map +1 -0
- package/dist/query/interpolate.d.ts +45 -0
- package/dist/query/interpolate.d.ts.map +1 -0
- package/dist/query/interpolate.js +51 -0
- package/dist/query/interpolate.js.map +1 -0
- package/dist/query/native.d.ts +8 -0
- package/dist/query/native.d.ts.map +1 -1
- package/dist/query/native.js +14 -0
- package/dist/query/native.js.map +1 -1
- package/dist/query/operators.d.ts +4 -0
- package/dist/query/operators.d.ts.map +1 -0
- package/dist/query/operators.js +27 -0
- package/dist/query/operators.js.map +1 -0
- package/dist/schema/Migration.d.ts +31 -7
- package/dist/schema/Migration.d.ts.map +1 -1
- package/dist/schema/Migration.js +34 -7
- package/dist/schema/Migration.js.map +1 -1
- package/dist/schema/MigrationRunner.d.ts +56 -6
- package/dist/schema/MigrationRunner.d.ts.map +1 -1
- package/dist/schema/MigrationRunner.js +382 -112
- package/dist/schema/MigrationRunner.js.map +1 -1
- package/dist/schema/Schema.d.ts +59 -2
- package/dist/schema/Schema.d.ts.map +1 -1
- package/dist/schema/Schema.js +143 -9
- package/dist/schema/Schema.js.map +1 -1
- package/dist/schema/SchemaDumper.d.ts +121 -0
- package/dist/schema/SchemaDumper.d.ts.map +1 -0
- package/dist/schema/SchemaDumper.js +365 -0
- package/dist/schema/SchemaDumper.js.map +1 -0
- package/dist/schema/Seeder.d.ts +13 -0
- package/dist/schema/Seeder.d.ts.map +1 -1
- package/dist/schema/Seeder.js +28 -5
- package/dist/schema/Seeder.js.map +1 -1
- package/dist/schema/TableBuilder.d.ts +27 -8
- package/dist/schema/TableBuilder.d.ts.map +1 -1
- package/dist/schema/TableBuilder.js +50 -12
- package/dist/schema/TableBuilder.js.map +1 -1
- package/dist/schema/catalog.d.ts +25 -1
- package/dist/schema/catalog.d.ts.map +1 -1
- package/dist/schema/catalog.js +69 -22
- package/dist/schema/catalog.js.map +1 -1
- package/dist/schema/introspect.d.ts +1 -1
- package/dist/schema/introspect.d.ts.map +1 -1
- package/dist/schema/introspect.js +26 -11
- package/dist/schema/introspect.js.map +1 -1
- package/dist/seeders.d.ts +7 -0
- package/dist/seeders.d.ts.map +1 -0
- package/dist/seeders.js +7 -0
- package/dist/seeders.js.map +1 -0
- package/dist/services/db.d.ts +120 -9
- package/dist/services/db.d.ts.map +1 -1
- package/dist/services/db.js +182 -26
- package/dist/services/db.js.map +1 -1
- package/dist/testing/DatabaseCleanup.d.ts +29 -6
- package/dist/testing/DatabaseCleanup.d.ts.map +1 -1
- package/dist/testing/DatabaseCleanup.js +44 -17
- package/dist/testing/DatabaseCleanup.js.map +1 -1
- package/dist/testing/DbAssertions.d.ts +48 -0
- package/dist/testing/DbAssertions.d.ts.map +1 -0
- package/dist/testing/DbAssertions.js +80 -0
- package/dist/testing/DbAssertions.js.map +1 -0
- package/dist/testing/Factory.d.ts +111 -25
- package/dist/testing/Factory.d.ts.map +1 -1
- package/dist/testing/Factory.js +331 -56
- package/dist/testing/Factory.js.map +1 -1
- package/dist/testing/TestUtils.d.ts +49 -0
- package/dist/testing/TestUtils.d.ts.map +1 -0
- package/dist/testing/TestUtils.js +79 -0
- package/dist/testing/TestUtils.js.map +1 -0
- package/dist/testing/index.d.ts +3 -1
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +3 -1
- package/dist/testing/index.js.map +1 -1
- package/dist/types/relations.d.ts +31 -0
- package/dist/types/relations.d.ts.map +1 -0
- package/dist/types/relations.js +20 -0
- package/dist/types/relations.js.map +1 -0
- package/index.darwin-arm64.node +0 -0
- package/index.darwin-x64.node +0 -0
- package/index.linux-arm64-gnu.node +0 -0
- package/index.linux-x64-gnu.node +0 -0
- package/index.win32-x64-msvc.node +0 -0
- package/package.json +30 -2
- package/src/AtlasProvider.ts +297 -51
- package/src/BaseEntity.ts +29 -0
- package/src/BaseModel.ts +174 -37
- package/src/BaseRepository.ts +136 -17
- package/src/ConnectionManager.ts +298 -0
- package/src/ModelQuery.ts +1309 -260
- package/src/Transaction.ts +194 -60
- package/src/adapters/NapiDbAdapter.ts +72 -14
- package/src/console/contract.ts +96 -0
- package/src/console/factoryCommands.ts +73 -0
- package/src/console/migrationCommands.ts +253 -63
- package/src/console/schemaCheckCommand.ts +26 -22
- package/src/console/schemaDumpCommand.ts +96 -0
- package/src/console/schemaGenerateCommand.ts +380 -0
- package/src/console/seederCommands.ts +174 -0
- package/src/decorators/entity.ts +18 -2
- package/src/decorators/hooks.ts +5 -3
- package/src/events.ts +5 -0
- package/src/factories.ts +10 -0
- package/src/index.ts +50 -3
- package/src/lucid-schema.ts +22 -0
- package/src/orm.ts +13 -0
- package/src/query/DatabaseQueryBuilder.ts +2724 -0
- package/src/query/DmlBuilder.ts +131 -0
- package/src/query/QueryBuilder.ts +8 -0
- package/src/query/RawQueryBuilder.ts +173 -0
- package/src/query/interpolate.ts +73 -0
- package/src/query/native.ts +29 -0
- package/src/query/operators.ts +27 -0
- package/src/schema/Migration.ts +36 -7
- package/src/schema/MigrationRunner.ts +483 -119
- package/src/schema/Schema.ts +168 -19
- package/src/schema/SchemaDumper.ts +518 -0
- package/src/schema/Seeder.ts +47 -10
- package/src/schema/TableBuilder.ts +48 -11
- package/src/schema/catalog.ts +94 -24
- package/src/schema/introspect.ts +26 -9
- package/src/seeders.ts +16 -0
- package/src/services/db.ts +343 -31
- package/src/testing/DatabaseCleanup.ts +73 -21
- package/src/testing/DbAssertions.ts +127 -0
- package/src/testing/Factory.ts +559 -79
- package/src/testing/TestUtils.ts +123 -0
- package/src/testing/index.ts +12 -1
- package/src/types/relations.ts +43 -0
|
@@ -17,26 +17,56 @@
|
|
|
17
17
|
* // reamrc.ts → commands: [() => import('./commands/migrate.js')]
|
|
18
18
|
* // run: <console-entry> migration:run
|
|
19
19
|
*/
|
|
20
|
-
import type
|
|
20
|
+
import { type AtlasCommandClass } from "./contract.js";
|
|
21
|
+
import { type SchemaGenerateOptions } from "./schemaGenerateCommand.js";
|
|
21
22
|
export interface MigrationCommandOptions {
|
|
22
23
|
/** Directory holding the numbered migration files. */
|
|
23
24
|
migrationsDir: string;
|
|
25
|
+
/**
|
|
26
|
+
* Sort migration files numerically (`2_x` before `10_x`). Adonis Lucid
|
|
27
|
+
* `migrations.naturalSort`. Defaults to `false`.
|
|
28
|
+
*/
|
|
29
|
+
naturalSort?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Run every migration outside a transaction. Adonis Lucid
|
|
32
|
+
* `migrations.disableTransactions`. A migration can also opt out with
|
|
33
|
+
* `static disableTransactions = true`. Defaults to `false`.
|
|
34
|
+
*/
|
|
35
|
+
disableTransactions?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Regenerate the schema file after a mutating migration command
|
|
38
|
+
* (run/rollback/reset/refresh/fresh) — Adonis Lucid's post-migration
|
|
39
|
+
* `schema:generate`. Off unless an `outputPath` is given; on by default once
|
|
40
|
+
* it is, unless `enabled: false`; suppress per-run with `--no-schema-generate`.
|
|
41
|
+
*/
|
|
42
|
+
schemaGeneration?: SchemaGenerateOptions;
|
|
43
|
+
/**
|
|
44
|
+
* Default schema-dump path auto-loaded by `migration:run` / `migration:fresh`
|
|
45
|
+
* when the target DB has no applied migrations (Adonis Lucid bootstraps from
|
|
46
|
+
* the dump by default). Overridden per-run by `--schema-path`; a run never
|
|
47
|
+
* loads it once migrations exist.
|
|
48
|
+
*/
|
|
49
|
+
schemaPath?: string;
|
|
24
50
|
}
|
|
25
51
|
/** `migration:run` — apply every pending migration. */
|
|
26
|
-
export declare function migrationRunCommand(options: MigrationCommandOptions):
|
|
52
|
+
export declare function migrationRunCommand(options: MigrationCommandOptions): AtlasCommandClass;
|
|
27
53
|
/**
|
|
28
54
|
* `migration:rollback` — undo the latest batch, or with `--batch=N` roll back
|
|
29
55
|
* everything applied after batch N (`--batch=0` rolls back all).
|
|
30
56
|
*/
|
|
31
|
-
export declare function migrationRollbackCommand(options: MigrationCommandOptions):
|
|
57
|
+
export declare function migrationRollbackCommand(options: MigrationCommandOptions): AtlasCommandClass;
|
|
32
58
|
/** `migration:status` — list every migration and whether it is applied. */
|
|
33
|
-
export declare function migrationStatusCommand(options: MigrationCommandOptions):
|
|
59
|
+
export declare function migrationStatusCommand(options: MigrationCommandOptions): AtlasCommandClass;
|
|
34
60
|
/** `migration:reset` — roll back every applied migration. */
|
|
35
|
-
export declare function migrationResetCommand(options: MigrationCommandOptions):
|
|
61
|
+
export declare function migrationResetCommand(options: MigrationCommandOptions): AtlasCommandClass;
|
|
62
|
+
/** `migration:unlock` — force-clear a stuck migration lock (Lucid `migration:unlock`). */
|
|
63
|
+
export declare function migrationUnlockCommand(options: MigrationCommandOptions): AtlasCommandClass;
|
|
64
|
+
/** `migration:fresh` — drop every table, then re-run all migrations (Lucid `migration:fresh`). */
|
|
65
|
+
export declare function migrationFreshCommand(options: MigrationCommandOptions): AtlasCommandClass;
|
|
36
66
|
/** `migration:refresh` — roll everything back, then re-run all migrations. */
|
|
37
|
-
export declare function migrationRefreshCommand(options: MigrationCommandOptions):
|
|
67
|
+
export declare function migrationRefreshCommand(options: MigrationCommandOptions): AtlasCommandClass;
|
|
38
68
|
/** `db:wipe` — drop every table, including the migrations bookkeeping table. */
|
|
39
|
-
export declare function dbWipeCommand(options: MigrationCommandOptions):
|
|
69
|
+
export declare function dbWipeCommand(options: MigrationCommandOptions): AtlasCommandClass;
|
|
40
70
|
/**
|
|
41
71
|
* `make:migration <name>` — scaffold a timestamped migration file in
|
|
42
72
|
* `migrationsDir`. The `Date.now()` prefix keeps files in creation order under
|
|
@@ -44,5 +74,5 @@ export declare function dbWipeCommand(options: MigrationCommandOptions): AtlasCo
|
|
|
44
74
|
* is validated (no path separators / traversal) and the file is written with
|
|
45
75
|
* `wx` so an existing migration is never clobbered.
|
|
46
76
|
*/
|
|
47
|
-
export declare function makeMigrationCommand(options: MigrationCommandOptions):
|
|
77
|
+
export declare function makeMigrationCommand(options: MigrationCommandOptions): AtlasCommandClass;
|
|
48
78
|
//# sourceMappingURL=migrationCommands.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrationCommands.d.ts","sourceRoot":"","sources":["../../src/console/migrationCommands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAWH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"migrationCommands.d.ts","sourceRoot":"","sources":["../../src/console/migrationCommands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAWH,OAAO,EAAE,KAAK,iBAAiB,EAAkB,MAAM,eAAe,CAAC;AACvE,OAAO,EAEN,KAAK,qBAAqB,EAC1B,MAAM,4BAA4B,CAAC;AAEpC,MAAM,WAAW,uBAAuB;IACvC,sDAAsD;IACtD,aAAa,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,qBAAqB,CAAC;IACzC;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB;AA+CD,uDAAuD;AACvD,wBAAgB,mBAAmB,CAClC,OAAO,EAAE,uBAAuB,GAC9B,iBAAiB,CAuBnB;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACvC,OAAO,EAAE,uBAAuB,GAC9B,iBAAiB,CAuCnB;AAED,2EAA2E;AAC3E,wBAAgB,sBAAsB,CACrC,OAAO,EAAE,uBAAuB,GAC9B,iBAAiB,CAoBnB;AAED,6DAA6D;AAC7D,wBAAgB,qBAAqB,CACpC,OAAO,EAAE,uBAAuB,GAC9B,iBAAiB,CAuBnB;AAED,0FAA0F;AAC1F,wBAAgB,sBAAsB,CACrC,OAAO,EAAE,uBAAuB,GAC9B,iBAAiB,CAenB;AAED,kGAAkG;AAClG,wBAAgB,qBAAqB,CACpC,OAAO,EAAE,uBAAuB,GAC9B,iBAAiB,CA2BnB;AAED,8EAA8E;AAC9E,wBAAgB,uBAAuB,CACtC,OAAO,EAAE,uBAAuB,GAC9B,iBAAiB,CAqBnB;AAED,gFAAgF;AAChF,wBAAgB,aAAa,CAC5B,OAAO,EAAE,uBAAuB,GAC9B,iBAAiB,CAiBnB;AAkBD;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CACnC,OAAO,EAAE,uBAAuB,GAC9B,iBAAiB,CA2BnB"}
|
|
@@ -22,6 +22,8 @@ import * as path from "node:path";
|
|
|
22
22
|
import { MigrationRunner, } from "../schema/MigrationRunner.js";
|
|
23
23
|
import { getDb } from "../services/db.js";
|
|
24
24
|
import { assertSafeName } from "../utils/safePath.js";
|
|
25
|
+
import { argument, flag } from "./contract.js";
|
|
26
|
+
import { generateSchemaFile, } from "./schemaGenerateCommand.js";
|
|
25
27
|
/**
|
|
26
28
|
* Adapt the shared singleton connection to the runner's {@link DatabaseAdapter}.
|
|
27
29
|
* `close()` is intentionally a no-op — the console kernel owns the connection's
|
|
@@ -34,6 +36,9 @@ function toAdapter(conn) {
|
|
|
34
36
|
},
|
|
35
37
|
query: (sql, params) => conn.query(sql, params),
|
|
36
38
|
runInTransaction: (batch) => conn.runInTransaction(batch),
|
|
39
|
+
// Thread the connection's managed interactive transaction through so the
|
|
40
|
+
// runner can make this.defer() atomic and restore MySQL FK checks.
|
|
41
|
+
transaction: conn.transaction?.bind(conn),
|
|
37
42
|
close: async () => { },
|
|
38
43
|
};
|
|
39
44
|
}
|
|
@@ -48,22 +53,33 @@ function resolveRunner(options) {
|
|
|
48
53
|
process.exitCode = 1;
|
|
49
54
|
return undefined;
|
|
50
55
|
}
|
|
56
|
+
// Pass the connection's ACTUAL dialect — without it the runner defaults to
|
|
57
|
+
// sqlite and emits SQLite SQL (lock table, FK handling, DDL) against a
|
|
58
|
+
// Postgres/MySQL database.
|
|
51
59
|
return new MigrationRunner(toAdapter(db), {
|
|
52
60
|
migrationsDir: options.migrationsDir,
|
|
61
|
+
dialect: db.dialect,
|
|
62
|
+
naturalSort: options.naturalSort,
|
|
63
|
+
disableTransactions: options.disableTransactions,
|
|
53
64
|
});
|
|
54
65
|
}
|
|
55
66
|
/** `migration:run` — apply every pending migration. */
|
|
56
67
|
export function migrationRunCommand(options) {
|
|
57
|
-
return {
|
|
58
|
-
|
|
59
|
-
description
|
|
68
|
+
return class MigrationRun {
|
|
69
|
+
static commandName = "migration:run";
|
|
70
|
+
static description = "Run all pending migrations (--schema-path to bootstrap from a dump)";
|
|
71
|
+
static options = { startApp: true };
|
|
72
|
+
static flags = [schemaPathOption(), noSchemaGenerateFlag()];
|
|
60
73
|
async run() {
|
|
61
74
|
const runner = resolveRunner(options);
|
|
62
75
|
if (!runner)
|
|
63
76
|
return;
|
|
64
|
-
const ran = await runner.migrate(
|
|
77
|
+
const ran = await runner.migrate({
|
|
78
|
+
schemaPath: this.schemaPath ?? options.schemaPath,
|
|
79
|
+
});
|
|
65
80
|
console.log(ran.length ? `Migrated: ${ran.join(", ")}` : "Already up to date");
|
|
66
|
-
|
|
81
|
+
await maybeRegenSchema(options, this);
|
|
82
|
+
}
|
|
67
83
|
};
|
|
68
84
|
}
|
|
69
85
|
/**
|
|
@@ -71,31 +87,42 @@ export function migrationRunCommand(options) {
|
|
|
71
87
|
* everything applied after batch N (`--batch=0` rolls back all).
|
|
72
88
|
*/
|
|
73
89
|
export function migrationRollbackCommand(options) {
|
|
74
|
-
return {
|
|
75
|
-
|
|
76
|
-
description
|
|
77
|
-
|
|
90
|
+
return class MigrationRollback {
|
|
91
|
+
static commandName = "migration:rollback";
|
|
92
|
+
static description = "Roll back the latest batch (or --batch=N; --force in prod)";
|
|
93
|
+
static options = { startApp: true };
|
|
94
|
+
static flags = [
|
|
95
|
+
flag("batch", "number", {
|
|
96
|
+
description: "Roll back everything applied after batch N (0 = all)",
|
|
97
|
+
}),
|
|
98
|
+
forceFlag(),
|
|
99
|
+
noSchemaGenerateFlag(),
|
|
100
|
+
];
|
|
101
|
+
async run() {
|
|
78
102
|
const runner = resolveRunner(options);
|
|
79
103
|
if (!runner)
|
|
80
104
|
return;
|
|
81
|
-
const batch = parseBatchFlag(
|
|
105
|
+
const batch = parseBatchFlag(this.batch);
|
|
82
106
|
if (batch === "invalid") {
|
|
83
107
|
console.error("[atlas] --batch must be a non-negative integer");
|
|
84
108
|
process.exitCode = 1;
|
|
85
109
|
return;
|
|
86
110
|
}
|
|
87
|
-
const
|
|
111
|
+
const force = this.force === true;
|
|
112
|
+
const rolled = await runner.rollback(batch === undefined ? { force } : { batch, force });
|
|
88
113
|
console.log(rolled.length
|
|
89
114
|
? `Rolled back: ${rolled.join(", ")}`
|
|
90
115
|
: "Nothing to roll back");
|
|
91
|
-
|
|
116
|
+
await maybeRegenSchema(options, this);
|
|
117
|
+
}
|
|
92
118
|
};
|
|
93
119
|
}
|
|
94
120
|
/** `migration:status` — list every migration and whether it is applied. */
|
|
95
121
|
export function migrationStatusCommand(options) {
|
|
96
|
-
return {
|
|
97
|
-
|
|
98
|
-
description
|
|
122
|
+
return class MigrationStatus {
|
|
123
|
+
static commandName = "migration:status";
|
|
124
|
+
static description = "Show applied and pending migrations";
|
|
125
|
+
static options = { startApp: true };
|
|
99
126
|
async run() {
|
|
100
127
|
const runner = resolveRunner(options);
|
|
101
128
|
if (!runner)
|
|
@@ -109,51 +136,98 @@ export function migrationStatusCommand(options) {
|
|
|
109
136
|
const batch = row.batch === undefined ? "" : ` (batch ${row.batch})`;
|
|
110
137
|
console.log(`${row.status.padEnd(8)} ${row.name}${batch}`);
|
|
111
138
|
}
|
|
112
|
-
}
|
|
139
|
+
}
|
|
113
140
|
};
|
|
114
141
|
}
|
|
115
142
|
/** `migration:reset` — roll back every applied migration. */
|
|
116
143
|
export function migrationResetCommand(options) {
|
|
117
|
-
return {
|
|
118
|
-
|
|
119
|
-
description
|
|
144
|
+
return class MigrationReset {
|
|
145
|
+
static commandName = "migration:reset";
|
|
146
|
+
static description = "Roll back all migrations (--force to override prod guard)";
|
|
147
|
+
static options = { startApp: true };
|
|
148
|
+
static flags = [forceFlag(), noSchemaGenerateFlag()];
|
|
120
149
|
async run() {
|
|
121
150
|
const runner = resolveRunner(options);
|
|
122
151
|
if (!runner)
|
|
123
152
|
return;
|
|
124
|
-
const rolled = await runner.reset();
|
|
153
|
+
const rolled = await runner.reset({ force: this.force === true });
|
|
125
154
|
console.log(rolled.length
|
|
126
155
|
? `Rolled back: ${rolled.join(", ")}`
|
|
127
156
|
: "Nothing to reset");
|
|
128
|
-
|
|
157
|
+
await maybeRegenSchema(options, this);
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
/** `migration:unlock` — force-clear a stuck migration lock (Lucid `migration:unlock`). */
|
|
162
|
+
export function migrationUnlockCommand(options) {
|
|
163
|
+
return class MigrationUnlock {
|
|
164
|
+
static commandName = "migration:unlock";
|
|
165
|
+
static description = "Force-clear a stuck migration lock";
|
|
166
|
+
static options = { startApp: true };
|
|
167
|
+
async run() {
|
|
168
|
+
const runner = resolveRunner(options);
|
|
169
|
+
if (!runner)
|
|
170
|
+
return;
|
|
171
|
+
const cleared = await runner.forceUnlock();
|
|
172
|
+
console.log(cleared ? "Migration lock cleared" : "No migration lock was held");
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
/** `migration:fresh` — drop every table, then re-run all migrations (Lucid `migration:fresh`). */
|
|
177
|
+
export function migrationFreshCommand(options) {
|
|
178
|
+
return class MigrationFresh {
|
|
179
|
+
static commandName = "migration:fresh";
|
|
180
|
+
static description = "Drop all tables, then re-run every migration (--force to override prod guard)";
|
|
181
|
+
static options = { startApp: true };
|
|
182
|
+
static flags = [forceFlag(), schemaPathOption(), noSchemaGenerateFlag()];
|
|
183
|
+
async run() {
|
|
184
|
+
const runner = resolveRunner(options);
|
|
185
|
+
if (!runner)
|
|
186
|
+
return;
|
|
187
|
+
const { executed } = await runner.fresh({
|
|
188
|
+
force: this.force === true,
|
|
189
|
+
schemaPath: this.schemaPath ?? options.schemaPath,
|
|
190
|
+
});
|
|
191
|
+
console.log(executed.length
|
|
192
|
+
? `Dropped all tables, re-ran: ${executed.join(", ")}`
|
|
193
|
+
: "Dropped all tables (no migrations to run)");
|
|
194
|
+
await maybeRegenSchema(options, this);
|
|
195
|
+
}
|
|
129
196
|
};
|
|
130
197
|
}
|
|
131
198
|
/** `migration:refresh` — roll everything back, then re-run all migrations. */
|
|
132
199
|
export function migrationRefreshCommand(options) {
|
|
133
|
-
return {
|
|
134
|
-
|
|
135
|
-
description
|
|
200
|
+
return class MigrationRefresh {
|
|
201
|
+
static commandName = "migration:refresh";
|
|
202
|
+
static description = "Roll back all migrations, then re-run them (--force to override prod guard)";
|
|
203
|
+
static options = { startApp: true };
|
|
204
|
+
static flags = [forceFlag(), noSchemaGenerateFlag()];
|
|
136
205
|
async run() {
|
|
137
206
|
const runner = resolveRunner(options);
|
|
138
207
|
if (!runner)
|
|
139
208
|
return;
|
|
140
|
-
const { rolled, executed } = await runner.refresh(
|
|
209
|
+
const { rolled, executed } = await runner.refresh({
|
|
210
|
+
force: this.force === true,
|
|
211
|
+
});
|
|
141
212
|
console.log(`Rolled back: ${rolled.length}, re-ran: ${executed.length}`);
|
|
142
|
-
|
|
213
|
+
await maybeRegenSchema(options, this);
|
|
214
|
+
}
|
|
143
215
|
};
|
|
144
216
|
}
|
|
145
217
|
/** `db:wipe` — drop every table, including the migrations bookkeeping table. */
|
|
146
218
|
export function dbWipeCommand(options) {
|
|
147
|
-
return {
|
|
148
|
-
|
|
149
|
-
description
|
|
219
|
+
return class DbWipe {
|
|
220
|
+
static commandName = "db:wipe";
|
|
221
|
+
static description = "Drop all tables including the migrations table (--force to override prod guard)";
|
|
222
|
+
static options = { startApp: true };
|
|
223
|
+
static flags = [forceFlag()];
|
|
150
224
|
async run() {
|
|
151
225
|
const runner = resolveRunner(options);
|
|
152
226
|
if (!runner)
|
|
153
227
|
return;
|
|
154
|
-
await runner.wipe();
|
|
228
|
+
await runner.wipe({ force: this.force === true });
|
|
155
229
|
console.log("Dropped all tables");
|
|
156
|
-
}
|
|
230
|
+
}
|
|
157
231
|
};
|
|
158
232
|
}
|
|
159
233
|
/** Scaffold body for a fresh migration (`make:migration`). */
|
|
@@ -179,42 +253,75 @@ export default class extends Migration {
|
|
|
179
253
|
* `wx` so an existing migration is never clobbered.
|
|
180
254
|
*/
|
|
181
255
|
export function makeMigrationCommand(options) {
|
|
182
|
-
return {
|
|
183
|
-
|
|
184
|
-
description
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
}
|
|
256
|
+
return class MakeMigration {
|
|
257
|
+
static commandName = "make:migration";
|
|
258
|
+
static description = "Scaffold a new timestamped migration file";
|
|
259
|
+
// Filesystem only — no connection needed.
|
|
260
|
+
static options = { startApp: false };
|
|
261
|
+
static args = [argument("name", { description: "Migration file name" })];
|
|
262
|
+
async run() {
|
|
263
|
+
// A missing name never reaches here: the kernel reports the required
|
|
264
|
+
// argument by name before `run()`.
|
|
192
265
|
try {
|
|
193
|
-
assertSafeName(name, "MIGRATION_INVALID", "migration");
|
|
266
|
+
assertSafeName(this.name, "MIGRATION_INVALID", "migration");
|
|
194
267
|
}
|
|
195
268
|
catch {
|
|
196
|
-
console.error(`[atlas] invalid migration name: ${name}`);
|
|
269
|
+
console.error(`[atlas] invalid migration name: ${this.name}`);
|
|
197
270
|
process.exitCode = 1;
|
|
198
271
|
return;
|
|
199
272
|
}
|
|
200
|
-
const fileName = `${Date.now()}_${name}.ts`;
|
|
273
|
+
const fileName = `${Date.now()}_${this.name}.ts`;
|
|
201
274
|
const filePath = path.join(options.migrationsDir, fileName);
|
|
202
275
|
await fsp.mkdir(options.migrationsDir, { recursive: true });
|
|
203
276
|
await fsp.writeFile(filePath, MIGRATION_STUB, { flag: "wx" });
|
|
204
277
|
console.log(`Created ${filePath}`);
|
|
205
|
-
}
|
|
278
|
+
}
|
|
206
279
|
};
|
|
207
280
|
}
|
|
281
|
+
/**
|
|
282
|
+
* Flags shared by several migration commands.
|
|
283
|
+
*
|
|
284
|
+
* Declared per command rather than inherited: `migration:status` takes neither
|
|
285
|
+
* `--force` nor `--schema-path`, and listing them anyway would put flags in its
|
|
286
|
+
* help that it ignores.
|
|
287
|
+
*/
|
|
288
|
+
const forceFlag = () => flag("force", "boolean", {
|
|
289
|
+
description: "Override the production guard",
|
|
290
|
+
});
|
|
291
|
+
const schemaPathOption = () => flag("schemaPath", "string", {
|
|
292
|
+
description: "Bootstrap from a schema dump before migrating",
|
|
293
|
+
});
|
|
294
|
+
const noSchemaGenerateFlag = () => flag("noSchemaGenerate", "boolean", {
|
|
295
|
+
description: "Skip regenerating the schema file afterwards",
|
|
296
|
+
});
|
|
297
|
+
/**
|
|
298
|
+
* Regenerate the schema file after a mutating migration command (Adonis Lucid's
|
|
299
|
+
* post-migration `schema:generate`) — unless it's disabled, has no `outputPath`,
|
|
300
|
+
* or the run passed `--no-schema-generate`.
|
|
301
|
+
*/
|
|
302
|
+
async function maybeRegenSchema(options, command) {
|
|
303
|
+
const cfg = options.schemaGeneration;
|
|
304
|
+
// Opt-in by configuring an outputPath; then ON unless explicitly disabled —
|
|
305
|
+
// Adonis Lucid presents `enabled: false` as the OFF switch (default on).
|
|
306
|
+
if (!cfg?.outputPath || cfg.enabled === false)
|
|
307
|
+
return;
|
|
308
|
+
if (command.noSchemaGenerate === true)
|
|
309
|
+
return;
|
|
310
|
+
const db = getDb();
|
|
311
|
+
if (!db)
|
|
312
|
+
return;
|
|
313
|
+
const n = await generateSchemaFile(db, cfg);
|
|
314
|
+
console.log(`Regenerated ${cfg.outputPath} (${n} table${n === 1 ? "" : "s"})`);
|
|
315
|
+
}
|
|
208
316
|
/**
|
|
209
317
|
* Parse the `--batch` flag: absent → undefined (default rollback), a
|
|
210
318
|
* non-negative integer string → that number, anything else → `"invalid"`.
|
|
211
319
|
*/
|
|
212
320
|
function parseBatchFlag(value) {
|
|
213
|
-
|
|
321
|
+
// The kernel already rejected a non-numeric `--batch`; what is left to check
|
|
322
|
+
// is that the number is a non-negative integer.
|
|
323
|
+
if (value === undefined)
|
|
214
324
|
return undefined;
|
|
215
|
-
|
|
216
|
-
return "invalid";
|
|
217
|
-
const n = Number(value);
|
|
218
|
-
return Number.isInteger(n) && n >= 0 ? n : "invalid";
|
|
325
|
+
return Number.isInteger(value) && value >= 0 ? value : "invalid";
|
|
219
326
|
}
|
|
220
327
|
//# sourceMappingURL=migrationCommands.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrationCommands.js","sourceRoot":"","sources":["../../src/console/migrationCommands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,GAAG,MAAM,kBAAkB,CAAC;AACxC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EAEN,eAAe,GACf,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MA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G,GAAG,OAAO,CAAC,gBAAgB,CAAC;IACrC,4EAA4E;IAC5E,yEAAyE;IACzE,IAAI,CAAC,GAAG,EAAE,UAAU,IAAI,GAAG,CAAC,OAAO,KAAK,KAAK;QAAE,OAAO;IACtD,IAAI,OAAO,CAAC,gBAAgB,KAAK,IAAI;QAAE,OAAO;IAC9C,MAAM,EAAE,GAAG,KAAK,EAAE,CAAC;IACnB,IAAI,CAAC,EAAE;QAAE,OAAO;IAChB,MAAM,CAAC,GAAG,MAAM,kBAAkB,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;IAC5C,OAAO,CAAC,GAAG,CACV,eAAe,GAAG,CAAC,UAAU,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,CACjE,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,SAAS,cAAc,CACtB,KAAyB;IAEzB,6EAA6E;IAC7E,gDAAgD;IAChD,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC1C,OAAO,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AAClE,CAAC"}
|
|
@@ -1,26 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `atlas:check` console command — the Ream-idiomatic CLI for schema
|
|
3
|
-
* verification. Ream commands are
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* verification. Ream commands are classes carrying their name, description and
|
|
4
|
+
* inputs as statics; the console kernel discovers them in `commands/` or reads
|
|
5
|
+
* them from `reamrc.commands`.
|
|
6
6
|
*
|
|
7
7
|
* Stays framework-agnostic: resolves the live connection + dialect from atlas's
|
|
8
8
|
* OWN service locators (`getDb` / `getAtlasDialect`), never importing
|
|
9
|
-
* `@c9up/ream`. The {@link
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* `@c9up/ream`. The {@link AtlasCommandClass} shape structurally matches Ream's
|
|
10
|
+
* command contract, so the console kernel accepts it without a type dependency
|
|
11
|
+
* in either direction.
|
|
12
12
|
*/
|
|
13
|
+
import { type AtlasCommandClass } from "./contract.js";
|
|
13
14
|
type Constructor = new (...args: unknown[]) => unknown;
|
|
14
|
-
|
|
15
|
-
export interface AtlasCommand {
|
|
16
|
-
name: string;
|
|
17
|
-
description: string;
|
|
18
|
-
run(args: string[], flags: Record<string, string | boolean>): Promise<void>;
|
|
19
|
-
}
|
|
15
|
+
export type { AtlasCommandClass } from "./contract.js";
|
|
20
16
|
/**
|
|
21
17
|
* Build the `atlas:check` command for the given models. Register it in
|
|
22
18
|
* `reamrc.commands` (atlas has no global entity registry — list your models,
|
|
23
|
-
* as in Lucid). Run it
|
|
19
|
+
* as in Lucid). Run it as `ream atlas:check`; `--warn` reports drift without a
|
|
24
20
|
* non-zero exit (useful for an advisory CI step).
|
|
25
21
|
*
|
|
26
22
|
* @example
|
|
@@ -29,9 +25,7 @@ export interface AtlasCommand {
|
|
|
29
25
|
* import { User } from '#models/user'
|
|
30
26
|
* export default schemaCheckCommand([User])
|
|
31
27
|
*
|
|
32
|
-
* //
|
|
33
|
-
* // run: <console-entry> atlas:check
|
|
28
|
+
* // run: ream atlas:check --warn
|
|
34
29
|
*/
|
|
35
|
-
export declare function schemaCheckCommand(entities: readonly Constructor[]):
|
|
36
|
-
export {};
|
|
30
|
+
export declare function schemaCheckCommand(entities: readonly Constructor[]): AtlasCommandClass;
|
|
37
31
|
//# sourceMappingURL=schemaCheckCommand.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemaCheckCommand.d.ts","sourceRoot":"","sources":["../../src/console/schemaCheckCommand.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;
|
|
1
|
+
{"version":3,"file":"schemaCheckCommand.d.ts","sourceRoot":"","sources":["../../src/console/schemaCheckCommand.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAKH,OAAO,EAAE,KAAK,iBAAiB,EAAQ,MAAM,eAAe,CAAC;AAE7D,KAAK,WAAW,GAAG,KAAK,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC;AAEvD,YAAY,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEvD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CACjC,QAAQ,EAAE,SAAS,WAAW,EAAE,GAC9B,iBAAiB,CA2BnB"}
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `atlas:check` console command — the Ream-idiomatic CLI for schema
|
|
3
|
-
* verification. Ream commands are
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* verification. Ream commands are classes carrying their name, description and
|
|
4
|
+
* inputs as statics; the console kernel discovers them in `commands/` or reads
|
|
5
|
+
* them from `reamrc.commands`.
|
|
6
6
|
*
|
|
7
7
|
* Stays framework-agnostic: resolves the live connection + dialect from atlas's
|
|
8
8
|
* OWN service locators (`getDb` / `getAtlasDialect`), never importing
|
|
9
|
-
* `@c9up/ream`. The {@link
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* `@c9up/ream`. The {@link AtlasCommandClass} shape structurally matches Ream's
|
|
10
|
+
* command contract, so the console kernel accepts it without a type dependency
|
|
11
|
+
* in either direction.
|
|
12
12
|
*/
|
|
13
13
|
import { getAtlasDialect } from "../query/native.js";
|
|
14
14
|
import { runSchemaCheck } from "../schema/SchemaCheck.js";
|
|
15
15
|
import { getDb } from "../services/db.js";
|
|
16
|
+
import { flag } from "./contract.js";
|
|
16
17
|
/**
|
|
17
18
|
* Build the `atlas:check` command for the given models. Register it in
|
|
18
19
|
* `reamrc.commands` (atlas has no global entity registry — list your models,
|
|
19
|
-
* as in Lucid). Run it
|
|
20
|
+
* as in Lucid). Run it as `ream atlas:check`; `--warn` reports drift without a
|
|
20
21
|
* non-zero exit (useful for an advisory CI step).
|
|
21
22
|
*
|
|
22
23
|
* @example
|
|
@@ -25,14 +26,19 @@ import { getDb } from "../services/db.js";
|
|
|
25
26
|
* import { User } from '#models/user'
|
|
26
27
|
* export default schemaCheckCommand([User])
|
|
27
28
|
*
|
|
28
|
-
* //
|
|
29
|
-
* // run: <console-entry> atlas:check
|
|
29
|
+
* // run: ream atlas:check --warn
|
|
30
30
|
*/
|
|
31
31
|
export function schemaCheckCommand(entities) {
|
|
32
|
-
return {
|
|
33
|
-
|
|
34
|
-
description
|
|
35
|
-
|
|
32
|
+
return class SchemaCheck {
|
|
33
|
+
static commandName = "atlas:check";
|
|
34
|
+
static description = "Verify models match the live database schema";
|
|
35
|
+
static options = { startApp: true };
|
|
36
|
+
static flags = [
|
|
37
|
+
flag("warn", "boolean", {
|
|
38
|
+
description: "Report drift without failing (exit 0)",
|
|
39
|
+
}),
|
|
40
|
+
];
|
|
41
|
+
async run() {
|
|
36
42
|
const db = getDb();
|
|
37
43
|
if (!db) {
|
|
38
44
|
console.error("[atlas:check] no database connection — is AtlasProvider registered?");
|
|
@@ -41,9 +47,9 @@ export function schemaCheckCommand(entities) {
|
|
|
41
47
|
}
|
|
42
48
|
const code = await runSchemaCheck(entities, db, getAtlasDialect());
|
|
43
49
|
// `--warn` downgrades drift to advisory (exit 0); default fails CI.
|
|
44
|
-
if (code !== 0 && !
|
|
50
|
+
if (code !== 0 && !this.warn)
|
|
45
51
|
process.exitCode = code;
|
|
46
|
-
}
|
|
52
|
+
}
|
|
47
53
|
};
|
|
48
54
|
}
|
|
49
55
|
//# sourceMappingURL=schemaCheckCommand.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemaCheckCommand.js","sourceRoot":"","sources":["../../src/console/schemaCheckCommand.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC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
|
+
/**
|
|
2
|
+
* `schema:dump` — serialise the live database's schema to a `.sql` dump + a
|
|
3
|
+
* `.meta.json` manifest (Adonis Lucid `schema:dump` / `SchemaDumper`), so a
|
|
4
|
+
* fresh database can be rebuilt from the dump via `migration:run --schema-path`
|
|
5
|
+
* instead of replaying every migration.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* // commands/schema-dump.ts
|
|
9
|
+
* import { schemaDumpCommand } from '@c9up/atlas'
|
|
10
|
+
* export default schemaDumpCommand({ migrationsDir: 'database/migrations' })
|
|
11
|
+
* // run: <console-entry> schema:dump → database/schema/default-schema.sql
|
|
12
|
+
* // schema:dump --prune → also squashes the migration files
|
|
13
|
+
*/
|
|
14
|
+
import { type AtlasCommandClass } from "./contract.js";
|
|
15
|
+
export interface SchemaDumpCommandOptions {
|
|
16
|
+
/** Directory the dump + manifest are written to. Default `"database/schema"`. */
|
|
17
|
+
outputDir?: string;
|
|
18
|
+
/** Migration directory — required for `--prune` (the files it collapses). */
|
|
19
|
+
migrationsDir?: string;
|
|
20
|
+
/** Migration bookkeeping table name. Default `"ream_migrations"`. */
|
|
21
|
+
schemaTableName?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Timestamp string for the manifest. `Date.now()`/`new Date()` are unavailable
|
|
24
|
+
* in some atlas contexts, so pass one in when you need a deterministic value.
|
|
25
|
+
*/
|
|
26
|
+
generatedAt?: string;
|
|
27
|
+
}
|
|
28
|
+
/** `schema:dump` — dump the schema; `--prune` squashes migrations, `--connection` targets one. */
|
|
29
|
+
export declare function schemaDumpCommand(options?: SchemaDumpCommandOptions): AtlasCommandClass;
|
|
30
|
+
//# sourceMappingURL=schemaDumpCommand.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemaDumpCommand.d.ts","sourceRoot":"","sources":["../../src/console/schemaDumpCommand.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,OAAO,EAAE,KAAK,iBAAiB,EAAQ,MAAM,eAAe,CAAC;AAE7D,MAAM,WAAW,wBAAwB;IACxC,iFAAiF;IACjF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6EAA6E;IAC7E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qEAAqE;IACrE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,kGAAkG;AAClG,wBAAgB,iBAAiB,CAChC,OAAO,GAAE,wBAA6B,GACpC,iBAAiB,CA4DnB"}
|