diff --git a/cheetah_orm/__init__.py b/cheetah_orm/__init__.py index 0669e09..8b2164f 100644 --- a/cheetah_orm/__init__.py +++ b/cheetah_orm/__init__.py @@ -3,4 +3,4 @@ __author__ = "Cybermals" __copyright__ = "Copyright (c) 2023 by Cybermals" __license__ = "MIT" -__version__ = "2.0.0b5" +__version__ = "2.0.0b6" diff --git a/cheetah_orm/mappers.py b/cheetah_orm/mappers.py index 96f97a2..829fca4 100644 --- a/cheetah_orm/mappers.py +++ b/cheetah_orm/mappers.py @@ -184,7 +184,11 @@ def init_model(self, model): # Add default value if default is not None: - col += f" DEFAULT '{default}'" + # Handle now() + if default == "now()": + default = "'now()'" + + col += f" DEFAULT {default}" field_sql += f"{col}," diff --git a/pyproject.toml b/pyproject.toml index df9827e..30a1b8b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "cheetah_orm" -version = "2.0.0b5" +version = "2.0.0b6" authors = [ {name="Cybermals", email="cybermals@googlegroups.com"} ] diff --git a/test.db b/test.db index db33acc..8b3c0e6 100644 Binary files a/test.db and b/test.db differ