diff --git a/DB/Sources/DB/Content/ContentDatabase.swift b/DB/Sources/DB/Content/ContentDatabase.swift index e41b7bb..a5c0c25 100644 --- a/DB/Sources/DB/Content/ContentDatabase.swift +++ b/DB/Sources/DB/Content/ContentDatabase.swift @@ -192,8 +192,8 @@ private extension ContentDatabase { static func migrate(_ writer: DatabaseWriter) throws { var migrator = DatabaseMigrator() - migrator.registerMigration("createStatuses") { db in - try db.create(table: "accountRecord", ifNotExists: true) { t in + migrator.registerMigration("0.1.0") { db in + try db.create(table: "accountRecord") { t in t.column("id", .text).notNull().primaryKey(onConflict: .replace) t.column("username", .text).notNull() t.column("acct", .text).notNull() @@ -216,7 +216,7 @@ private extension ContentDatabase { t.column("movedId", .text).indexed().references("accountRecord", column: "id") } - try db.create(table: "statusRecord", ifNotExists: true) { t in + try db.create(table: "statusRecord") { t in t.column("id", .text).notNull().primaryKey(onConflict: .replace) t.column("uri", .text).notNull() t.column("createdAt", .datetime).notNull() @@ -248,12 +248,12 @@ private extension ContentDatabase { t.column("pinned", .boolean) } - try db.create(table: "timeline", ifNotExists: true) { t in + try db.create(table: "timeline") { t in t.column("id", .text).notNull().primaryKey(onConflict: .replace) t.column("listTitle", .text) } - try db.create(table: "timelineStatusJoin", ifNotExists: true) { t in + try db.create(table: "timelineStatusJoin") { t in t.column("timelineId", .text) .indexed() .notNull() @@ -266,7 +266,7 @@ private extension ContentDatabase { t.primaryKey(["timelineId", "statusId"], onConflict: .replace) } - try db.create(table: "statusContextJoin", ifNotExists: true) { t in + try db.create(table: "statusContextJoin") { t in t.column("parentId", .text) .indexed() .notNull() @@ -281,7 +281,7 @@ private extension ContentDatabase { t.primaryKey(["parentId", "statusId"], onConflict: .replace) } - try db.create(table: "filter", ifNotExists: true) { t in + try db.create(table: "filter") { t in t.column("id", .text).notNull().primaryKey(onConflict: .replace) t.column("phrase", .text).notNull() t.column("context", .blob).notNull() diff --git a/Metatext.xcodeproj/project.pbxproj b/Metatext.xcodeproj/project.pbxproj index 7035d10..7f69cad 100644 --- a/Metatext.xcodeproj/project.pbxproj +++ b/Metatext.xcodeproj/project.pbxproj @@ -666,6 +666,7 @@ "$(inherited)", "@executable_path/Frameworks", ); + MARKETING_VERSION = 0.1.0; PRODUCT_BUNDLE_IDENTIFIER = com.metabolist.metatext; PRODUCT_NAME = Metatext; SDKROOT = iphoneos; @@ -692,6 +693,7 @@ "$(inherited)", "@executable_path/Frameworks", ); + MARKETING_VERSION = 0.1.0; PRODUCT_BUNDLE_IDENTIFIER = com.metabolist.metatext; PRODUCT_NAME = Metatext; SDKROOT = iphoneos; diff --git a/Supporting Files/Info.plist b/Supporting Files/Info.plist index efc211a..dfbdd44 100644 --- a/Supporting Files/Info.plist +++ b/Supporting Files/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType $(PRODUCT_BUNDLE_PACKAGE_TYPE) CFBundleShortVersionString - 1.0 + $(MARKETING_VERSION) CFBundleVersion 1 LSRequiresIPhoneOS