HomeWrite.as

Refactor DB migrations types to be less MySQL-specific
940c50c0679dUnpublished

Unpublished Commit · Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

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.

Details

Provenance
ltdk <usr@ltdk.xyz>Authored on May 11 2022, 7:05 PM
Parents
rWF46bb8e65a12c: Add security policy
Branches
Unknown
Tags
Unknown

Event Timeline