
-- @AutoRun
-- drop table tl_work_flow_stage;



CREATE TABLE tl_work_flow_stage (
    object_id numeric(12) NOT NULL ,
    object_last_updated_date timestamp DEFAULT NOW() NOT NULL ,
    object_created_date timestamp DEFAULT NOW() NOT NULL
    ,
    name text NOT NULL,
    use_messaging char(1) NULL,
    stage_type varchar(200) NOT NULL,
    sort_order numeric(12) NOT NULL,
    auto_progress char(1) 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);
