for a column in some tables I am getting strings like “MM5442” or “ED3321”. So it is always some alpha prefix and some important number. The alpha prefix is unique per table and it is only relevant to store the the number as a integer. I am thinking of doing this in the changeset and I want be able to validate that the data is correct for the column ie that that prefix is correct for the table and that the rest is a integer. Do you think I should use a custom type for this? Or should I implement a function that validates that the string starts with the prefix for the table and strips it in the beginning? Should I consider stripping the prefixes before giving them to the changeset and only cast the number?
What do you think? Thanks for your time!