diff --git a/migrations/V132__add_tos.sql b/migrations/V132__add_tos.sql new file mode 100644 index 00000000..a9b59cb9 --- /dev/null +++ b/migrations/V132__add_tos.sql @@ -0,0 +1,16 @@ +create table terms_of_service +( + version smallint auto_increment, + valid_from timestamp not null comment 'The start date when this ToS version is applied. May point into the future to prepare ToS changes.', + content text not null comment 'Markdown formatted text', + constraint terms_of_service_pk + primary key (version) +); + +create index terms_of_service_valid_from_index + on terms_of_service (valid_from); + +alter table login + add accepted_tos smallint null comment 'Point to the last ToS the user has explicitely accepted', + add constraint login_terms_of_service_version_fk + foreign key (accepted_tos) references terms_of_service (version); \ No newline at end of file