Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write node-pg-migrate in TypeScript #502

Merged
merged 58 commits into from
Nov 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
47b984d
Add typescript to devDependencies
Nov 1, 2019
2067f8a
Initiate tsconfig
Nov 1, 2019
7f4b307
Copy content from lib to src
Nov 1, 2019
86a98fa
Change file extensions to ts
Nov 1, 2019
7f1dcd6
Use import/export statements
Nov 1, 2019
8261818
Use import/export statements
Nov 1, 2019
002617f
Override prettier config for ts
Nov 1, 2019
3aa300e
Define class members
Nov 1, 2019
d23de9f
Export runner
Nov 1, 2019
770be35
Ignore template files
Nov 1, 2019
12c9a7b
Add types for mkdirp
Nov 1, 2019
725ea4a
Move type defs to appropriate implementations
Nov 1, 2019
cc13e16
Move DB definition to db
Nov 1, 2019
22c383f
Organize imports
Nov 1, 2019
c0b21f7
Init definitions for createSchemalize
Nov 1, 2019
26aefc9
Move RunnerOption to runner file
Nov 1, 2019
1ca70fe
Add PgType to definitions
Nov 1, 2019
cf2e9e3
Improve type definitions
Nov 1, 2019
eb4a432
Use esModuleInterop
Nov 1, 2019
8d53b99
Use module.exports for Migration
Nov 1, 2019
f21569a
Use module.exports for db
Nov 1, 2019
36d1d42
Use module.exports for runner
Nov 1, 2019
96d2702
Seems we need both: export default and module.exports
Nov 1, 2019
5bac45b
Improve type definitions
Nov 1, 2019
bf25520
Improve type definitions
Nov 2, 2019
fa1851f
Add MigrationOptions
Nov 2, 2019
8d3931e
Add build command
Nov 2, 2019
1c4b9ed
Undo formatting
Nov 2, 2019
2fadf9d
Add type MigrationDirection
Nov 2, 2019
4af4c95
Add build before compile
Nov 2, 2019
b0b49b1
Add interface RunMigration
Nov 2, 2019
e93b4cb
Add interface RunMigration
Nov 2, 2019
d870d2b
Merge branch 'typescript' of github.com:Shinigami92/node-pg-migrate i…
Nov 2, 2019
f9f3299
Merge branch 'typescript' of github.com:Shinigami92/node-pg-migrate i…
Nov 2, 2019
b3b3ccb
Revoke push of yarn.lock
Nov 2, 2019
b999edf
Define function argument parameters
Nov 2, 2019
07273ce
Improve type definitions
Nov 2, 2019
5577789
Remove string from ColumnDefinitions
Nov 2, 2019
588b4dc
Improve type definitions
Nov 2, 2019
b19761f
Ignore lib folder
Nov 2, 2019
e5bc24c
TriggerOptions extends FunctionOptions
Nov 2, 2019
1f71ff3
Use module.exports.loadMigrationFiles
Nov 2, 2019
38bb98d
Set noImplicitAny
Nov 2, 2019
106f921
Add type definitions
Nov 2, 2019
58d882d
Set indexMethod to string
Nov 2, 2019
f292bd4
Define CreateSchemaOptions
Nov 2, 2019
3cd7925
Add parameter type definitions
Nov 2, 2019
f7d5dd9
Improve type definitions
Nov 2, 2019
76e545b
Improve type definitions
Nov 2, 2019
5e239b6
Remove options from lock
Nov 6, 2019
08ff07f
Improve query with string type
Nov 6, 2019
8b40202
Key of ColumnDefinitions can be a string
Nov 7, 2019
a425600
Improve types of storage parameter
Nov 7, 2019
9d4655c
Move templates
Nov 7, 2019
527876a
Ignore tsc exit code
Nov 7, 2019
86b5fa4
Remove generated files
dolezel Nov 8, 2019
154757e
Fixing ts errors
dolezel Nov 8, 2019
7223717
Few type fixes
dolezel Nov 8, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
lib/migration-template.js
lib/migration-template.ts
node_modules
dist
lib
templates
src
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
*.log
/migrations
/node_modules
/dist*/**
/dist
/lib
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
*.log
migrations/
test/
src/
mocha*
renovate.json
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lib/migration-template.js
templates
4 changes: 4 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ module.exports = {
{
files: '*.md',
options: { parser: 'markdown' }
},
{
files: '*.ts',
options: { parser: 'typescript' }
}
]
};
4 changes: 2 additions & 2 deletions bin/node-pg-migrate
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,8 @@ if (action === 'create') {
MIGRATIONS_FILE_LANGUAGE,
IGNORE_PATTERN
)
.then(migration => {
console.log(util.format('Created migration -- %s', migration.path));
.then(migrationPath => {
console.log(util.format('Created migration -- %s', migrationPath));
process.exit(0);
})
.catch(err => {
Expand Down
2 changes: 1 addition & 1 deletion docs/triggers.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
- `operation` _[string or array of strings]_ - `INSERT`, `UPDATE[ OF ...]`, `DELETE` or `TRUNCATE`
- `constraint` _[boolean]_ - creates constraint trigger
- `function` _[[Name](migrations.md#type)]_ - the name of procedure to execute
- `functionArgs` _[array]_ - parameters of the procedure
- `functionParams` _[array]_ - parameters of the procedure
- `level` _[string]_ - `STATEMENT`, or `ROW`
- `condition` _[string]_ - condition to met to execute trigger
- `deferrable` _[boolean]_ - flag for deferrable constraint trigger
Expand Down
4 changes: 2 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export interface ForeignKeyOptions extends ReferencesOptions {

export interface ConstraintOptions {
check?: string | string[]
unique?: Name[] | Name[][]
unique?: Name | Name[] | Name[][]
primaryKey?: Name | Name[]
foreignKeys?: ForeignKeyOptions | ForeignKeyOptions[]
exclude?: string
Expand Down Expand Up @@ -513,7 +513,7 @@ export interface MigrationBuilder {
createView(viewName: Name, options: CreateViewOptions, definition: string): void
dropView(viewName: Name, options?: DropOptions): void
alterView(viewName: Name, options: AlterViewOptions): void
alterViewColumn(viewName: Name, options: AlterViewColumnOptions): void
alterViewColumn(viewName: Name, columnName: string, options: AlterViewColumnOptions): void
renameView(viewName: Name, newViewName: Name): void

createMaterializedView(viewName: Name, options: CreateMaterializedViewOptions, definition: string): void
Expand Down
89 changes: 0 additions & 89 deletions lib/db.js

This file was deleted.

202 changes: 0 additions & 202 deletions lib/migration-builder.js

This file was deleted.

Loading