added camp tables

This commit is contained in:
Jottyfan
2024-12-01 16:47:22 +01:00
parent b46d3d05c0
commit cf9bf2a9cf
62 changed files with 4456 additions and 1686 deletions

22
src/main/resources/v5.sql Normal file
View File

@ -0,0 +1,22 @@
create schema camp;
create type camp.enum_camp as enum ('Gemeindefreizeit 2025');
create type camp.enum_sex as enum ('männlich', 'weiblich');
create table camp.t_registration(
created timestamp without time zone default current_timestamp,
pk_registration int not null primary key generated always as identity,
registrator text not null,
camp camp.enum_camp not null,
forename text not null,
surname text not null,
sex camp.enum_sex not null
);
create view camp.v_participant as
select sum(case when sex = 'männlich' then 1 else 0 end) as males,
sum(case when sex = 'weiblich' then 1 else 0 end) as females
from camp.t_registration;
create or replace view v_version as
select 5 as version;