code: async function sync (args) {
      // set validation properties
      this.needsValidate = false
      this.validated = false
      this.updated = 0
      // get args object
      args = requireValidOptionalObject(args)
      // create elasticsearch index
      if (this.elasticsearch()) {
          await this.createElasticsearchIndex()
      }
      // get existing schema
      var schema = await this.schema(args)
      // if table exists then update table
      if (schema) {
          // add schema to args
          args.schema = schema
          // attempt to alter table to match schema
          await this.alterTable(args)
      }
      // otherwise attempt to create table
      else {
          await this.createTable(args)
      }
      // run validate after complete sync if needed
      if (this.needsValidate || defined(process.env.VALIDATE)) {
          await this.validate(args)
      }
  }
docs: @function sync
  
  checks that database matches model spec and attempts update if possible
  
  @param {object} args
  
  @returns {Promise}
  
  @throws {Error}