%----------------------------------------------------------------------

\textbf{members}
\\
\begin{tabular}{rl}
\toprule
durc\_id 		&	CHAR(6) NOT NULL PRIMARY KEY\\
surname 		&	TEXT NOT NULL\\
name 			&	TEXT NOT NULL\\
email			&	TEXT DEFAULT NULL\\
gender 			&	CHAR(1)\\ 
date\_of\_birth 	&	DATE\\
course 			&	TEXT\\
year 			&	TEXT\\
eye\_dominance 		&	CHAR(1)\\
handedness 		&	CHAR(1)\\
pref\_air\_rifle 	&	TEXT\\
pref\_free\_rifle 	&	TEXT\\
pref\_sporter\_rifle 	&	TEXT\\
pref\_jacket 		&	TEXT\\
pref\_sling 		&	TEXT\\
sling\_stop 		&	TEXT\\
handstop		&	TEXT\\
cheekpiece 		&	TEXT\\
buttplate\_setting 	&	TEXT\\
safety\_briefing\_attended 	&	BOOL DEFAULT FALSE\\
safety\_briefing\_date 		&	DATE DEFAULT NULL\\
safety\_briefing\_instructor 	&	CHAR(6) DEFAULT NULL\\
range\_officer 			&	BOOL DEFAULT FALSE\\
trainee\_range\_officer 	&	BOOL DEFAULT FALSE\\
notes 			&	TEXT\\
notes\_file 		&	TEXT
\\
\bottomrule
\end{tabular}

%-----------------------------------------------------------------------
\textbf{membership\_fees}
\\
\begin{tabular}{rl}
\toprule
durc\_id & CHAR(6) NOT NULL PRIMARY KEY\\
paid\_to & CHAR(6) NOT NULL\\
paid\_on & DATE NOT NULL
\\
\bottomrule
\end{tabular}

%-----------------------------------------------------------------------
\textbf{credit}
\\
\begin{tabular}{rl}
\toprule
given\_to & CHAR(6) NOT NULL PRIMARY KEY\\
given\_by & CHAR(6)\\
given\_on & DATE NOT NULL\\
amount & NUMERIC(9\\2)\\
notes & TEXT
\\
\bottomrule
\end{tabular}

%-----------------------------------------------------------------------
\textbf{cash}
\\
\begin{tabular}{rl}
\toprule
recieved\_from & CHAR(6) NOT NULL PRIMARY KEY\\
recieved\_by & CHAR(6)\\
received\_on & DATE NOT NULL\\
amount & NUMERIC(9\\2)\\
regular\_detail\_income & BOOL DEFAULT TRUE\\
membership\_fee & BOOL DEFAULT TRUE\\
detail\_no & INT2\\
notes & TEXT
\\
\bottomrule
\end{tabular}

%-----------------------------------------------------------------------
\textbf{members\_progress}
\\
\begin{tabular}{rl}
\toprule
durc\_id & CHAR(6) NOT NULL PRIMARY KEY\\
notes & TEXT\\
notes\_file & TEXT
\\
\bottomrule
\end{tabular}

%-----------------------------------------------------------------------
\textbf{members\_progress\_free} \textit{INHERITS \textbf{members\_progress}}
\\
\begin{tabular}{rl}
\toprule
class & CHAR(1) DEFAULT 'D'\\
junior & BOOL DEFAULT NULL\\
novice & BOOL DEFAULT TRUE\\
colours\_novice & BOOL DEFAULT TRUE\\
average & FLOAT8 DEFAULT 0\\
mcrae\_average & FLOAT8 DEFAULT 0\\
details\_attended & INT8 DEFAULT 0\\
competitions\_attended & INT8 DEFAULT 0\\
shoots\_ladder\_cards & BOOL DEFAULT FALSE\\
ladder\_cards\_shot & INT8 DEFAULT 0
\\
\bottomrule
\end{tabular}

%-----------------------------------------------------------------------
\textbf{members\_progress\_air} \textit{INHERITS \textbf{members\_progress}}
\\
\begin{tabular}{rl}
\toprule
class & CHAR(1) DEFAULT 'D'\\
junior & BOOL DEFAULT NULL\\
novice & BOOL DEFAULT TRUE\\
colours\_novice & BOOL DEFAULT TRUE\\
average & FLOAT8 DEFAULT 0\\
mcrae\_average & FLOAT8 DEFAULT 0\\
details\_attended & INT8 DEFAULT 0\\
competitions\_attended & INT8 DEFAULT 0\\
shoots\_ladder\_cards & BOOL DEFAULT FALSE\\
ladder\_cards\_shot & INT8 DEFAULT 0
\\
\bottomrule
\end{tabular}


