Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Examples/Reminders/Schema.swift
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,6 @@ func appDatabase() throws -> any DatabaseWriter {
try migrator.migrate(database)

try database.write { db in
if context == .preview {
try db.seedSampleData()
}

try RemindersList.createTemporaryTrigger(after: .insert { new in
RemindersList
.find(new.id)
Expand Down Expand Up @@ -266,6 +262,10 @@ func appDatabase() throws -> any DatabaseWriter {
updateReminderTextTags(for: old.reminderID)
})
.execute(db)

if context == .preview {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I switched this to only seeding in previews cause it turns out we seed in tests already. and probably best to leave tests responsible for seeding, especially if they want to seed differently from previews.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ha, it's actually why I asked but I should've mentioned my reasoning in Slack. Great!

try db.seedSampleData()
}
}

return database
Expand Down