Skip to content

Commit

Permalink
Adding Client for MySQL version 5.5 (#147)
Browse files Browse the repository at this point in the history
  • Loading branch information
NewtTheWolf authored Jan 9, 2022
1 parent eef1ea0 commit e889f38
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
13 changes: 13 additions & 0 deletions clients/ClientMySQL55.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import {
COL_CREATED_AT,
COL_FILE_NAME,
MAX_FILE_NAME_LENGTH,
TABLE_MIGRATIONS,
} from "../consts.ts";
import { ClientMySQL } from "./ClientMySQL.ts";
/** MySQL client */
export class ClientMySQL55 extends ClientMySQL {
protected get QUERY_CREATE_MIGRATION_TABLE() {
return `CREATE TABLE ${TABLE_MIGRATIONS} (id bigint UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, ${COL_FILE_NAME} varchar(${MAX_FILE_NAME_LENGTH}) NOT NULL UNIQUE, ${COL_CREATED_AT} timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP);`;
}
}
1 change: 1 addition & 0 deletions consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@ export enum DB_DIALECTS {
export enum DB_CLIENTS {
pg = "ClientPostgreSQL",
mysql = "ClientMySQL",
mysql55 = "ClientMySQL55",
sqlite = "ClientSQLite",
}
1 change: 1 addition & 0 deletions mod.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export * from "./clients/AbstractClient.ts";
export * from "./clients/ClientMySQL.ts";
export * from "./clients/ClientMySQL55.ts";
export * from "./clients/ClientPostgreSQL.ts";
export * from "./clients/ClientSQLite.ts";
export * from "./types.ts";
Expand Down

0 comments on commit e889f38

Please sign in to comment.