Skip to content

Commit

Permalink
don't allow items to be hard deleted if they're still in the linked l…
Browse files Browse the repository at this point in the history
…ist #11
  • Loading branch information
sobri909 committed May 16, 2018
1 parent 2c975cd commit 5e1db3c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions LocoKit/LocalStore/PersistentTimelineStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -275,11 +275,9 @@ open class PersistentTimelineStore: TimelineStore {
table.column("startDate", .datetime).indexed()
table.column("endDate", .datetime).indexed()

table.column("previousItemId", .text).indexed()
.references("TimelineItem", onDelete: .setNull, deferred: true)
table.column("previousItemId", .text).indexed().references("TimelineItem", deferred: true)
.check(sql: "previousItemId != itemId AND (previousItemId IS NULL OR deleted = 0)")
table.column("nextItemId", .text).indexed()
.references("TimelineItem", onDelete: .setNull, deferred: true)
table.column("nextItemId", .text).indexed().references("TimelineItem", deferred: true)
.check(sql: "nextItemId != itemId AND (nextItemId IS NULL OR deleted = 0)")

table.column("radiusMean", .double)
Expand Down

0 comments on commit 5e1db3c

Please sign in to comment.