CREATE TABLE IF NOT EXISTS kickstarter_discord_users (
	pk INTEGER PRIMARY KEY AUTOINCREMENT,
	guild_id INTEGER NOT NULL,  -- Discord Guild.id
	discord_username TEXT NOT NULL,  -- Discord Member.name
	discord_member_id INTEGER DEFAULT NULL,  -- resolved member id
	lookup_status INTEGER NOT NULL DEFAULT 0,  -- enum defined in code
	imported_at INTEGER NOT NULL,  -- unix timestamp
	UNIQUE(guild_id, discord_username COLLATE NOCASE) ON CONFLICT FAIL
);
CREATE INDEX IF NOT EXISTS idx_kickstarter_discord_users_discord_member_id
	ON kickstarter_discord_users (discord_member_id);
