I have made relational database model using MagicDraw tool. Every cashier has their workTime type saved in enumerator:
Then I generate DDL code and try to paste it into phpMyAdmin to generate DB but I get many errors. I tried to fix them by hand but errors are still here. So how should that check statement be written?
2
Answers
I think I have found a solution.
A book that I was following to create DDL from MagicDraw project suggested to pick "Check Constraints" as an "Enumeration transformation strategy" when transforming model. It didnt worked that way so I have chosen "Lookup tables" instead and DDL code seems to be working now.
However it still had some erorrs. I had to add semicolons after all INSERT statements.
And I also had to delete word "precision" after every 'double' type:
It works now.
A check constraint isn’t part of a column’s definition, it’s its own clause in the table definition. You need a comma between the
worktime char(13) not null
and thecheck
.