Improve the database schema
The current database schema could use some optimizations and clarifications. Most notably, a lot of columns could use a type change, to save space and improve readability. This is mostly due to the fact that most of the column types are not declared explicitly, and are instead inferred by Xorm from the types of the models; but these types are not always the most appropriate. For example, by default, all string fields are converted to varchar(255)
columns.
To resolve these issues, all columns should have their types declared explicitly. When needed, the column's type should be changed to a more appropriate one. Some columns are also missing constraints. Most notably, foreign keys are not enforced at the database level. A lot of not null
columns are also missing a default value.
All in all, a lot could be done to sanitize the database schema, but it would require a large amount of migration scripts.