sql-migrate
sql-migrate copied to clipboard
create function in the migration file
i am trying to create the function in .sql file
here is my syntax
-- +migrate Up
CREATE OR REPLACE FUNCTION trigger_set_timestamp()
RETURNS TRIGGER AS $$
BEGIN
NEW.updated_at = NOW();
RETURN NEW;
END;
$$
i was trying using -- +migrate StatementBegin and End but it said not matching
is there any way to create a function with sql-migrate?