%-----------------------------------------------------------------------
%-- Type is one of 'Term'\\'Home'\\'Mobile'\\'Work'\\'other'
\textbf{members\_phone}
\\
\begin{tabular}{rl}
\toprule
durc\_id & CHAR(6) NOT NULL PRIMARY KEY\\
phone\_type & TEXT\\
phone\_number & TEXT NOT NULL
\\
\bottomrule
\end{tabular}

%-----------------------------------------------------------------------
%-- Type is one of 'Home'\\'Term'\\'Work'\\'other'
\textbf{members\_address}
\\
\begin{tabular}{rl}
\toprule
durc\_id & CHAR(6) NOT NULL PRIMARY KEY\\
address\_type & TEXT\\
address & TEXT
\\
\bottomrule
\end{tabular}

%-----------------------------------------------------------------------
\textbf{members\_photo}
\\
\begin{tabular}{rl}
\toprule
durc\_id & CHAR(6) NOT NULL PRIMARY KEY\\
photo\_filename & TEXT
\\
\bottomrule
\end{tabular}

%-----------------------------------------------------------------------
\textbf{scores}
\\
\begin{tabular}{rl}
\toprule
durc\_id & CHAR(6) NOT NULL PRIMARY KEY\\
score\_date & DATE\\
witness\_RO & CHAR(6)  NOT NULL\\
score & INT2  NOT NULL\\
type & TEXT\\
ladder & BOOL DEFAULT TRUE\\
competition & BOOL DEFAULT FALSE\\
notes & TEXT
\\
\bottomrule
\end{tabular}

%-----------------------------------------------------------------------
\textbf{no\_shows}
\\
\begin{tabular}{rl}
\toprule
durc\_id & CHAR(6) NOT NULL PRIMARY KEY\\
noshow\_date & DATE NOT NULL\\
detail\_no & INT2   NOT NULL\\
witness\_RO & CHAR(6)   NOT NULL\\
apology\_given & BOOL DEFAULT FALSE\\
apology\_date & DATE\\
apology\_RO & CHAR(6)
\\
\bottomrule
\end{tabular}	

%-----------------------------------------------------------------------
%-- id\_type is one of 'Student'\\'DUCAC'\\'Honorary'\\'Other'
%-----------------------------------------------------------------------
\textbf{members\_IDs}
\\
\begin{tabular}{rl}
\toprule
durc\_id & CHAR(6) NOT NULL PRIMARY KEY\\
id\_type & TEXT NOT NULL\\
id\_number & TEXT NOT NULL\\
witness\_RO & CHAR(6) NOT NULL\\
witness\_date & DATE NOT NULL
\\
\bottomrule
\end{tabular}

%-----------------------------------------------------------------------
\textbf{ammo\_usage}
\\
\begin{tabular}{rl}
\toprule
issued\_by & CHAR(6) NOT NULL PRIMARY KEY\\
issued\_to & CHAR(6)   NOT NULL\\
amount\_issued & INT2   NOT NULL\\
amount\_used & INT2\\
date & DATE NOT NULL\\
type & TEXT NOT NULL\\
detail\_no & INT2
\\
\bottomrule
\end{tabular}

%-----------------------------------------------------------------------
%-- discipline is one of "Air"\\"Free"\\"Sporter"\\"Event"\\
%--                      "Competition"\\"No Shooting"
\textbf{duty\_roster}
\\
\begin{tabular}{rl}
\toprule
roster\_date & DATE NOT NULL PRIMARY KEY\\
discipline & TEXT\\
primary\_RO & CHAR(6)   NOT NULL\\
secondary\_RO & CHAR(6)   NOT NULL\\
TRO & CHAR(6)\\
alternate\_RO & CHAR(6)   
\\
\bottomrule
\end{tabular}
	
%-----------------------------------------------------------------------
\textbf{detail}
\\
\begin{tabular}{rl}
\toprule
detail\_date & DATE NOT NULL PRIMARY KEY\\
detail\_no & INT2 NOT NULL\\
firing\_point & INT2 NOT NULL\\
durc\_id & CHAR(6) NOT NULL\\
booked\_at & DATETIME\\
confirmed & BOOL NOT NULL DEFAULT FALSE
\\
\bottomrule
\end{tabular}

%-----------------------------------------------------------------------
\textbf{event}
\\
\begin{tabular}{rl}
\toprule
event\_date & DATE NOT NULL PRIMARY KEY\\
event & TEXT
\\
\bottomrule
\end{tabular}	
	
%-----------------------------------------------------------------------
\textbf{internal\_competition}
\\
\begin{tabular}{rl}
\toprule
competition\_date & DATE NOT NULL PRIMARY KEY\\
competition\_name & TEXT NOT NULL\\
competition\_discipline & TEXT\\
firing\_points\_per\_detail & INT2\\
detail\_length & TIME\\
start\_time & TIME
\\
\bottomrule
\end{tabular}
