CREATE TABLE `conversation_properties` (
	`conversation_id` text PRIMARY KEY NOT NULL,
	`notification_type` text DEFAULT 'ALL',
	`muted_until` integer,
	`pinned_at` integer,
	`marked_unread_at` integer,
	`version` integer DEFAULT -1
);
--> statement-breakpoint

INSERT INTO `conversation_properties` (`conversation_id`, `notification_type`, `muted_until`, `pinned_at`, `marked_unread_at`, `version`)
SELECT 
	`id`, 
	COALESCE(`notification_type`, 'ALL'), 
	`muted_until`, 
	`pinned_at`,
	NULL, 
	-1
FROM `conversations`;

ALTER TABLE `conversations` DROP COLUMN `notification_type`;--> statement-breakpoint
ALTER TABLE `conversations` DROP COLUMN `muted_until`;--> statement-breakpoint
ALTER TABLE `conversations` DROP COLUMN `pinned_at`;