London Escorts sunderland escorts 1v1.lol unblocked yohoho 76 https://www.symbaloo.com/mix/yohoho?lang=EN yohoho https://www.symbaloo.com/mix/agariounblockedpvp https://yohoho-io.app/ https://www.symbaloo.com/mix/agariounblockedschool1?lang=EN
11.4 C
New York
Saturday, October 19, 2024

ios – Alter the reference to overseas key of an present desk with GRDB


In desk Case_Supplies_Media I’ve column SupplyID_XRef. It at present has a overseas key reference to Media_List. I would like to vary the reference to Supplies_DVD_List. I discovered some bits and items, however I am unsure methods to put the entire thing collectively in code. I am utilizing GRDB.
Thanks prematurely for the assistance.

 func update_Foreign_Key()
    {
        let the_Version = ModelData.get_Current_Version()
        
        if the_Version == 6
        {
            do {
                strive Database_GRDB.shared.databaseConnection!.write { db in
                    
                    strive db.execute(sql: "UPDATE Case_Supplies_Media SET SupplyID_XRef = :worth", arguments: ["value": "Supplies_DVD_List"])
                    
                    // FOREIGN KEY("SupplyID_XRef") REFERENCES "Media_List"
                    // change to this
                    // FOREIGN KEY("SupplyID_XRef") REFERENCES "Supplies_DVD_List"
                    
                    // Set the model to 7
                    strive db.execute(sql: "UPDATE My_Settings SET Model = :model WHERE SettingsID = :id", arguments: ["version": 7, "id": 1])
                }
            } catch {
                print("Updating the Foreign_Key values failed! (AppDelegate) (error)")
            }
        }
    }

Related Articles

Social Media Auto Publish Powered By : XYZScripts.com