-
Notifications
You must be signed in to change notification settings - Fork 935
Closed
Labels
Milestone
Description
The following schema:
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();
gives the error:
sql/schema/schema.sql:1:1: syntax error at or near "FUNCTION"
Maybe these statements should be ignored as they have no influence on the generated go code
maxjustus, JohannesKaufmann, oscartbeaumont, aight8, fdelbos and 1 more