added camp tables
This commit is contained in:
22
src/main/resources/v5.sql
Normal file
22
src/main/resources/v5.sql
Normal 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;
|
Reference in New Issue
Block a user