The list error has been added to the existing database table in SQLite.swift?

an error is reported when using SQLite.swift to use try db.run on existing database tables (table.addColumn (title)) adds a title column.

the code is as follows:

/ / create a table

private func creatTable(filePath: String) {
    do {
        db = try Connection(filePath)
        
        try db.run(table.create(ifNotExists: true){ t in
            t.column(statusId, primaryKey: true)  //
            t.column(statusText)
            t.column(userId, unique: true)  //
            t.column(createTime)
        })
        
        try db.run(table.addColumn(title))

        print("")
    } catch {
        print(": \(error)")
    }
}

error log:
failed to build table: duplicate column name: title (code: 1)

by looking at the database under sandboxie, the title column has been added, and the data title column you just added is also valuable

.

it should be my wrong use of addColumn, and please give me some advice.

Mar.11,2021
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b360e4-2bfdc.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b360e4-2bfdc.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?