get_charset_collate(); // dbDelta() requires two spaces after PRIMARY KEY and one field per line. dbDelta( "CREATE TABLE {$table} ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT, user_id bigint(20) unsigned NOT NULL, credential_hash char(64) NOT NULL, credential_id text NOT NULL, public_key text NOT NULL, sign_count bigint(20) unsigned NOT NULL DEFAULT 0, transports varchar(255) NOT NULL DEFAULT '', aaguid char(36) NOT NULL DEFAULT '', backup_eligible tinyint(1) NOT NULL DEFAULT 0, backed_up tinyint(1) NOT NULL DEFAULT 0, name varchar(100) NOT NULL DEFAULT '', created_at datetime NOT NULL, last_used_at datetime DEFAULT NULL, PRIMARY KEY (id), UNIQUE KEY credential_hash (credential_hash), KEY user_id (user_id) ) {$charset};" ); update_option( self::DB_VERSION_OPTION, self::DB_VERSION ); } }