fix: migra does not support default expression dependencies
Some checks failed
migrate-stage / migrate-stage (push) Failing after 6s
migrate-devel / migrate-devel (push) Failing after 8s

https://github.com/djrobstep/migra/issues/196
This commit is contained in:
Orion Kindel 2023-07-02 19:33:23 -05:00
parent 87f7a4d1d0
commit b3de72daf2
Signed by untrusted user who does not match committer: orion
GPG Key ID: 6D4165AE4C928719
2 changed files with 4 additions and 6 deletions

View File

@ -20,7 +20,7 @@ create type usr_session_device as enum
create table public.usr_session create table public.usr_session
( id int not null primary key generated always as identity ( id int not null primary key generated always as identity
, key public.usr_session_key not null unique default usr_session_key_gen() , key public.usr_session_key not null unique
, expired boolean not null default false , expired boolean not null default false
, expires_at timestamp not null , expires_at timestamp not null
, usr int not null references public.usr (id) , usr int not null references public.usr (id)
@ -95,7 +95,7 @@ create function public.usr_session_login
as $$ as $$
declare declare
usr public.usr; usr public.usr;
key public.usr_session_key; key public.usr_session_key := usr_session_key_gen();
expires_at timestamp; expires_at timestamp;
begin begin
usr := public.usr_session_login_validate(tag_or_email, password); usr := public.usr_session_login_validate(tag_or_email, password);
@ -107,11 +107,9 @@ begin
end if; end if;
insert into public.usr_session insert into public.usr_session
(expires_at, usr, location, device, ip) (key, expires_at, usr, location, device, ip)
values values
(expires_at, usr.id, location, device, ip) (key, expires_at, usr.id, location, device, ip);
returning usr_session.key
into key;
return key; return key;
end; end;