 insert into schema_information(schema_version, upgrading_soon, upgrading_currently)
 values ('2008123000', false, false);
 
-
+create table if not exists test_index (
+	id int primary key auto_increment,
+	start_time timestamp not null default current_timestamp on update current_timestamp,
+	comment varchar(1000) default null
+) engine=InnoDB;
 
 -- a lookup table of possible transcode outcomes
 create table if not exists transcoder_failures (

        outcome boolean not null,
        successful boolean not null,
        invalid_output boolean default 0,

        comment varchar(1000),

        foreign key(failure_id) references transcoder_failures(failure_id),
        -- if a file has failed, but the end result is a success there
        -- should be a comment saying how we managed to finally


create or replace view transcoder_outcomes_per_customer as
select
	test_id,
        customer_id,
        sum(case when (outcome and not invalid_output) then 1 else 0 end) as successful_transcods,
        sum(case when (not outcome or invalid_output) then 1 else 0 end) as failed_transcods,
        sum(case when (not outcome or invalid_output) and (failure_id is null) then 1 else 0 end) as failed_unexpectedly_transcods
from
        transcoder_reports
group by test_id, customer_id;

create or replace view transcoder_outcomes_per_profile as
select
	test_id,
        customer_id,
        profile_id,
        sum(case when (outcome and not invalid_output) then 1 else 0 end) as successful_transcods,
