From 4e029b40ac72b47e98232548863400c77d4fa1f8 Mon Sep 17 00:00:00 2001
From: Justin Mazzocchi <2831158+jzzocc@users.noreply.github.com>
Date: Fri, 4 Sep 2020 22:52:16 -0700
Subject: [PATCH] Set version number and make it migration name
---
DB/Sources/DB/Content/ContentDatabase.swift | 14 +++++++-------
Metatext.xcodeproj/project.pbxproj | 2 ++
Supporting Files/Info.plist | 2 +-
3 files changed, 10 insertions(+), 8 deletions(-)
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