This repository has been archived on 2023-12-16. You can view files and clone it, but cannot push or open issues or pull requests.
|
CREATE FUNCTION friendly_id(text) RETURNS text
|
|
AS $_$select regexp_replace( regexp_replace( lower( $1 ), '\\s+', '-', 'g' ), '[^a-zA-Z0-9\\-]', '', 'g' );$_$
|
|
LANGUAGE sql IMMUTABLE;
|
|
CREATE INDEX notebook_friendly_id_index ON notebook USING btree (friendly_id(name));
|