-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
feat(core): Add migration to add property userActivated to user settings (no-changelog) #5940
Conversation
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. |
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.
@krynble quite weird as I tested it. Will have a look. THanks |
@krynble cannot replicate the issue. It works just fine for me. Are you starting n8n with a new database? |
tests failing on the CI as well https://github.com/n8n-io/n8n/actions/runs/4669890935/jobs/8268940696 |
packages/cli/src/databases/migrations/mysqldb/1681134145996-AddUserActivatedProperty.ts
Outdated
Show resolved
Hide resolved
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## master #5940 +/- ##
==========================================
+ Coverage 18.49% 18.64% +0.14%
==========================================
Files 2563 2583 +20
Lines 116018 116471 +453
Branches 18118 18179 +61
==========================================
+ Hits 21458 21714 +256
- Misses 93930 94119 +189
- Partials 630 638 +8 see 84 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
packages/cli/src/databases/migrations/mysqldb/1681134145996-AddUserActivatedProperty.ts
Outdated
Show resolved
Hide resolved
✅ All Cypress E2E specs passed |
@krynble ended up stringifying the setting and it works with both scenarios (when the query returns a string and when it returns an object) and it's more simple than having an IF to do one or the other. |
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, working for all databases and set up.
✅ All Cypress E2E specs passed |
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, Postgres.
Commented on one migration but also applies to the others.
packages/cli/src/databases/migrations/mysqldb/1681134145996-AddUserActivatedProperty.ts
Outdated
Show resolved
Hide resolved
packages/cli/src/databases/migrations/mysqldb/1681134145996-AddUserActivatedProperty.ts
Show resolved
Hide resolved
packages/cli/src/databases/migrations/mysqldb/1681134145996-AddUserActivatedProperty.ts
Show resolved
Hide resolved
packages/cli/src/databases/migrations/postgresdb/1681134145996-AddUserActivatedProperty.ts
Outdated
Show resolved
Hide resolved
✅ All Cypress E2E specs passed |
3 similar comments
✅ All Cypress E2E specs passed |
✅ All Cypress E2E specs passed |
✅ All Cypress E2E specs passed |
✅ All Cypress E2E specs passed |
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.
Thanks for addressing!
One doubt I still have:
Re: this comment, if the value at user.settings
before the up migration was NULL
, running a down migration with JSON_REMOVE()
will not restore it back to NULL
, i.e., it will only remove the new property and if it was the only one, we will end up with {}
. Same for Postgres using -
. But let me know if I'm misunderstanding.
✅ All Cypress E2E specs passed |
I see now what you mean. Previously null values will be now {}. I guess I can update all {} to be null after the first query runs. |
✅ All Cypress E2E specs passed |
* master: feat(core): Add migration to add property userActivated to user settings (no-changelog) (#5940) feat(core): Add license:info command (#6047) feat: Replace this.$refs.refName as Vue with InstanceType<T> (no-changelog) (#6050) refactor(editor): Turn titleChange mixin to composable (#6059) test: Add stickies tests (#5413) refactor: Patch to adjust `consistent-type-imports` (no-changelog) (#6057) # Conflicts: # packages/editor-ui/src/components/ExecutionsView/ExecutionPreview.vue # packages/editor-ui/src/mixins/workflowRun.ts
* master: (47 commits) feat: Replace Vue.extend with defineComponent in editor-ui (no-changelog) (#6033) feat(core): Add migration to add property userActivated to user settings (no-changelog) (#5940) feat(core): Add license:info command (#6047) feat: Replace this.$refs.refName as Vue with InstanceType<T> (no-changelog) (#6050) refactor(editor): Turn titleChange mixin to composable (#6059) test: Add stickies tests (#5413) refactor: Patch to adjust `consistent-type-imports` (no-changelog) (#6057) fix(editor): Resolve expressions for grandparent nodes (#5859) ci(editor): Do not run parallel jobs for a single spec (no-changelog) (#6052) refactor(editor): Consolidate IN8nUISettings interface (#6055) refactor(core): Forbid raw enums (no-changelog) refactor(core): Sort variables files under variables folder (#6051) fix(core): Add breaking change record for domain and url matching (no-changelog) (#6048) feat(editor): Version control paywall (WIP) (#6030) feat(editor): Add disable template experiment (#5963) feat(core): Upgrade google-timezones-json to use the correct timezone for Sao Paulo (#6042) fix(Code Node): Update vm2 to address CVE-2023-30547 (#6039) docs: Add proprietary license text (no-changelog) (#6038) test(n8n Node): Unit tests (no-changelog) refactor: Accumulate `loadOptions` from all node versions to validate (no-changelog) (#6014) ... # Conflicts: # packages/cli/src/Server.ts
…ngs (no-changelog) (n8n-io#5940) * Add userActivated migration * Fix migration logic * Remove duplication when retrieving the activated users * Fix bug updating settings in mysql * Make userSettings type conform with naming convention * Disable naming convention rule only in IDatabaseCollections interface * Fix down method in Postgres migration * Reset '{}' to NULL when reversing migration
Got released with |
Context: ADO-460