Add versioning to auth methods and accounts (#249)
This commit is contained in:
1 parent
a7c467bd68
commit
565059ed63
23 files changed
+640
-444
No files matched your search
@@ -66,6 +66,7 @@ begin;
|
||||
update_time wt_timestamp,
|
||||
min_user_name_length int not null default 3,
|
||||
min_password_length int not null default 8,
|
||||
version wt_version not null default 1,
|
||||
foreign key (scope_id, public_id)
|
||||
references auth_method (scope_id, public_id)
|
||||
on delete cascade
|
||||
@@ -74,6 +75,11 @@ begin;
|
||||
unique(scope_id, public_id)
|
||||
);
|
||||
|
||||
create trigger
|
||||
update_version_column
|
||||
after update on auth_password_method
|
||||
for each row execute procedure update_version_column();
|
||||
|
||||
create trigger
|
||||
insert_auth_method_subtype
|
||||
before insert on auth_password_method
|
||||
@@ -96,6 +102,7 @@ begin;
|
||||
and
|
||||
length(user_name) > 0
|
||||
),
|
||||
version wt_version not null default 1,
|
||||
foreign key (scope_id, auth_method_id)
|
||||
references auth_password_method (scope_id, public_id)
|
||||
on delete cascade
|
||||
@@ -109,6 +116,11 @@ begin;
|
||||
unique(auth_method_id, public_id)
|
||||
);
|
||||
|
||||
create trigger
|
||||
update_version_column
|
||||
after update on auth_password_account
|
||||
for each row execute procedure update_version_column();
|
||||
|
||||
create trigger
|
||||
insert_auth_account_subtype
|
||||
before insert on auth_password_account
|
||||
|
||||
Reference in new issue
Block a user