Skip to content

Commit

Permalink
modify some types so they are not reinitializing over and over again
Browse files Browse the repository at this point in the history
  • Loading branch information
Programátor authored and Programátor committed Jul 24, 2020
1 parent 69e3d22 commit 2b0732a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "zrny/mksql",
"description": "Creating and AutoUpdating tables in MySQL",
"version": "0.1.1",
"version": "0.1.2",
"type": "library",
"keywords": [
"sql",
Expand Down
11 changes: 7 additions & 4 deletions src/ColumnType.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class ColumnType
const MEDIUMINT = 220011;
const SMALLINT = 220012;
const TINYINT = 220013;
const BIGINT = 220014;

const CHAR = 1;
const VARCHAR = 2;
Expand Down Expand Up @@ -100,14 +101,16 @@ public function getString()
return $this->parameterized(strtolower("DOUBLE"));
case self::FLOAT:
return $this->parameterized(strtolower("FLOAT"));
case self::BIGINT:
return 'bigint(20)';
case self::INT:
return $this->parameterized(strtolower("INT"));
return 'int(11)';
case self::MEDIUMINT:
return $this->parameterized(strtolower("MEDIUMINT"));
return "mediumint(9)";
case self::SMALLINT:
return $this->parameterized(strtolower("SMALLINT"));
return "smallint(6)";
case self::TINYINT:
return $this->parameterized(strtolower("TINYINT"));
return "tinyint(4)";
case self::CHAR:
return $this->parameterized(strtolower("CHAR"));
case self::VARCHAR:
Expand Down

0 comments on commit 2b0732a

Please sign in to comment.