Top Menu

Jump to content
Home
    Modules
      • Projects
      • Activity
      • Work packages
      • Gantt charts
      • Calendars
      • Team planners
      • Boards
      • News
    • Getting started
    • Introduction video
      Welcome to OpenProject Community
      Get a quick overview of project management and team collaboration with OpenProject. You can restart this video from the help menu.

    • Help and support
    • Upgrade to Enterprise edition
    • User guides
    • Videos
    • Shortcuts
    • Community forum
    • Enterprise support

    • Additional resources
    • Data privacy and security policy
    • Digital accessibility (DE)
    • OpenProject website
    • Security alerts / Newsletter
    • OpenProject blog
    • Release notes
    • Report a bug
    • Development roadmap
    • Add and edit translations
    • API documentation
  • Sign in
      Forgot your password?

      or sign in with your existing account

      Google

Side Menu

  • Overview
  • Activity
    Activity
  • Roadmap
  • Work packages
    Work packages
  • Gantt charts
    Gantt charts
  • Calendars
    Calendars
  • Team planners
    Team planners
  • Boards
    Boards
  • News
  • Forums

Content

Development
  1. OpenProject
  2. Forums
  3. Development
  4. Database schema does not contain relationships?

Database schema does not contain relationships?

Added by Hanxue Lee over 7 years ago

I would like to contribute to OpenProject and currently looking at the source code. When I look at the database, I do not see any relationships between tables.

Specifically, when I look at the ActiveRecords migration script as well as the generated Postgresql database schema, there is no relationship defined. See my Postgresql database dump

https://gist.github.com/hanxue/e92dc71e66b3e43cabfeae2e723921d2

Am I missing anything from https://www.openproject.org/development/setting-up-development-environment/ ?

Database migration runs successfully

@ ./bin/rake db:migrate db:seed db:test:prepare@

And I can run OpenProject locally without any problems

$ gem install foreman $ foreman start -f Procfile.dev


Replies (1)

RE: Database schema does not contain relationships? - Added by Jens Ulferts over 7 years ago

Glad that you are interested in supporting OpenProject development. Every bit of help is appreciated.

The relationships between the objects is modelled less strictly in the database. There are hardly any foreign key constraints and generally speaking, very few constraints on the db level at all. From the top of my head I’d say that apart from constraints enforced by uniq indices there do not exist any. So while there are columns that represent references to entries in a different table (e.g. author_id in the work_packages table which references entries in the users table) those references are not enforced by database means.

This is not ideal but as of now has not troubled us much as the relationships are modelled in the rails application via active record associations. The OpenProject application is the only application accessing the db and as long as that is the case we will get away with relying on the the framework.

And as the application seems to be working ok, everything should be good for you to start :)

  • (1 - 1/1)
Loading...