refactor(users-buckets): migrate users and bucket models#211
Merged
refactor(users-buckets): migrate users and bucket models#211
Conversation
028bda3 to
d303bb7
Compare
ae79332 to
e7ce7f6
Compare
Base automatically changed from
refactor/remove-service-middleware-dependency
to
master
April 7, 2026 10:27
apsantiso
commented
Apr 7, 2026
Comment on lines
+76
to
+89
| Database.prototype._createBoundModels = function () { | ||
| const bound = {}; | ||
|
|
||
| const allModels = { | ||
| ...Database.externalModels, | ||
| ...Database.localModels, | ||
| }; | ||
|
|
||
| for (const model in allModels) { | ||
| bound[model] = allModels[model](this.connection); | ||
| } | ||
|
|
||
| return bound; | ||
| }; |
Author
There was a problem hiding this comment.
The models initialize their connection in the external library so I copied the same file to this repository to initialize the connection for external and local models instead of using https://github.com/internxt/service-storage-models/blob/master/index.js
apsantiso
commented
Apr 7, 2026
| return createdUser | ||
| type Args = { storage?: any; user: TestUser }; | ||
|
|
||
| const createdUsers: User[] = []; |
Author
There was a problem hiding this comment.
The e2e seeder broke due to the migration to promises
d303bb7 to
ebb352d
Compare
sg-gs
reviewed
Apr 8, 2026
lib/server/routes/users.js
Outdated
| const user = await User.create({ | ||
| email: req.body.email, | ||
| password: req.body.password, | ||
| maxSpaceBytes: 1024 * 1024 * 1024 * 2, |
sg-gs
approved these changes
Apr 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The strategy is to migrate the models gradually, the connection initialization is a bit weird and coupled to how Storj and the models expect it so I had to migrate the class they use to bound all the models and the connection.
Changes