Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Feature: Shared model definitions#63

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
Damienmarble wants to merge18 commits intoKSDaemon:master
base:master
Choose a base branch
Loading
fromThisIsNoZaku:feature/shared_model_definitions

Conversation

@Damienmarble
Copy link
Contributor

@DamienmarbleDamienmarble commentedFeb 15, 2019
edited
Loading

Description, Motivation and Context

Adds support for sharing model definitions between multiple sequelize datasources automatically.

What is the current behavior?

Models can only be created for a single datasource at a time.

What is the new behavior?

When multiple datasources are configured and theconfig/sequelize.js propertyshareModelsAmongConnections istrue, any models where theconnection property is not explicitly set will be added to all sequelize connections.

Additionally, if sails models are configured to expose models globally, the shared models can be access through the global model class through a property with the same name as the associated datasource. e.g.Model[datasourceName].someMethod()

What kind of change does this PR introduce?

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • I have added tests to cover my changes.
  • Overall test coverage is not decreased.
  • All new and existing tests passed.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

ThisIsNoZakuand others added13 commitsFebruary 14, 2019 14:02
Ensure that models which did not have a connection defined and are being associated with the default datasource do not have their connection property set.
Configures a second database for supporting multiple datasources.
Allows removing other logic involving checking for reconciling if the default datasource has not yet been run when exporting models to globals.
@KSDaemon
Copy link
Owner

Seems that this work is not finished yet...

@Damienmarble
Copy link
ContributorAuthor

I'm looking at why the tests succeed locally but fail in travis.

@coveralls
Copy link

Coverage Status

Coverage decreased (-19.2%) to 71.138% when pulling2da50be on ThisIsNoZaku:feature/shared_model_definitions intofd61411 on KSDaemon:master.

@KSDaemon
Copy link
Owner

I've refactored tests heavily. So, please, pull updates from master into your code

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@Damienmarble@KSDaemon@coveralls@ThisIsNoZaku

[8]ページ先頭

©2009-2025 Movatter.jp