A unique identifier (we recommend snake case field names), and our default table generation
creates a field called bracket_pkey.
To be able to insert into postgres, you must have a default value. We recommend using the
builtin function gen_random_uuid().
In order to leverage the a more efficient polling mechanism where only recently
updated/inserted records are polled, you must include a field that tracks when records were
modified. When Bracket builds a base for you, we create a field called bracket_last_modified
and add a trigger/function that updates that field’s value whenever the record is updated.
Here’s some default SQL that can help you get started:
create function bracket_update_timestamp() returns trigger language plpgsqlas$$ BEGIN NEW.bracket_last_modified = NOW(); RETURN NEW; END; $$;alter function bracket_update_timestamp() owner to postgres;
CREATE TRIGGER "update_bracket_last_modified_for_table_name"BEFORE UPDATE ON schema_name.table_nameFOR EACH ROW EXECUTE FUNCTION bracket_update_timestamp();