Commit Graph

1 Commits

Author SHA1 Message Date
ltdk 940c50c067 Refactor DB migrations types to be less MySQL-specific
Notes on these changes:

* Column types are now interfaces, rather than enums, to allow type-specific customisation
* The size and default value for a column has now been included as part of the type interfaces, to avoid cases that make very little sense (like DATETIME(1))
* The smallint and int types have been merged into a single integer type, which can also emit tinyint, mediumint, and bigint for MySQL
* The "current timestamp" default value is now part of a datetime column type, instead of being a weird hack on top of the column
* The SQLBuilder interface is now in its own module, since it being specifically in the create module was misleading

The existing migrations which use these types have been modified to accomodate the refactor, which also helps serve as examples for the existing types.

The primary purpose of this refactor is to better accomodate additional database dialects, namely PostgreSQL.
2022-05-13 01:03:22 -04:00