Update migrate.py for better name migrations
This commit is contained in:
@ -7,6 +7,7 @@ import re
|
||||
import datetime
|
||||
import csv
|
||||
|
||||
RE_SPACES = re.compile(r'\s+')
|
||||
RE_INT = re.compile(r'-?[0-9]+')
|
||||
RE_FLOAT = re.compile(r'-?[0-9]+\.[0-9]+')
|
||||
RE_STR_START = re.compile(r'.*,"[^"]*$')
|
||||
@ -17,6 +18,10 @@ def sqlite_regexp(pattern: str, value: Optional[str]) -> Optional[bool]:
|
||||
return re.match(pattern, value) is not None if value is not None else None
|
||||
|
||||
|
||||
def remove_spaces(s: str) -> str:
|
||||
return RE_SPACES.sub(' ', s).strip()
|
||||
|
||||
|
||||
def cast_value(value: str) -> Any:
|
||||
if value == '':
|
||||
return None
|
||||
|
Reference in New Issue
Block a user