-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't create VARCHAR column via API #2172
Comments
It's sad, that this error still persists. This is NOT documented in https://api.getdirectus.com/1.1/#Create_Column |
My sincere apologies for this not being addressed sooner. Our Core staff has spent the past year working on the new version and we made the decision early on to stay focused on that rather than splitting time between both versions. The new version is out and has 100% of our attention. We're working hard to get our docs perfect... |
Kamino closed and cloned this issue to directus/directus-6-legacy |
Creating a VARCHAR column via the API reports a SQL error:
POST query to
/api/1.1/tables/mytable/columns
Working query
request:
{'column_name': 'number', 'data_type': 'INT'}
response:
{'meta': {'type': 'item', 'table': 'directus_columns'}, 'data': {'id': 'number', 'name': 'number', 'column_name': 'number', 'type': 'INT', 'column_type': 'int(11)', 'length': 0, 'precision': 10, 'scale': 0, 'sort': 9999, 'default_value': None, 'nullable': True, 'key': '', 'extra': '', 'extra_options': [], 'options': [], 'table_name': 'nodes', 'required': False, 'system': False, 'ui': 'numeric', 'hidden_input': False, 'relationship': None, 'comment': "''", 'relationship_type': None, 'related_table': None, 'junction_table': None, 'junction_key_right': None, 'junction_key_left': None}}
The query with an error
request:
{'column_name': 'words', 'data_type': 'VARCHAR'}
response:
{'success': False, 'error': {'message': 'Statement could not be executed (42000 - 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near \'DEFAULT NULL COMMENT "\'\'"\' at line 1)'}, 'code': 0, 'class': 'Zend\\Db\\Adapter\\Exception\\InvalidQueryException', 'file': '/var/www/html/vendor/zendframework/zend-db/src/Adapter/Driver/Pdo/Statement.php', 'line': 244}
Version Info
Steps to Reproduce
The text was updated successfully, but these errors were encountered: