6 username varchar(20) not null,
11 create table archive_backup
13 archive_id int not null,
14 backup_id int not null,
16 primary key(archive_id, backup_id)
19 create table workflows(
25 archive_id int not null,
26 running boolean default true,
30 create table workflow_step
35 stop boolean default false,
39 alter table workflow_step
40 add constraint fk_workflow_next_step
41 foreign key(next_step)
42 references workflow_step(step_id);
45 add constraint fk_workflows_step_id
47 references workflow_step(step_id);
50 add constraint fk_workflows_archive_id
51 foreign key(archive_id)
52 references archive(id);
56 create table workflow_log
58 workflow_id int not null,
60 date timestamp not null,
62 primary key(workflow_id, step_id)
65 alter table workflow_log
66 add constraint fk_workflow_log_workflow_id
67 foreign key (workflow_id)
68 references workflows(id);
70 alter table workflow_log
71 add constraint fk_workflow_log_step_id
73 references workflow_step(step_id);