cycle / database

Database Abstraction Layer, Schema Introspection, Schema Generation, Query Builders
MIT License
54 stars 22 forks source link

💡 MySQL: add supproting for `CHECK` constraint #90

Open roxblnfk opened 1 year ago

roxblnfk commented 1 year ago

I have an idea!

CREATE TABLE Customers
(
  Age INT DEFAULT 18 CHECK(Age >0 AND Age < 100),
)

Or

CREATE TABLE Customers
(
    Age INT DEFAULT 18,
    CHECK((Age >0 AND Age<100) AND (Email !='') AND (Phone !=''))
);

See