diff --git a/DB/Sources/DB/Content/ContentDatabase+Migration.swift b/DB/Sources/DB/Content/ContentDatabase+Migration.swift index 7e8a805..36ad29b 100644 --- a/DB/Sources/DB/Content/ContentDatabase+Migration.swift +++ b/DB/Sources/DB/Content/ContentDatabase+Migration.swift @@ -67,15 +67,15 @@ extension ContentDatabase { t.column("listId", .text) t.column("listTitle", .text).indexed().collate(.localizedCaseInsensitiveCompare) t.column("tag", .text) - t.column("accountId", .text).references("accountRecord", onDelete: .cascade, onUpdate: .cascade) + t.column("accountId", .text).references("accountRecord", onDelete: .cascade) t.column("profileCollection", .text) } try db.create(table: "timelineStatusJoin") { t in t.column("timelineId", .text).indexed().notNull() - .references("timelineRecord", onDelete: .cascade, onUpdate: .cascade) + .references("timelineRecord", onDelete: .cascade) t.column("statusId", .text).indexed().notNull() - .references("statusRecord", onDelete: .cascade, onUpdate: .cascade) + .references("statusRecord", onDelete: .cascade) t.primaryKey(["timelineId", "statusId"], onConflict: .replace) } @@ -91,9 +91,9 @@ extension ContentDatabase { try db.create(table: "statusContextJoin") { t in t.column("parentId", .text).indexed().notNull() - .references("statusRecord", onDelete: .cascade, onUpdate: .cascade) + .references("statusRecord", onDelete: .cascade) t.column("statusId", .text).indexed().notNull() - .references("statusRecord", onDelete: .cascade, onUpdate: .cascade) + .references("statusRecord", onDelete: .cascade) t.column("section", .text).indexed().notNull() t.column("index", .integer).notNull() @@ -102,9 +102,9 @@ extension ContentDatabase { try db.create(table: "accountPinnedStatusJoin") { t in t.column("accountId", .text).indexed().notNull() - .references("accountRecord", onDelete: .cascade, onUpdate: .cascade) + .references("accountRecord", onDelete: .cascade) t.column("statusId", .text).indexed().notNull() - .references("statusRecord", onDelete: .cascade, onUpdate: .cascade) + .references("statusRecord", onDelete: .cascade) t.column("index", .integer).notNull() t.primaryKey(["accountId", "statusId"], onConflict: .replace) @@ -116,9 +116,9 @@ extension ContentDatabase { try db.create(table: "accountListJoin") { t in t.column("accountId", .text).indexed().notNull() - .references("accountRecord", onDelete: .cascade, onUpdate: .cascade) + .references("accountRecord", onDelete: .cascade) t.column("listId", .text).indexed().notNull() - .references("accountList", onDelete: .cascade, onUpdate: .cascade) + .references("accountList", onDelete: .cascade) t.column("index", .integer).notNull() t.primaryKey(["accountId", "listId"], onConflict: .replace) diff --git a/DB/Sources/DB/Identity/IdentityDatabase+Migration.swift b/DB/Sources/DB/Identity/IdentityDatabase+Migration.swift index 57088ad..7bfce91 100644 --- a/DB/Sources/DB/Identity/IdentityDatabase+Migration.swift +++ b/DB/Sources/DB/Identity/IdentityDatabase+Migration.swift @@ -20,8 +20,7 @@ extension IdentityDatabase { t.column("authenticated", .boolean).notNull() t.column("pending", .boolean).notNull() t.column("lastUsedAt", .datetime).notNull() - t.column("instanceURI", .text) - .references("instance", column: "uri") + t.column("instanceURI", .text).references("instance") t.column("preferences", .blob).notNull() t.column("pushSubscriptionAlerts", .blob).notNull() t.column("lastRegisteredDeviceToken", .blob) @@ -30,7 +29,7 @@ extension IdentityDatabase { try db.create(table: "account", ifNotExists: true) { t in t.column("id", .text).primaryKey(onConflict: .replace) t.column("identityID", .text).notNull() - .references("identityRecord", column: "id", onDelete: .cascade) + .references("identityRecord", onDelete: .cascade) t.column("username", .text).notNull() t.column("displayName", .text).notNull() t.column("url", .text).notNull()