table_schema = {
"columns": [
# NOTE: first column should be numerical column named `id` .
# Use `bigserial` if you want the database to create the re
{"name": "id", "data_type": "bigserial", "is_nullable": "False"},
{"name": "id", "data_type": "integer"},
{"name": "name", "data_type": "varchar(18)", "is_nullable": False},
{"name": "is_active", "data_type": "boolean"},
{"name": "capacity_mw", "data_type": "float"},
{"name": "installation_datetime_utc", "data_type": "datetime"},
]
}
On current develop, creating a table like this will result in an error that is not well caught. The resulting errors are that the table is created in the Django db but not in the oedb and also the permissions are not assigned because execution stops before assignment.
Steps to Reproduce
Define two id columns in the table payload object (see above)
Create a table using the api
Try to access or delete the table
Ideas of solution
Add a test that prevents creating a table in django db but not in the oedb
check if the payload contains only one id definition
Consider if it is safe to always drop tables that only exist in the Django db but not oedb
Description of the issue
Creating a table using the API & a payload like this:
or without primary key but duplicated id fields
On current develop, creating a table like this will result in an error that is not well caught. The resulting errors are that the table is created in the Django db but not in the oedb and also the permissions are not assigned because execution stops before assignment.
Steps to Reproduce
Ideas of solution
Add a test that prevents creating a table in django db but not in the oedb
check if the payload contains only one id definition
Consider if it is safe to always drop tables that only exist in the Django db but not oedb
Workflow checklist