alter table files add [state] nvarchar(256) default 'approved';
update files set [state] = 'approved' where [state] = '' or [state] IS NULL;

create index files_pending_idx on files([state]) where [state] IN ('sent_for_checking', 'on_checking');
