fix: migra does not support default expression dependencies
https://github.com/djrobstep/migra/issues/196
This commit is contained in:
parent
87f7a4d1d0
commit
b3de72daf2
@ -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;
|
Loading…
Reference in New Issue
Block a user