diff --git a/README.md b/README.md index b1a30e867..cc836ed93 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,8 @@ The principles that we believe in are: Installation ------------ +**WARNING**: It is **NOT** recommended to create the database using the db:migrate command during the installation process. Some migrations in the project have become outdated due to Rails updates during the application's development. Therefore, if you create the database from scratch using these outdated migrations instead of loading the current schema, the application will not function as intended, and some tests will fail. Be aware! + First up, your system will need the [prerequisites for running Ruby on Rails installed](https://guides.rubyonrails.org/getting_started.html) Once you have these: @@ -135,9 +137,7 @@ Or using docker: # Prepare container $ docker compose build $ docker compose run --rm web yarn install - $ docker compose run --rm web bundle exec rake db:create - $ docker compose run --rm web bundle exec rake db:migrate - $ docker compose run --rm web bundle exec rake db:seed + $ docker compose run --rm web bundle exec rake db:setup # Up container $ docker compose up diff --git a/app/models/project.rb b/app/models/project.rb index 949fd0234..5ba1a191d 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -28,7 +28,7 @@ class Project < ApplicationRecord has_many :integrations, dependent: :destroy has_many :changesets, dependent: :destroy has_many :integrations, dependent: :destroy - has_many :ownerships + has_many :ownerships, dependent: :destroy has_many :teams, through: :ownerships has_many :memberships, dependent: :destroy has_many :users, -> { distinct }, through: :memberships diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index 569087820..8fedf5c82 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -289,6 +289,7 @@ subject { build :project } it { is_expected.to belong_to(:tag_group) } it { is_expected.to have_many(:changesets) } + it { is_expected.to have_many(:ownerships).dependent(:destroy) } end describe '#as_json' do