/** * Ensure that the given table on the given connection has the given field * * @param SS_Database $conn connection * @param string $table Name of table * @param string $field Name of field * @param string $spec Spec to use if creating this field */ public function ensureTableHasColumn($conn, $table, $field, $spec) { $fields = $conn->fieldList($table); // Make column if not found if (!isset($fields[$field])) { $this->message(' * Creating ' . $field . ' on table ' . $table); $conn->createField($table, $field, $spec); } }