32 lines
920 B
SQL
32 lines
920 B
SQL
-- TODO check for duplicate to avoid
|
|
-- error returned from database: (code: 2067) UNIQUE constraint failed: instances.domain
|
|
|
|
select
|
|
'alert' as component
|
|
, 'Error' as title
|
|
, 'domain must be minimum four characters' as description
|
|
, 'alert-circle' as icon
|
|
, 'red' as color
|
|
where length($domain) <4
|
|
or $domain is null
|
|
;
|
|
|
|
-- TODO perform better validation of the domain
|
|
insert into instances(domain, failure) select $domain, -1
|
|
where length($domain) >3
|
|
and $domain is not null
|
|
;
|
|
|
|
select
|
|
'empty_state' as component
|
|
, 'mood-check' as icon
|
|
, 'Thanks you' as title
|
|
, 'This domain ' || $domain || ' has been added to the list and will be be displayed after next refresh, usually once a day' as description
|
|
, 'Go back to the list' as link_text
|
|
, 'home' as link_icon
|
|
, '/' as link
|
|
where length($domain) >3
|
|
and $domain is not null
|
|
;
|
|
|