node-pg-migrate
Advanced tools
Comparing version 6.0.0 to 6.1.0
# Change Log | ||
## [6.0.0](2021-09-20) | ||
### Breaking changes | ||
- Drop node 10 support [#808](https://github.com/salsita/node-pg-migrate/pull/808) | ||
### Fixed | ||
- Put migrations table check inside lock [#830](https://github.com/salsita/node-pg-migrate/pull/830) | ||
## [5.10.0](2021-06-29) | ||
@@ -4,0 +14,0 @@ |
@@ -21,2 +21,3 @@ import runner from './runner'; | ||
import { CreateMaterializedView, DropMaterializedView, AlterMaterializedView, RenameMaterializedView, RenameMaterializedViewColumn, RefreshMaterializedView, CreateMaterializedViewOptions, AlterMaterializedViewOptions, RefreshMaterializedViewOptions } from './operations/viewsMaterializedTypes'; | ||
export { runner as default, PgLiteral, Migration, PgType, MigrationBuilder, RunnerOption, PgLiteralValue, Value, Name, Type, IfExistsOption, IfNotExistsOption, CascadeOption, DropOptions, CreateTable, DropTable, AlterTable, RenameTable, AddColumns, DropColumns, AlterColumn, RenameColumn, CreateConstraint, DropConstraint, RenameConstraint, ColumnDefinition, ColumnDefinitions, TableOptions, AlterTableOptions, AlterColumnOptions, ConstraintOptions, CreateDomain, DropDomain, AlterDomain, RenameDomain, DomainOptionsCreate, DomainOptionsAlter, CreateExtension, DropExtension, Extension, CreateExtensionOptions, CreateFunction, DropFunction, RenameFunction, FunctionParam, FunctionOptions, DropIndex, CreateIndex, CreateIndexOptions, DropIndexOptions, CreateOperator, DropOperator, CreateOperatorClass, DropOperatorClass, RenameOperatorClass, CreateOperatorFamily, DropOperatorFamily, AddToOperatorFamily, RenameOperatorFamily, RemoveFromOperatorFamily, CreateOperatorOptions, DropOperatorOptions, OperatorListDefinition, CreateOperatorClassOptions, Sql, CreatePolicy, DropPolicy, AlterPolicy, RenamePolicy, CreatePolicyOptions, PolicyOptions, CreateRole, DropRole, AlterRole, RenameRole, RoleOptions, CreateSequence, DropSequence, AlterSequence, RenameSequence, SequenceOptionsCreate, SequenceOptionsAlter, CreateSchema, DropSchema, RenameSchema, CreateSchemaOptions, CreateTrigger, DropTrigger, RenameTrigger, TriggerOptions, CreateType, DropType, RenameType, AddTypeAttribute, DropTypeAttribute, SetTypeAttribute, AddTypeValue, RenameTypeAttribute, RenameTypeValue, AddTypeValueOptions, CreateView, DropView, AlterView, AlterViewColumn, RenameView, CreateViewOptions, AlterViewOptions, AlterViewColumnOptions, CreateMaterializedView, DropMaterializedView, AlterMaterializedView, RenameMaterializedView, RenameMaterializedViewColumn, RefreshMaterializedView, CreateMaterializedViewOptions, AlterMaterializedViewOptions, RefreshMaterializedViewOptions, }; | ||
export { PgLiteral, Migration, PgType, MigrationBuilder, RunnerOption, PgLiteralValue, Value, Name, Type, IfExistsOption, IfNotExistsOption, CascadeOption, DropOptions, CreateTable, DropTable, AlterTable, RenameTable, AddColumns, DropColumns, AlterColumn, RenameColumn, CreateConstraint, DropConstraint, RenameConstraint, ColumnDefinition, ColumnDefinitions, TableOptions, AlterTableOptions, AlterColumnOptions, ConstraintOptions, CreateDomain, DropDomain, AlterDomain, RenameDomain, DomainOptionsCreate, DomainOptionsAlter, CreateExtension, DropExtension, Extension, CreateExtensionOptions, CreateFunction, DropFunction, RenameFunction, FunctionParam, FunctionOptions, DropIndex, CreateIndex, CreateIndexOptions, DropIndexOptions, CreateOperator, DropOperator, CreateOperatorClass, DropOperatorClass, RenameOperatorClass, CreateOperatorFamily, DropOperatorFamily, AddToOperatorFamily, RenameOperatorFamily, RemoveFromOperatorFamily, CreateOperatorOptions, DropOperatorOptions, OperatorListDefinition, CreateOperatorClassOptions, Sql, CreatePolicy, DropPolicy, AlterPolicy, RenamePolicy, CreatePolicyOptions, PolicyOptions, CreateRole, DropRole, AlterRole, RenameRole, RoleOptions, CreateSequence, DropSequence, AlterSequence, RenameSequence, SequenceOptionsCreate, SequenceOptionsAlter, CreateSchema, DropSchema, RenameSchema, CreateSchemaOptions, CreateTrigger, DropTrigger, RenameTrigger, TriggerOptions, CreateType, DropType, RenameType, AddTypeAttribute, DropTypeAttribute, SetTypeAttribute, AddTypeValue, RenameTypeAttribute, RenameTypeValue, AddTypeValueOptions, CreateView, DropView, AlterView, AlterViewColumn, RenameView, CreateViewOptions, AlterViewOptions, AlterViewColumnOptions, CreateMaterializedView, DropMaterializedView, AlterMaterializedView, RenameMaterializedView, RenameMaterializedViewColumn, RefreshMaterializedView, CreateMaterializedViewOptions, AlterMaterializedViewOptions, RefreshMaterializedViewOptions, }; | ||
export default runner; |
@@ -6,5 +6,4 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.PgType = exports.Migration = exports.PgLiteral = exports.default = void 0; | ||
exports.PgType = exports.Migration = exports.PgLiteral = void 0; | ||
const runner_1 = __importDefault(require("./runner")); | ||
exports.default = runner_1.default; | ||
const migration_1 = require("./migration"); | ||
@@ -16,1 +15,2 @@ Object.defineProperty(exports, "Migration", { enumerable: true, get: function () { return migration_1.Migration; } }); | ||
exports.PgLiteral = PgLiteral_1.default; | ||
exports.default = runner_1.default; |
@@ -114,3 +114,5 @@ "use strict"; | ||
if (action.length === 2) { | ||
await new Promise((resolve) => action(pgm, resolve)); | ||
await new Promise((resolve) => { | ||
action(pgm, resolve); | ||
}); | ||
} | ||
@@ -117,0 +119,0 @@ else { |
@@ -21,2 +21,3 @@ import { Name, DropOptions } from './generalTypes'; | ||
export interface DropIndexOptions extends DropOptions { | ||
unique?: boolean; | ||
name?: string; | ||
@@ -23,0 +24,0 @@ concurrently?: boolean; |
@@ -27,3 +27,8 @@ "use strict"; | ||
return new migration_1.Migration(db, filePath, actions, options, Object.assign({}, shorthands), logger); | ||
}))).sort((m1, m2) => m1.timestamp - m2.timestamp); | ||
}))).sort((m1, m2) => { | ||
const compare = m1.timestamp - m2.timestamp; | ||
if (compare !== 0) | ||
return compare; | ||
return m1.name.localeCompare(m2.name); | ||
}); | ||
} | ||
@@ -30,0 +35,0 @@ catch (err) { |
@@ -25,5 +25,5 @@ import { ColumnDefinitions, ColumnDefinition } from './operations/tablesTypes'; | ||
export declare const applyType: (type: Type, extendingTypeShorthands?: ColumnDefinitions) => ColumnDefinition & FunctionParamType; | ||
export declare const formatParams: (params: FunctionParam[] | undefined, mOptions: MigrationOptions) => string; | ||
export declare const formatParams: (params: FunctionParam[], mOptions: MigrationOptions) => string; | ||
export declare const makeComment: (object: string, name: string, text?: string | null | undefined) => string; | ||
export declare const formatLines: (lines: string[], replace?: string, separator?: string) => string; | ||
export declare function intersection<T>(list1: T[], list2: T[]): T[]; |
@@ -154,3 +154,3 @@ "use strict"; | ||
}; | ||
const formatParams = (params = [], mOptions) => `(${params.map(formatParam(mOptions)).join(', ')})`; | ||
const formatParams = (params, mOptions) => `(${params.map(formatParam(mOptions)).join(', ')})`; | ||
exports.formatParams = formatParams; | ||
@@ -157,0 +157,0 @@ const makeComment = (object, name, text) => { |
@@ -43,1 +43,4 @@ # Index Operations | ||
- `name` _[string]_ - name of the index to drop | ||
- `concurrently` _[boolean]_ - drop this index concurrently | ||
- `ifExists` _[boolean]_ - default false | ||
- `cascade` _[boolean]_ - default false |
{ | ||
"name": "node-pg-migrate", | ||
"version": "6.0.0", | ||
"version": "6.1.0", | ||
"description": "Postgresql database migration management tool for node.js", | ||
@@ -37,3 +37,3 @@ "author": "Theo Ephraim", | ||
"engines": { | ||
"node": ">=12.13.0" | ||
"node": ">=12.20.0" | ||
}, | ||
@@ -52,6 +52,6 @@ "bugs": { | ||
"mkdirp": "~1.0.0", | ||
"yargs": "~17.1.0" | ||
"yargs": "~17.3.0" | ||
}, | ||
"devDependencies": { | ||
"@types/chai": "4.2.21", | ||
"@types/chai": "4.3.0", | ||
"@types/chai-as-promised": "7.1.4", | ||
@@ -61,6 +61,6 @@ "@types/mkdirp": "1.0.2", | ||
"@types/proxyquire": "1.3.28", | ||
"@types/sinon": "10.0.2", | ||
"@types/sinon-chai": "3.2.5", | ||
"@typescript-eslint/eslint-plugin": "4.31.1", | ||
"@typescript-eslint/parser": "4.31.1", | ||
"@types/sinon": "10.0.6", | ||
"@types/sinon-chai": "3.2.6", | ||
"@typescript-eslint/eslint-plugin": "5.7.0", | ||
"@typescript-eslint/parser": "5.7.0", | ||
"chai": "4.3.4", | ||
@@ -73,21 +73,21 @@ "chai-as-promised": "7.1.1", | ||
"dotenv-expand": "5.1.0", | ||
"eslint": "7.32.0", | ||
"eslint-config-airbnb-base": "14.2.1", | ||
"eslint": "8.4.1", | ||
"eslint-config-airbnb-base": "15.0.0", | ||
"eslint-config-prettier": "8.3.0", | ||
"eslint-import-resolver-typescript": "2.5.0", | ||
"eslint-plugin-import": "2.24.2", | ||
"eslint-plugin-import": "2.25.3", | ||
"eslint-plugin-prettier": "4.0.0", | ||
"eslint-plugin-security": "1.4.0", | ||
"husky": "7.0.2", | ||
"husky": "7.0.4", | ||
"json5": "2.2.0", | ||
"lint-staged": "11.1.2", | ||
"mocha": "9.1.1", | ||
"lint-staged": "12.1.2", | ||
"mocha": "9.1.3", | ||
"pg": "8.7.1", | ||
"prettier": "2.4.1", | ||
"prettier": "2.5.1", | ||
"proxyquire": "2.1.3", | ||
"rimraf": "3.0.2", | ||
"sinon": "11.1.2", | ||
"sinon": "12.0.1", | ||
"sinon-chai": "3.7.0", | ||
"ts-node": "10.2.1", | ||
"typescript": "4.4.3" | ||
"ts-node": "10.4.0", | ||
"typescript": "4.5.4" | ||
}, | ||
@@ -94,0 +94,0 @@ "peerDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
293312
3584
+ Addedyargs@17.3.1(transitive)
+ Addedyargs-parser@21.1.1(transitive)
- Removedyargs@17.1.1(transitive)
- Removedyargs-parser@20.2.9(transitive)
Updatedyargs@~17.3.0