You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When using table.string("slug"), we cannot create a record with it.
>>> User.create({"name": "sam", "email": "sam@gmail.com", "password": "secret", "slug": "test"})
Traceback (most recent call last):
File "/Users/craggeek/.pyenv/versions/m4_01/lib/python3.9/site-packages/masoniteorm/connections/SQLiteConnection.py", line 142, in query
self.statement(query, bindings)
File "/Users/craggeek/.pyenv/versions/m4_01/lib/python3.9/site-packages/masoniteorm/connections/BaseConnection.py", line 40, in statement
self._cursor.execute(query, bindings)
sqlite3.IntegrityError: NOT NULL constraint failed: users.slug
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/Users/craggeek/.pyenv/versions/m4_01/lib/python3.9/site-packages/masoniteorm/models/Model.py", line 452, in create
return cls.builder.create(dictionary, id_key=cls.__primary_key__)
File "/Users/craggeek/.pyenv/versions/m4_01/lib/python3.9/site-packages/masoniteorm/query/QueryBuilder.py", line 484, in create
query_result = connection.query(self.to_qmark(), self._bindings, results=1)
File "/Users/craggeek/.pyenv/versions/m4_01/lib/python3.9/site-packages/masoniteorm/connections/SQLiteConnection.py", line 150, in query
raise QueryException(str(e)) from e
masoniteorm.exceptions.QueryException: NOT NULL constraint failed: users.slug
Expected behavior
Should be able to use this field name.
Screenshots or code snippets
Screenshots help a lot. If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
OS: macOS
What database are you using?
Type: SQLite
Masonite ORM latest
The text was updated successfully, but these errors were encountered:
Describe the bug
When using
table.string("slug")
, we cannot create a record with it.Expected behavior
Should be able to use this field name.
Screenshots or code snippets
Screenshots help a lot. If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
What database are you using?
Type: SQLite
Masonite ORM latest
The text was updated successfully, but these errors were encountered: