-
Notifications
You must be signed in to change notification settings - Fork 2
feat(trainsformer): edit trainsformer export #1341
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
467cc94 to
bbd573e
Compare
c0b4781 to
82cd807
Compare
…tyle trainsformer schedule display
8ed3324 to
5a02235
Compare
| belongs_to :service, Arrow.Trainsformer.Service, on_replace: :delete | ||
|
|
||
| has_many :service_date_days_of_week, ServiceDateDayOfWeek, | ||
| on_delete: :delete_all, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: I'm wondering if we should specify on_delete?
the docs say
Using this option is DISCOURAGED for most relational databases. Instead, in your migration, set references(:parent_id, on_delete: :delete_all).
— https://hexdocs.pm/ecto/3.13.5/Ecto.Schema.html#has_many/3
And you already have on_delete specified in the migration.
| def change do | ||
| create table(:service_date_days_of_week) do | ||
| add :day_name, :integer, null: false | ||
| add :service_date_id, references(:trainsformer_service_dates, on_delete: :delete_all) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thought: I usually rely on Excellent Migrations for help here, but I'm wondering if we should specify the on_update behavior in this?
| add :service_date_id, references(:trainsformer_service_dates, on_delete: :delete_all) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: consider enabling constraint validation? https://hexdocs.pm/excellent_migrations/readme.html#adding-a-reference-or-foreign-key
(we should probably just add excellent_migrations lol)
Summary of changes
Asana Ticket: 🏹🚆 Edit Trainsformer service schedules section

Adds the ability to edit the dates / days of week for which a Trainsformer export should be active! I also made a bunch of styling changes, some in concert with Benji.
Reviewer Checklist