-- Add the conversation type to the composite key.
ALTER TABLE conversations RENAME TO conversations_old;
CREATE TABLE conversations(
	account_id TEXT NOT NULL,
	age_restricted INTEGER DEFAULT 0,
	alias TEXT,
	conversation_id TEXT NOT NULL,
	created_on TEXT,
	creator_id TEXT,
	description TEXT,
	drafting INTEGER DEFAULT 0,
	error_domain TEXT,
	error_code INTEGER,
	error_message TEXT,
	favorite INTEGER DEFAULT 0,
	federated INTEGER DEFAULT 0,
	logging INTEGER DEFAULT 0,
	needs_attention INTEGER DEFAULT 0,
	title TEXT,
	topic TEXT,
	topic_author_id TEXT,
	topic_updated TEXT,
	type INTEGER DEFAULT 0,
	url TEXT,
	user_nickname TEXT,
	status_message TEXT,
	can_send_message INTEGER DEFAULT 0,

	PRIMARY KEY(account_id, type, conversation_id)
) STRICT;
INSERT INTO conversations SELECT * FROM conversations_old;
DROP TABLE conversations_old;
