title: Vapor 3 Fluent MySQL: save on model adds 10 to auto_increment
body: <p>When I am saving my object to the database, it stores the id of the object with +10. The autoincrement for the table increments by default with 1. When I manually add something to the database, it'll increment with 1. </p>
  
  <p>Am I missing (or my misstake, setting) a setting for FluentMySQL?</p>
  
  <pre><code>  func storeOrUpdateItemRecord(_ item: FetcherItem, store: Store, on conn: DatabaseConnectable) throws -&gt; EventLoopFuture&lt;Item&gt; {
      guard let storeId = store.id else {
        throw Abort(.internalServerError)
      }
  
      let calendar = Calendar.current
      let fromDate = calendar.startOfDay(for: Date())
      guard let endDate = calendar.date(bySettingHour: 23, minute: 59, second: 59, of: Date()) else { throw Abort(.internalServerError) }
  
      return Item.query(on: conn)
        // Bunch of filters
        .filter(\.scheduledDate &lt; endDate)
        .all()
        .flatMap(to: Flight.self) { flights in
          if var firstItem = flights.first {
            debugPrint("Found item, updating...")
            // Update a bunch of values
            return firstItem.save(on: conn)
          }
  
          debugPrint("Did not find item, saving new...")
          return item.toItem(forStore: store).save(on: conn)
      }
    }
  </code></pre>
  
  <p>The <code>toItem</code> func does nothing more then initiate a new <code>Item</code>:</p>
  
  <pre><code>extension FetcherItem {
  
    func toItem(forStore store: Store) -&gt; Item {
      return Item.init(
        id: nil,
        // Set a bunch of values
        actualDate: actualDateTime)
    }
  }
  </code></pre>
  
  <p>As you can see, the <code>id</code> is set to <code>nil</code>... which I would guess should store using <code>null</code> while making the insert query. </p>
  
  <p>The result in the database:</p>
  
  <p><a href="https://i.stack.imgur.com/f89Dn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/f89Dn.png" alt="MySQL db result"></a></p>
  
  <p>What am I missing?</p>
  
  <p><em>Update</em>:
  After following suggestions from <a href="https://stackoverflow.com/questions/53023892/how-do-i-log-sql-statements-in-vapor-3-fluent">this page</a> I've added logging for the queries... and they seem to work as they should.
  Example of what fluent runs for query:</p>
  
  <pre><code>[mysql] [2019-03-06 08:49:44 +0000] INSERT INTO `Items` (`company`, `name`, `storeId`, [...] `scheduledDate`) VALUES (?, ?, ?, ?, ?, ?, ?, ?) [string("A company"), string("abc123"), integer8(1), [...] time(2019-3-6 16:25:0.0)]
  </code></pre>
  
  <p>As you can see, it doesn't set the <code>id</code> in any way. Maybe a MySQL problem?</p>