/[BackupPC]/trunk/sql/workflow_schema.sql
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /trunk/sql/workflow_schema.sql

Parent Directory Parent Directory | Revision Log Revision Log


Revision 121 - (show annotations)
Thu Sep 15 13:54:29 2005 UTC (18 years, 8 months ago) by iklaric
File size: 1579 byte(s)
 r124@klaxLaptop:  klax | 2005-09-15 15:46:19 +0200
 - first step of workflow is done.

1 alter table backups
2 add column id int;
3 create sequence backupsseq;
4 update backups set id=nextVal('backupsseq');
5
6 create table archive
7 (
8 id int not null,
9 dvd_nr int not null,
10 note text,
11 username varchar(20) not null,
12 date timestamp,
13 primary key(id)
14 );
15
16 create sequence archive_id_seq;
17 create sequence dvd_nr;
18
19 create table archive_backup
20 (
21 archive_id int not null,
22 backup_id int not null,
23 status text,
24 primary key(archive_id, backup_id)
25 );
26
27 create table workflows(
28 id int not null,
29 step_id int not null,
30 start timestamp,
31 stop timestamp,
32 username varchar(20),
33 archive_id int not null,
34 running boolean default true,
35 primary key(id)
36 );
37
38 create table workflow_step
39 (
40 step_id int not null,
41 code text,
42 next_step int,
43 stop boolean default false,
44 primary key(step_id)
45 );
46
47 alter table workflow_step
48 add constraint fk_workflow_next_step
49 foreign key(next_step)
50 references workflow_step(step_id);
51
52 alter table workflows
53 add constraint fk_workflows_step_id
54 foreign key(step_id)
55 references workflow_step(step_id);
56
57 alter table workflows
58 add constraint fk_workflows_archive_id
59 foreign key(archive_id)
60 references archive(id);
61
62
63
64 create table workflow_log
65 (
66 workflow_id int not null,
67 step_id int not null,
68 date timestamp not null,
69 status text,
70 primary key(workflow_id, step_id)
71 );
72
73 alter table workflow_log
74 add constraint fk_workflow_log_workflow_id
75 foreign key (workflow_id)
76 references workflows(id);
77
78 alter table workflow_log
79 add constraint fk_workflow_log_step_id
80 foreign key (step_id)
81 references workflow_step(step_id);

  ViewVC Help
Powered by ViewVC 1.1.26