Good morning comrades,
Today I am designing an erm diagram in workbench and I don't know how to place a column that saves the update date with each record.
In a practical case, I want to make a system of medical records, where a creation date column and a modification date column are established, where the creation is the automatic date of the moment of registration, and the modification date saves the last date when the record was modified.
Thing that doctor 1 creates a new note in the medical record on October 1, 2018 and that record has subsequently been modified, and the date of said record was December 15, 2018.
I'm making the tables using erm tables and I don't know where to go to do that...
Here I found the option to place a timestamp but unfortunately the parameter must contain something where the asterisks are and I have not the slightest idea. I have tried the format by placing "YYYY-MM-DD HH:MM:SS" but I get an error.
Ask
What should I do to achieve my goal?
Historias_Clinicascol
asTIMESTAMP
but without the parenthesesNOW()
, to indicate that if the column is not assigned a value, it has a default value that is the current date and time with which that record is filledIt should look like this:
DESCRIBE
it would look like this:Sample:
Now if what you want is to pass a specific value, what you expect to get in the parentheses is an integer between 1 to 10, if you exceed the limit you will have an error like this:
My best recommendation is to take the option that I mention at the beginning.