mirror of
https://github.com/metabolist/metatext.git
synced 2024-11-06 00:39:31 +00:00
Cleanup
This commit is contained in:
parent
e7c6ac3f98
commit
9bf23496ef
2 changed files with 11 additions and 12 deletions
|
@ -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)
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue