-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
refactor(core): Delete boilerplate code across migrations (no-changelog) #5254
Conversation
517a482
to
e5118c7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see note
packages/cli/src/databases/migrations/sqlite/1669739707124-AddWorkflowVersionIdColumn.ts
Outdated
Show resolved
Hide resolved
27ff255
to
eb55720
Compare
93a65c0
to
43e8287
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems ok, tested starting n8n with all databases, all executed fine.
cb1bc4d
to
3adfccb
Compare
3adfccb
to
aa230f3
Compare
Great PR! Please pay attention to the following items before merging: Files matching
Files matching
Files matching
Make sure to check off this list before asking for review. |
aa230f3
to
ca3be2c
Compare
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #5254 +/- ##
=======================================
Coverage 20.06% 20.06%
=======================================
Files 2622 2621 -1
Lines 118091 118110 +19
Branches 18557 18559 +2
=======================================
+ Hits 23691 23702 +11
- Misses 93685 93692 +7
- Partials 715 716 +1
☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like this! Reviewed but untested.
packages/cli/src/databases/migrations/mysqldb/1592447867632-WebhookModel.ts
Show resolved
Hide resolved
packages/cli/src/databases/migrations/mysqldb/1671726148420-RemoveWorkflowDataLoadedFlag.ts
Show resolved
Hide resolved
packages/cli/src/databases/migrations/mysqldb/1675940580449-PurgeInvalidWorkflowConnections.ts
Show resolved
Hide resolved
tablePrefix: string; | ||
dbType: DatabaseType; | ||
dbName: string; | ||
migrationName: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to also add helpers like loadSurveyFromDisk
and escapeQuery
to the context? Maybe under a utils
field?
packages/cli/src/databases/migrations/mysqldb/1588157391238-InitialMigration.ts
Show resolved
Hide resolved
… to not accidentally forget down migrations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I'll test this later today. Some scattered ideas for future:
- Any benefit to using the
useStructuredResult
arg toqueryRunner.query()
? - Require specifying the reason when choosing to use
IrreversibleMigration
? - Consolidate usage of
escapeQueryWithParameters
vs. unescaped queries? - Enforce double quotes on PG table names to avoid casing issues with prefixes?
- Require the re-enabling
PRAGMA
statement after a disabling one on sqlite? - Unify
isObjectLiteral
which is used in four different spots across packages?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on sqlite, MySQL 8, PG 13.8 (regular, alt schema, table prefix)
✅ All Cypress E2E specs passed |
* master: fix(FTP Node): Use filename instead of remote filepath for downloaded binary data (#6170) ci: Fix test database cleanup (no-changelog) (#6188) refactor(core): Delete boilerplate code across migrations (no-changelog) (#5254) refactor(editor): Add infix to Pinia stores (no-changelog) (#6149) ci: Fix linting issues on master (no-changelog) (#6186)
* master: (31 commits) feat(Date & Time Node): Overhaul of the node (#5904) refactor: Add deprecation notice for WEBHOOK_TUNNEL_URL (#6194) refactor: Add deprecation notice for WEBHOOK_TUNNEL_URL (#6194) feat(HubSpot Node): Overhaul the HubSpot Node (#4337) ci: Create a nightly v1 docker image (no-changelog) (#6197) refactor(core): Add deprecation notice for own mode (#6195) feat(core): Update config defaults for for v1 (no-changelog) (#6196) test(Read Binary Files Node): Unit tests (no-changelog) (#5459) refactor: Add deprecation notice for MySQL and MariaDB (#6189) test: Create custom jest error messages using jest-expect-message (no-changelog) (#5666) fix(core): Move nodeExecute InternalHook calls to hookFunctionsSave (#6193) fix(FTP Node): Use filename instead of remote filepath for downloaded binary data (#6170) ci: Fix test database cleanup (no-changelog) (#6188) refactor(core): Delete boilerplate code across migrations (no-changelog) (#5254) refactor(editor): Add infix to Pinia stores (no-changelog) (#6149) ci: Fix linting issues on master (no-changelog) (#6186) fix(editor): Update and add design system checkbox component to Editor (#6178) fix(editor): Display SSO entry in Settings on Cloud (#6181) feat(Code Node): Add Python support (#4295) fix(editor): Update and fix storybook (was failing to run in local dev mode) (#6180) ... # Conflicts: # packages/editor-ui/src/stores/nodeTypes.store.ts # packages/nodes-base/nodes/Postgres/Postgres.node.ts # packages/nodes-base/nodes/Postgres/v2/actions/versionDescription.ts
…rce-mapper-ui-P2 * feature/resource-mapping-component: (31 commits) feat(Date & Time Node): Overhaul of the node (#5904) refactor: Add deprecation notice for WEBHOOK_TUNNEL_URL (#6194) refactor: Add deprecation notice for WEBHOOK_TUNNEL_URL (#6194) feat(HubSpot Node): Overhaul the HubSpot Node (#4337) ci: Create a nightly v1 docker image (no-changelog) (#6197) refactor(core): Add deprecation notice for own mode (#6195) feat(core): Update config defaults for for v1 (no-changelog) (#6196) test(Read Binary Files Node): Unit tests (no-changelog) (#5459) refactor: Add deprecation notice for MySQL and MariaDB (#6189) test: Create custom jest error messages using jest-expect-message (no-changelog) (#5666) fix(core): Move nodeExecute InternalHook calls to hookFunctionsSave (#6193) fix(FTP Node): Use filename instead of remote filepath for downloaded binary data (#6170) ci: Fix test database cleanup (no-changelog) (#6188) refactor(core): Delete boilerplate code across migrations (no-changelog) (#5254) refactor(editor): Add infix to Pinia stores (no-changelog) (#6149) ci: Fix linting issues on master (no-changelog) (#6186) fix(editor): Update and add design system checkbox component to Editor (#6178) fix(editor): Display SSO entry in Settings on Cloud (#6181) feat(Code Node): Add Python support (#4295) fix(editor): Update and fix storybook (was failing to run in local dev mode) (#6180) ... # Conflicts: # packages/editor-ui/src/stores/nodeTypes.store.ts
Got released with |
This is part one of streamlining migrations code. Part two will be switching to a DSL that auto-generates the db specific queries from a single code.
This also enables linting on migrations.
DB Tests