centenial
05-14-2009, 08:14 PM
Hi,
I have a table
CREATE TABLE processes
(
process_id int primary key,
process_name tinytext,
process_type varchar(10),
gallery_id int
);
The `process_type`field has two possible values:
Task1
Task2
Only one instance of "Task2" can run on a gallery at a time. Task1 cannot run on a gallery that is currently being used by Task2. Multiple instances of Task1 can run on the same gallery. I want to create an index that will handle this logic for me, so that if I try to insert into the table, it will return false should there be a conflict.
Is it possible to do this with unique indexes?
I have a table
CREATE TABLE processes
(
process_id int primary key,
process_name tinytext,
process_type varchar(10),
gallery_id int
);
The `process_type`field has two possible values:
Task1
Task2
Only one instance of "Task2" can run on a gallery at a time. Task1 cannot run on a gallery that is currently being used by Task2. Multiple instances of Task1 can run on the same gallery. I want to create an index that will handle this logic for me, so that if I try to insert into the table, it will return false should there be a conflict.
Is it possible to do this with unique indexes?