
-- DROP TABLE tl_work_flow_stage;



CREATE TABLE tl_work_flow_stage (
    object_id int NOT NULL ,
    object_last_updated_date datetime DEFAULT getdate() NOT NULL ,
    object_created_date datetime DEFAULT getdate() NOT NULL
    ,
    name text NOT NULL,
    use_messaging char(1) NULL,
    stage_type varchar(200) NOT NULL,
    sort_order numeric(12) NOT NULL,
    withdrawal_message_id numeric(12)  NULL,
    work_flow_template_id numeric(12)  NOT NULL
    );



ALTER TABLE tl_work_flow_stage ADD    
    CONSTRAINT PK_tl_work_flow_stage PRIMARY KEY 
    (
        object_id
    ) ;
    
    
    
    CREATE INDEX idx_tl_work_flow_stage_work_flow_template_id 
    ON tl_work_flow_stage (work_flow_template_id);
