1 //  Copyright © 2021 650 Industries. All rights reserved.
2 
3 import Foundation
4 import sqlite3
5 
6 internal final class UpdatesDatabaseMigration7To8: UpdatesDatabaseMigration {
7   private(set) var filename: String = "expo-v7.db"
8 
9   func runMigration(onDatabase db: OpaquePointer) throws {
10     // https://www.sqlite.org/lang_altertable.html#otheralter
11     let sql = """
12       ALTER TABLE "assets" ADD COLUMN "extra_request_headers" TEXT
13     """
14 
15     guard sqlite3_exec(db, String(sql.utf8), nil, nil, nil) == SQLITE_OK else {
16       throw UpdatesDatabaseMigrationError.migrationSQLError
17     }
18   }
19 }
20