// Copyright © 2022 Rangeproof Pty Ltd. All rights reserved. import Foundation import GRDB import SessionUtilitiesKit enum _001_InitialSetupMigration: Migration { static let identifier: String = "initialSetup" static func migrate(_ db: Database) throws { try db.create(table: Contact.self) { t in t.column(.id, .text) .notNull() .primaryKey() t.column(.isTrusted, .boolean) .notNull() .defaults(to: false) t.column(.isApproved, .boolean) .notNull() .defaults(to: false) t.column(.isBlocked, .boolean) .notNull() .defaults(to: false) t.column(.didApproveMe, .boolean) .notNull() .defaults(to: false) t.column(.hasBeenBlocked, .boolean) .notNull() .defaults(to: false) } try db.create(table: Profile.self) { t in t.column(.id, .text) .notNull() .primaryKey() t.column(.name, .text).notNull() t.column(.nickname, .text) t.column(.profilePictureUrl, .text) t.column(.profilePictureFileName, .text) t.column(.profileEncryptionKey, .blob) } } }