Skip to content

Commit

Permalink
Merge pull request #12 from mat128/strip_default_functions
Browse files Browse the repository at this point in the history
Remove default values pointing to functions
  • Loading branch information
ChrisLundquist authored Jun 29, 2017
2 parents b9d1b04 + a65360d commit ddb730c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pg2mysql.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,9 @@ function pg2mysql($input, $header=true)
$line=str_replace(" timestamp DEFAULT now()"," timestamp DEFAULT CURRENT_TIMESTAMP",$line);
$line=preg_replace("/ timestamp( NOT NULL)?(,|$)/",' timestamp DEFAULT 0${1}${2}',$line);

// Remove defaults pointing to functions
$line=preg_replace("/ DEFAULT .*\(\)/", "", $line);

if(strstr($line,"auto_increment")) {
$field=getfieldname($line);
$tbl_extra.=", " . $config['autoincrement_key_type'] . "(`$field`)\n";
Expand Down

0 comments on commit ddb730c

Please sign in to comment.