dbmate 2.0.1 → 2.2.0
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 +7 -7
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +10 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/resolveBinary.d.ts +5 -0
- package/dist/resolveBinary.d.ts.map +1 -0
- package/dist/resolveBinary.js +27 -0
- package/dist/resolveBinary.js.map +1 -0
- package/package.json +15 -9
- package/bin/dbmate.js +0 -21
package/README.md
CHANGED
|
@@ -510,10 +510,10 @@ You can customize the name of this table using the `--migrations-table` flag or
|
|
|
510
510
|
|
|
511
511
|
Why another database schema migration tool? Dbmate was inspired by many other tools, primarily [Active Record Migrations](http://guides.rubyonrails.org/active_record_migrations.html), with the goals of being trivial to configure, and language & framework independent. Here is a comparison between dbmate and other popular migration tools.
|
|
512
512
|
|
|
513
|
-
| | [dbmate](https://github.com/amacneil/dbmate) | [goose](https://github.com/pressly/goose) | [sql-migrate](https://github.com/rubenv/sql-migrate) | [golang-migrate](https://github.com/golang-migrate/migrate) | [activerecord](http://guides.rubyonrails.org/active_record_migrations.html) | [sequelize](http://docs.sequelizejs.com/manual/tutorial/migrations.html) | [flyway](https://flywaydb.org/) |
|
|
514
|
-
| ------------------------------------------------------------ | :------------------------------------------: | :---------------------------------------: | :--------------------------------------------------: | :---------------------------------------------------------: | :-------------------------------------------------------------------------: | :----------------------------------------------------------------------: | :-----------------------------: |
|
|
513
|
+
| | [dbmate](https://github.com/amacneil/dbmate) | [goose](https://github.com/pressly/goose) | [sql-migrate](https://github.com/rubenv/sql-migrate) | [golang-migrate](https://github.com/golang-migrate/migrate) | [activerecord](http://guides.rubyonrails.org/active_record_migrations.html) | [sequelize](http://docs.sequelizejs.com/manual/tutorial/migrations.html) | [flyway](https://flywaydb.org/) | [sqitch](https://sqitch.org/) |
|
|
514
|
+
| ------------------------------------------------------------ | :------------------------------------------: | :---------------------------------------: | :--------------------------------------------------: | :---------------------------------------------------------: | :-------------------------------------------------------------------------: | :----------------------------------------------------------------------: | :-----------------------------: | :---------------------------: |
|
|
515
515
|
| **Features** |
|
|
516
|
-
| Plain SQL migration files | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | | | :white_check_mark: |
|
|
516
|
+
| Plain SQL migration files | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | | | :white_check_mark: | :white_check_mark: |
|
|
517
517
|
| Support for creating and dropping databases | :white_check_mark: | | | | :white_check_mark: | | |
|
|
518
518
|
| Support for saving schema dump files | :white_check_mark: | | | | :white_check_mark: | | |
|
|
519
519
|
| Timestamp-versioned migration files | :white_check_mark: | :white_check_mark: | | :white_check_mark: | :white_check_mark: | :white_check_mark: | |
|
|
@@ -522,11 +522,11 @@ Why another database schema migration tool? Dbmate was inspired by many other to
|
|
|
522
522
|
| Database connection string loaded from environment variables | :white_check_mark: | | | | | | :white_check_mark: |
|
|
523
523
|
| Automatically load .env file | :white_check_mark: | | | | | | |
|
|
524
524
|
| No separate configuration file | :white_check_mark: | | | :white_check_mark: | :white_check_mark: | :white_check_mark: | |
|
|
525
|
-
| Language/framework independent | :white_check_mark: | :white_check_mark: | | :white_check_mark: | | | :white_check_mark: |
|
|
525
|
+
| Language/framework independent | :white_check_mark: | :white_check_mark: | | :white_check_mark: | | | :white_check_mark: | :white_check_mark: |
|
|
526
526
|
| **Drivers** |
|
|
527
|
-
| PostgreSQL | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|
|
528
|
-
| MySQL | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|
|
529
|
-
| SQLite | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|
|
527
|
+
| PostgreSQL | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|
|
528
|
+
| MySQL | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|
|
529
|
+
| SQLite | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|
|
530
530
|
| CliсkHouse | :white_check_mark: | | | :white_check_mark: | :white_check_mark: | :white_check_mark: | |
|
|
531
531
|
|
|
532
532
|
_If you notice any inaccuracies in this table, please [propose a change](https://github.com/amacneil/dbmate/edit/main/README.md)._
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const node_child_process_1 = require("node:child_process");
|
|
5
|
+
const resolveBinary_js_1 = require("./resolveBinary.js");
|
|
6
|
+
const child = (0, node_child_process_1.spawnSync)((0, resolveBinary_js_1.resolveBinary)(), process.argv.slice(2), {
|
|
7
|
+
stdio: "inherit",
|
|
8
|
+
});
|
|
9
|
+
process.exit(child.status ?? 0);
|
|
10
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;AACA,2DAA+C;AAE/C,yDAAmD;AAEnD,MAAM,KAAK,GAAG,IAAA,8BAAS,EAAC,IAAA,gCAAa,GAAE,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;IAC9D,KAAK,EAAE,SAAS;CACjB,CAAC,CAAC;AACH,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveBinary = void 0;
|
|
4
|
+
const resolveBinary_js_1 = require("./resolveBinary.js");
|
|
5
|
+
Object.defineProperty(exports, "resolveBinary", { enumerable: true, get: function () { return resolveBinary_js_1.resolveBinary; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,yDAAmD;AAE1C,8FAFA,gCAAa,OAEA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveBinary.d.ts","sourceRoot":"","sources":["../src/resolveBinary.ts"],"names":[],"mappings":"AAEA;;KAEK;AACL,wBAAgB,aAAa,IAAI,MAAM,CAkBtC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveBinary = void 0;
|
|
4
|
+
const node_process_1 = require("node:process");
|
|
5
|
+
/**
|
|
6
|
+
* Resolve path to dbmate for the current platform
|
|
7
|
+
* */
|
|
8
|
+
function resolveBinary() {
|
|
9
|
+
const ext = node_process_1.platform === "win32" ? ".exe" : "";
|
|
10
|
+
const path = `@dbmate/${node_process_1.platform}-${node_process_1.arch}/bin/dbmate${ext}`;
|
|
11
|
+
try {
|
|
12
|
+
return require.resolve(path);
|
|
13
|
+
}
|
|
14
|
+
catch (err) {
|
|
15
|
+
if (err != undefined &&
|
|
16
|
+
typeof err === "object" &&
|
|
17
|
+
"code" in err &&
|
|
18
|
+
err.code === "MODULE_NOT_FOUND") {
|
|
19
|
+
throw new Error(`Unable to locate dbmate binary '${path}'`);
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
throw err;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.resolveBinary = resolveBinary;
|
|
27
|
+
//# sourceMappingURL=resolveBinary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveBinary.js","sourceRoot":"","sources":["../src/resolveBinary.ts"],"names":[],"mappings":";;;AAAA,+CAA8C;AAE9C;;KAEK;AACL,SAAgB,aAAa;IAC3B,MAAM,GAAG,GAAG,uBAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;IAC/C,MAAM,IAAI,GAAG,WAAW,uBAAQ,IAAI,mBAAI,cAAc,GAAG,EAAE,CAAC;IAE5D,IAAI;QACF,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;KAC9B;IAAC,OAAO,GAAG,EAAE;QACZ,IACE,GAAG,IAAI,SAAS;YAChB,OAAO,GAAG,KAAK,QAAQ;YACvB,MAAM,IAAI,GAAG;YACb,GAAG,CAAC,IAAI,KAAK,kBAAkB,EAC/B;YACA,MAAM,IAAI,KAAK,CAAC,mCAAmC,IAAI,GAAG,CAAC,CAAC;SAC7D;aAAM;YACL,MAAM,GAAG,CAAC;SACX;KACF;AACH,CAAC;AAlBD,sCAkBC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dbmate",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "A lightweight, framework-agnostic database migration tool",
|
|
5
5
|
"repository": "https://github.com/amacneil/dbmate",
|
|
6
6
|
"homepage": "https://github.com/amacneil/dbmate#readme",
|
|
@@ -15,15 +15,21 @@
|
|
|
15
15
|
"schema",
|
|
16
16
|
"sqlite"
|
|
17
17
|
],
|
|
18
|
-
"bin":
|
|
19
|
-
|
|
18
|
+
"bin": "./dist/cli.js",
|
|
19
|
+
"main": "./dist/index.js",
|
|
20
|
+
"files": [
|
|
21
|
+
"dist"
|
|
22
|
+
],
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "tsc --build"
|
|
20
25
|
},
|
|
21
26
|
"optionalDependencies": {
|
|
22
|
-
"@dbmate/linux-
|
|
23
|
-
"@dbmate/linux-
|
|
24
|
-
"@dbmate/linux-arm": "2.0
|
|
25
|
-
"@dbmate/
|
|
26
|
-
"@dbmate/darwin-
|
|
27
|
-
"@dbmate/
|
|
27
|
+
"@dbmate/linux-ia32": "2.2.0",
|
|
28
|
+
"@dbmate/linux-x64": "2.2.0",
|
|
29
|
+
"@dbmate/linux-arm": "2.2.0",
|
|
30
|
+
"@dbmate/linux-arm64": "2.2.0",
|
|
31
|
+
"@dbmate/darwin-x64": "2.2.0",
|
|
32
|
+
"@dbmate/darwin-arm64": "2.2.0",
|
|
33
|
+
"@dbmate/win32-x64": "2.2.0"
|
|
28
34
|
}
|
|
29
35
|
}
|
package/bin/dbmate.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const { arch, platform } = require("process");
|
|
4
|
-
const { realpathSync } = require("fs");
|
|
5
|
-
const { spawnSync } = require("child_process");
|
|
6
|
-
const { fileURLToPath } = require("url");
|
|
7
|
-
const { dirname } = require("path");
|
|
8
|
-
|
|
9
|
-
const packageName = `@dbmate/${platform}-${arch}`;
|
|
10
|
-
const binName = platform === "win32" ? "dbmate.exe" : "dbmate";
|
|
11
|
-
let binPath = `${packageName}/bin/${binName}`;
|
|
12
|
-
|
|
13
|
-
try {
|
|
14
|
-
binPath = require.resolve(binPath);
|
|
15
|
-
} catch (error) {
|
|
16
|
-
console.error(`Error: Unable to locate package ${packageName}`);
|
|
17
|
-
process.exit(1);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const child = spawnSync(binPath, process.argv.slice(2), { stdio: "inherit" });
|
|
21
|
-
process.exit(child.status);
|