generated from alecodes/base-template
Compare commits
No commits in common. "6288969c4d29377fea6e095bf0f4d59146ff1559" and "2be95765e8c1b0818363569ca440cef7060bf639" have entirely different histories.
6288969c4d
...
2be95765e8
7 changed files with 28 additions and 72 deletions
|
|
@ -53,7 +53,7 @@ SET
|
|||
:date,
|
||||
:time,
|
||||
:og_desambiguator,
|
||||
:lg_id
|
||||
$extra_data :: jsonb ->> 'lg_uid'
|
||||
);
|
||||
|
||||
INSERT INTO
|
||||
|
|
@ -71,7 +71,5 @@ VALUES
|
|||
:text,
|
||||
:lg_id :: int,
|
||||
:date :: date + :time :: time
|
||||
)
|
||||
RETURNING
|
||||
'redirect' AS component,
|
||||
) RETURNING 'redirect' AS component,
|
||||
$return_link AS link;
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ SELECT
|
|||
|
||||
SELECT
|
||||
'form' AS component,
|
||||
'entries/search.sql' AS "action",
|
||||
'Entries' AS title,
|
||||
'' AS validate,
|
||||
'GET' AS method;
|
||||
|
|
@ -12,7 +13,6 @@ SELECT
|
|||
'query' AS name,
|
||||
'' AS label,
|
||||
'Search query...' AS placeholder,
|
||||
$query as value,
|
||||
10 AS width,
|
||||
TRUE AS autofocus;
|
||||
|
||||
|
|
@ -20,11 +20,10 @@ SELECT
|
|||
'search' AS name,
|
||||
'' AS label,
|
||||
'Search' AS value,
|
||||
'btn btn-info' AS class,
|
||||
2 AS width,
|
||||
'btn btn-info' AS class,
|
||||
'submit' AS "type";
|
||||
|
||||
|
||||
SELECT
|
||||
'new' AS name,
|
||||
'' AS label,
|
||||
|
|
@ -48,9 +47,7 @@ SELECT
|
|||
text AS description
|
||||
FROM
|
||||
public.entries
|
||||
WHERE
|
||||
($query IS NULL OR search_vector @@ to_tsquery('es_en', $query))
|
||||
ORDER BY
|
||||
created_at
|
||||
LIMIT
|
||||
30;
|
||||
10;
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ SELECT
|
|||
'Source' AS label,
|
||||
'select' AS TYPE,
|
||||
TRUE AS required,
|
||||
TRUE AS searchable,
|
||||
'Select...' AS empty_option,
|
||||
(
|
||||
SELECT
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
INSERT INTO
|
||||
public.sources(name, uid, uri, desambiguator_type_id)
|
||||
public.sources(name, uid, uri)
|
||||
VALUES
|
||||
(:name, :uid, :uri, :desambiguator_type_id :: int)
|
||||
RETURNING
|
||||
'redirect' AS component,
|
||||
'index.sql' AS link;
|
||||
(:name, :uid, :uri)
|
||||
RETURNING 'redirect' AS component, 'index.sql' AS link
|
||||
;
|
||||
|
||||
|
|
|
|||
|
|
@ -25,19 +25,6 @@ SELECT
|
|||
1 AS minlength,
|
||||
TRUE AS required;
|
||||
|
||||
SELECT
|
||||
'desambiguator_type_id' AS name,
|
||||
'Deseambiguator Type' AS label,
|
||||
'select' AS TYPE,
|
||||
TRUE AS required,
|
||||
'Select...' AS empty_option,
|
||||
(
|
||||
SELECT
|
||||
jsonb_agg(jsonb_build_object('label', name, 'value', id))
|
||||
FROM
|
||||
public.desambiguator_types
|
||||
) AS options;
|
||||
|
||||
SELECT
|
||||
'uri' AS name,
|
||||
'URI' AS label;
|
||||
|
|
@ -51,12 +38,6 @@ SELECT
|
|||
TRUE AS search;
|
||||
|
||||
SELECT
|
||||
src.id,
|
||||
src.name,
|
||||
src.uid,
|
||||
dts.name AS "Deseambiguator Type",
|
||||
src.uri,
|
||||
to_char(src.created_at, 'YYYY-MM-DD HH12:MI:SS TZ') AS "Created At"
|
||||
*
|
||||
FROM
|
||||
public.sources AS src
|
||||
INNER JOIN public.desambiguator_types AS dts ON src.desambiguator_type_id = dts.id;
|
||||
public.sources;
|
||||
|
|
|
|||
|
|
@ -1,27 +0,0 @@
|
|||
-- migrate:up
|
||||
CREATE TEXT SEARCH CONFIGURATION es_en (COPY = pg_catalog.english);
|
||||
|
||||
ALTER TEXT SEARCH CONFIGURATION es_en ALTER MAPPING FOR asciiword,
|
||||
asciihword,
|
||||
hword_asciipart,
|
||||
word,
|
||||
hword,
|
||||
hword_part WITH spanish_stem,
|
||||
english_stem;
|
||||
|
||||
ALTER TABLE
|
||||
public.entries
|
||||
ADD
|
||||
COLUMN search_vector tsvector GENERATED ALWAYS AS (
|
||||
to_tsvector(
|
||||
'es_en',
|
||||
coalesce(uid, '') || ' ' || coalesce(text, '')
|
||||
)
|
||||
) STORED;
|
||||
|
||||
CREATE INDEX entry_full_text_search ON public.entries USING gin (search_vector);
|
||||
|
||||
-- migrate:down
|
||||
DROP INDEX IF EXISTS entry_full_text_search;
|
||||
|
||||
DROP TEXT SEARCH CONFIGURATION IF EXISTS es_en;
|
||||
|
|
@ -7,7 +7,11 @@
|
|||
"theme": "dark",
|
||||
"css": "/style.css",
|
||||
"menu_item": [
|
||||
{ "icon": "home", "link": "/", "title": "Home" },
|
||||
{ "link": "index.sql", "title": "Home" },
|
||||
{
|
||||
"title": "Dependencies",
|
||||
"icon": "brand-stackshare",
|
||||
"submenu": [
|
||||
{
|
||||
"link": "/logic_groups/index.sql",
|
||||
"title": "Logic Groups",
|
||||
|
|
@ -20,3 +24,5 @@
|
|||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue