How to add column to Sqlite.swift

109 Views Asked by At
let tango_id = Expression<Int64>("tango_id")
    let e_score = Expression<Double>("e_score")
    let interval = Expression<Double>("interval")
    let next_revision_date = Expression<Date>("next_revision_date")
    let bookmark = Expression<Bool>("bookmark")
    let bookmark_date = Expression<Date>("bookmark_date")
    let learnt = Expression<Bool>("learnt")
    
    do {
      try userdb.run(userTable.create { t in
        t.column(tango_id, primaryKey: true)
        t.column(e_score)
        t.column(interval)
        t.column(next_revision_date)
        t.column(bookmark)
        t.column(learnt)
      })
      
      
    }
      
    catch let error {
      print("creation failed: \(error)")
    }

I want to add a column for bookmark_date which is defined as Expression

0

There are 0 best solutions below