Files
upstream-mirror 0f4df23290
Some checks failed
kotlin / test (push) Has been skipped
python / test (push) Has been skipped
typescript / test (push) Has been skipped
go / build darwin/amd64 (push) Has been cancelled
go / build linux/amd64 (push) Has been cancelled
go / build windows/amd64 (push) Has been cancelled
go / build darwin/arm64 (push) Has been cancelled
go / build linux/arm64 (push) Has been cancelled
go / build windows/arm64 (push) Has been cancelled
go / test (push) Has been cancelled
go / vuln_check (push) Has been cancelled
snapshot of https://github.com/sqlc-dev/sqlc.git (main, 2026-09-16; blobs > 131072B omitted)
2026-09-16 02:17:34 +05:00

25 lines
692 B
PL/PgSQL

CREATE SCHEMA tdd;
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
CREATE EXTENSION IF NOT EXISTS pgcrypto
SCHEMA public
VERSION "1.3";
CREATE FUNCTION tdd.trigger_set_timestamp() RETURNS trigger
LANGUAGE plpgsql
AS $$BEGIN
NEW.ts_updated = NOW();
RETURN NEW;
END;
$$;
CREATE TABLE tdd.tests (
test_id uuid DEFAULT uuid_generate_v4() PRIMARY KEY,
title text DEFAULT ''::text NOT NULL,
descr text DEFAULT ''::text NOT NULL,
ts_created timestamp with time zone DEFAULT now() NOT NULL,
ts_updated timestamp with time zone DEFAULT now() NOT NULL
);
CREATE TRIGGER set_timestamp BEFORE UPDATE ON tdd.tests FOR EACH ROW EXECUTE FUNCTION tdd.trigger_set_timestamp();