Set version number and make it migration name
This commit is contained in:
parent
70720b3c26
commit
4e029b40ac
|
@ -192,8 +192,8 @@ private extension ContentDatabase {
|
||||||
static func migrate(_ writer: DatabaseWriter) throws {
|
static func migrate(_ writer: DatabaseWriter) throws {
|
||||||
var migrator = DatabaseMigrator()
|
var migrator = DatabaseMigrator()
|
||||||
|
|
||||||
migrator.registerMigration("createStatuses") { db in
|
migrator.registerMigration("0.1.0") { db in
|
||||||
try db.create(table: "accountRecord", ifNotExists: true) { t in
|
try db.create(table: "accountRecord") { t in
|
||||||
t.column("id", .text).notNull().primaryKey(onConflict: .replace)
|
t.column("id", .text).notNull().primaryKey(onConflict: .replace)
|
||||||
t.column("username", .text).notNull()
|
t.column("username", .text).notNull()
|
||||||
t.column("acct", .text).notNull()
|
t.column("acct", .text).notNull()
|
||||||
|
@ -216,7 +216,7 @@ private extension ContentDatabase {
|
||||||
t.column("movedId", .text).indexed().references("accountRecord", column: "id")
|
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("id", .text).notNull().primaryKey(onConflict: .replace)
|
||||||
t.column("uri", .text).notNull()
|
t.column("uri", .text).notNull()
|
||||||
t.column("createdAt", .datetime).notNull()
|
t.column("createdAt", .datetime).notNull()
|
||||||
|
@ -248,12 +248,12 @@ private extension ContentDatabase {
|
||||||
t.column("pinned", .boolean)
|
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("id", .text).notNull().primaryKey(onConflict: .replace)
|
||||||
t.column("listTitle", .text)
|
t.column("listTitle", .text)
|
||||||
}
|
}
|
||||||
|
|
||||||
try db.create(table: "timelineStatusJoin", ifNotExists: true) { t in
|
try db.create(table: "timelineStatusJoin") { t in
|
||||||
t.column("timelineId", .text)
|
t.column("timelineId", .text)
|
||||||
.indexed()
|
.indexed()
|
||||||
.notNull()
|
.notNull()
|
||||||
|
@ -266,7 +266,7 @@ private extension ContentDatabase {
|
||||||
t.primaryKey(["timelineId", "statusId"], onConflict: .replace)
|
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)
|
t.column("parentId", .text)
|
||||||
.indexed()
|
.indexed()
|
||||||
.notNull()
|
.notNull()
|
||||||
|
@ -281,7 +281,7 @@ private extension ContentDatabase {
|
||||||
t.primaryKey(["parentId", "statusId"], onConflict: .replace)
|
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("id", .text).notNull().primaryKey(onConflict: .replace)
|
||||||
t.column("phrase", .text).notNull()
|
t.column("phrase", .text).notNull()
|
||||||
t.column("context", .blob).notNull()
|
t.column("context", .blob).notNull()
|
||||||
|
|
|
@ -666,6 +666,7 @@
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
|
MARKETING_VERSION = 0.1.0;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.metabolist.metatext;
|
PRODUCT_BUNDLE_IDENTIFIER = com.metabolist.metatext;
|
||||||
PRODUCT_NAME = Metatext;
|
PRODUCT_NAME = Metatext;
|
||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
|
@ -692,6 +693,7 @@
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
|
MARKETING_VERSION = 0.1.0;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = com.metabolist.metatext;
|
PRODUCT_BUNDLE_IDENTIFIER = com.metabolist.metatext;
|
||||||
PRODUCT_NAME = Metatext;
|
PRODUCT_NAME = Metatext;
|
||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
|
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>1.0</string>
|
<string>$(MARKETING_VERSION)</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>1</string>
|
<string>1</string>
|
||||||
<key>LSRequiresIPhoneOS</key>
|
<key>LSRequiresIPhoneOS</key>
|
||||||
|
|
Loading…
Reference in New Issue