Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion db_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ def parse(input_filename, output_filename):
extra = ""
extra = re.sub("CHARACTER SET [\w\d]+\s*", "", extra.replace("unsigned", ""))
extra = re.sub("COLLATE [\w\d]+\s*", "", extra.replace("unsigned", ""))
extra = re.sub("COMMENT ('|\").*('|\")", "", extra.replace("", ""))

# See if it needs type conversion
final_type = None
Expand All @@ -132,9 +133,12 @@ def parse(input_filename, output_filename):
elif type.startswith("smallint("):
type = "int2"
set_sequence = True
elif type.startswith("year("):
type = "int2"
set_sequence = True
elif type == "datetime":
type = "timestamp with time zone"
elif type == "double":
elif type.startswith("double("):
type = "double precision"
elif type.endswith("blob"):
type = "bytea"
Expand Down