How can I create a custom constraint to have default to getpgusername()

I have a non nullable field called createdBy I would like it to auto populate to getpgusername(). How can i create a Migration field constraint to do that?

You'll need to add some raw SQL to do that. Here's an example of adding a new timestamp column to a model that defaults to the current time:

  .field(FluentUserAccessToken.v20200922.createdAt, .datetime, .required, 
Terms of Service

Privacy Policy

Cookie Policy