File: v13-clin-test_org-dynamic.sql

package info (click to toggle)
gnumed-server 22.19-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 45,148 kB
  • sloc: sql: 1,217,279; python: 15,659; sh: 1,582; makefile: 20
file content (64 lines) | stat: -rw-r--r-- 1,843 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
-- ==============================================================
-- GNUmed database schema change script
--
-- License: GPL v2 or later
-- Author: karsten.hilbert@gmx.net
--
-- ==============================================================
-- $Id: v13-clin-test_org-dynamic.sql,v 1.1 2010-02-02 13:42:31 ncq Exp $
-- $Revision: 1.1 $

-- --------------------------------------------------------------
--set default_transaction_read_only to off;
\set ON_ERROR_STOP 1

-- --------------------------------------------------------------
-- .contact
comment on column clin.test_org.contact is
	'free-text contact information for this lab';

alter table clin.test_org
	alter column contact
		set default null;

\unset ON_ERROR_STOP
alter table clin.test_org drop constraint sane_contact cascade;
\set ON_ERROR_STOP 1

alter table clin.test_org
	add constraint sane_contact
		check(gm.is_null_or_non_empty_string(contact) is True);


-- .internal_name
alter table clin.test_org
	alter column internal_name
		set not null;

\unset ON_ERROR_STOP
alter table clin.test_org drop constraint sane_internal_name cascade;
\set ON_ERROR_STOP 1

alter table clin.test_org
	add constraint sane_internal_name
		check(gm.is_null_or_blank_string(internal_name) is False);


-- .comment
\unset ON_ERROR_STOP
alter table clin.test_org drop constraint sane_comment cascade;
\set ON_ERROR_STOP 1

alter table clin.test_org
	add constraint sane_comment
		check(gm.is_null_or_non_empty_string(comment) is True);

-- --------------------------------------------------------------
select gm.log_script_insertion('$RCSfile: v13-clin-test_org-dynamic.sql,v $', '$Revision: 1.1 $');

-- ==============================================================
-- $Log: v13-clin-test_org-dynamic.sql,v $
-- Revision 1.1  2010-02-02 13:42:31  ncq
-- - add .contact and constraints
--
--