mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-10 01:01:39 -05:00
Update migrations to validate foreign keys immediately upon creation.
This commit is contained in:
parent
cb9fb9911c
commit
f9d5762533
6 changed files with 16 additions and 12 deletions
|
|
@ -22,6 +22,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|||
- Removed useless system tests and cover map functionality with Playwright e2e tests instead.
|
||||
- Number of family members on self-hosted instances is no longer limited.
|
||||
- Export to GPX now adds adds speed and course to each point if they are available.
|
||||
- Single Dockerfile introduced so Dawarich could be run in self-hosted mode in production environment.
|
||||
- [ ] Check if with no changes to docker-compose.yml everything still works as before.
|
||||
- [ ] Deploy to Staging and test again.
|
||||
|
||||
|
||||
# [0.34.2] - 2025-10-31
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ class CreateFamilies < ActiveRecord::Migration[8.0]
|
|||
t.timestamps
|
||||
end
|
||||
|
||||
add_foreign_key :families, :users, column: :creator_id, validate: false
|
||||
add_foreign_key :families, :users, column: :creator_id
|
||||
add_index :families, :creator_id
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ class CreateFamilyMemberships < ActiveRecord::Migration[8.0]
|
|||
t.timestamps
|
||||
end
|
||||
|
||||
add_foreign_key :family_memberships, :families, validate: false
|
||||
add_foreign_key :family_memberships, :users, validate: false
|
||||
add_foreign_key :family_memberships, :families
|
||||
add_foreign_key :family_memberships, :users
|
||||
add_index :family_memberships, :user_id, unique: true # One family per user
|
||||
add_index :family_memberships, %i[family_id role], name: 'index_family_memberships_on_family_and_role'
|
||||
end
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ class CreateFamilyInvitations < ActiveRecord::Migration[8.0]
|
|||
t.timestamps
|
||||
end
|
||||
|
||||
add_foreign_key :family_invitations, :families, validate: false
|
||||
add_foreign_key :family_invitations, :users, column: :invited_by_id, validate: false
|
||||
add_foreign_key :family_invitations, :families
|
||||
add_foreign_key :family_invitations, :users, column: :invited_by_id
|
||||
add_index :family_invitations, :token, unique: true
|
||||
add_index :family_invitations, %i[family_id email], name: 'index_family_invitations_on_family_id_and_email'
|
||||
add_index :family_invitations, %i[family_id status expires_at],
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
class ValidateFamilyForeignKeys < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
validate_foreign_key :families, :users
|
||||
validate_foreign_key :family_memberships, :families
|
||||
validate_foreign_key :family_memberships, :users
|
||||
validate_foreign_key :family_invitations, :families
|
||||
validate_foreign_key :family_invitations, :users
|
||||
# No longer needed - foreign keys are now validated immediately in their creation migrations
|
||||
# validate_foreign_key :families, :users
|
||||
# validate_foreign_key :family_memberships, :families
|
||||
# validate_foreign_key :family_memberships, :users
|
||||
# validate_foreign_key :family_invitations, :families
|
||||
# validate_foreign_key :family_invitations, :users
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ services:
|
|||
APPLICATION_HOSTS: ${APPLICATION_HOSTS:-localhost,::1,127.0.0.1}
|
||||
TIME_ZONE: ${TIME_ZONE:-Europe/London}
|
||||
APPLICATION_PROTOCOL: ${APPLICATION_PROTOCOL:-http}
|
||||
PROMETHEUS_EXPORTER_ENABLED: ${PROMETHEUS_EXPORTER_ENABLED:"-false"}
|
||||
PROMETHEUS_EXPORTER_ENABLED: ${PROMETHEUS_EXPORTER_ENABLED:-"false"}
|
||||
PROMETHEUS_EXPORTER_HOST: ${PROMETHEUS_EXPORTER_HOST:-0.0.0.0}
|
||||
PROMETHEUS_EXPORTER_PORT: ${PROMETHEUS_EXPORTER_PORT:-9394}
|
||||
SECRET_KEY_BASE: ${SECRET_KEY_BASE:-}
|
||||
|
|
@ -127,7 +127,7 @@ services:
|
|||
APPLICATION_HOSTS: ${APPLICATION_HOSTS:-localhost,::1,127.0.0.1}
|
||||
BACKGROUND_PROCESSING_CONCURRENCY: ${BACKGROUND_PROCESSING_CONCURRENCY:-10}
|
||||
APPLICATION_PROTOCOL: ${APPLICATION_PROTOCOL:-http}
|
||||
PROMETHEUS_EXPORTER_ENABLED: ${PROMETHEUS_EXPORTER_ENABLED:"-false"}
|
||||
PROMETHEUS_EXPORTER_ENABLED: ${PROMETHEUS_EXPORTER_ENABLED:-"false"}
|
||||
PROMETHEUS_EXPORTER_HOST: ${PROMETHEUS_EXPORTER_HOST_SIDEKIQ:-dawarich_app}
|
||||
PROMETHEUS_EXPORTER_PORT: ${PROMETHEUS_EXPORTER_PORT:-9394}
|
||||
SECRET_KEY_BASE: ${SECRET_KEY_BASE:-}
|
||||
|
|
|
|||
Loading…
Reference in a new issue