This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Kind } from 'graphql/language'; | |
import { GraphQLScalarType } from 'graphql'; | |
function serializeDate(value) { | |
if (value instanceof Date) { | |
return value.getTime(); | |
} else if (typeof value === 'number') { | |
return Math.trunc(value); | |
} else if (typeof value === 'string') { | |
return Date.parse(value); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* original unaccent function isn't usable for indices | |
*/ | |
CREATE OR REPLACE FUNCTION uaccent(text) RETURNS text AS | |
$uaccent$ | |
SELECT unaccent('unaccent',$1::text); | |
$uaccent$ LANGUAGE sql IMMUTABLE; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* PostgreSQL česká template1 */ | |
UPDATE pg_database SET datistemplate = false WHERE datname = 'template1'; | |
DROP DATABASE template1; | |
CREATE DATABASE template1 template=template0 encoding='UTF-8' LC_COLLATE='cs_CZ.UTF-8' LC_CTYPE='cs_CZ.UTF-8'; | |
COMMENT ON DATABASE template1 IS 'Výchozí česká databáze'; | |
UPDATE pg_database SET | |
datacl = (SELECT datacl FROM pg_database WHERE datname = 'template0'), | |
datistemplate = true | |
WHERE datname = 'template1'; |
NewerOlder