Skip to content

Commit 6cba3cc

Browse files
committed
fix type mappings bug
1 parent 9fb3fc7 commit 6cba3cc

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/tablebuilder.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -264,30 +264,30 @@ def map_type(self, mysql_type, nullable=False):
264264
ch_type = 'String'
265265
elif mysql_type.startswith('TINYINT'):
266266
ch_type = 'UInt8' if mysql_type.endswith('UNSIGNED') else 'Int8'
267-
elif mysql_type.startswith('BOOL') or mysql_type.startswith('BOOLEAN'):
267+
elif mysql_type.startswith('BOOLEAN') or mysql_type.startswith('BOOL'):
268268
ch_type = 'UInt8'
269269
elif mysql_type.startswith('SMALLINT'):
270270
ch_type = 'UInt16' if mysql_type.endswith('UNSIGNED') else 'Int16'
271271
elif mysql_type.startswith('MEDIUMINT'):
272272
ch_type = 'UInt32' if mysql_type.endswith('UNSIGNED') else 'Int32'
273-
elif mysql_type.startswith('INT') or mysql_type.startswith('INTEGER'):
273+
elif mysql_type.startswith('INTEGER') or mysql_type.startswith('INT'):
274274
ch_type = 'UInt32' if mysql_type.endswith('UNSIGNED') else 'Int32'
275275
elif mysql_type.startswith('BIGINT'):
276276
ch_type = 'UInt64' if mysql_type.endswith('UNSIGNED') else 'Int64'
277277
elif mysql_type.startswith('SERIAL'):
278278
ch_type = 'UInt64'
279-
elif mysql_type.startswith('DEC') or mysql_type.startswith('DECIMAL') or mysql_type.startswith('FIXED') or mysql_type.startswith('NUMERIC'):
279+
elif mysql_type.startswith('DECIMAL') or mysql_type.startswith('DEC') or mysql_type.startswith('FIXED') or mysql_type.startswith('NUMERIC'):
280280
ch_type = 'String'
281281
elif mysql_type.startswith('FLOAT'):
282282
ch_type = 'Float32'
283283
elif mysql_type.startswith('DOUBLE') or mysql_type.startswith('REAL'):
284284
ch_type = 'Float64'
285285

286286
# Date and Time Types
287-
elif mysql_type.startswith('DATE'):
288-
ch_type = 'Date'
289287
elif mysql_type.startswith('DATETIME'):
290288
ch_type = 'DateTime'
289+
elif mysql_type.startswith('DATE'):
290+
ch_type = 'Date'
291291
elif mysql_type.startswith('TIMESTAMP'):
292292
ch_type = 'DateTime'
293293
elif mysql_type.startswith('TIME'):

0 commit comments

Comments
 (0)