metarhia / metaschema

Schema definition and validation 💡
https://metarhia.com
MIT License
53 stars 18 forks source link

Checking that the length property is not assigned to type number #438

Open niusia-ua opened 1 year ago

niusia-ua commented 1 year ago

Description By analogy with the string type being converted to varchar, I wanted to limit the length of the number. After the command metasql c, a type integer(<precision>) was generated in the database.sql file, using which will result in an error when attempting to migrate.

Solution I suggest adding a check that the property length is not used in relation to the type number.

Alternatives You can also use numeric(<precision>) when generating sql.

Additional context Driver: Postgres.