use more standard data types for text columns and fix creation order for tables
improve compatibility with other SQL database other than SQLite