I am on datajoint python 0.13.1
.
When executing .alter()
on a table in my schema I am getting the following error message:
---------------------------------------------------------------------------
NotImplementedError Traceback (most recent call last)
<ipython-input-43-f79406c4b690> in <module>
----> 1 MyTable.alter()
/opt/miniconda3/envs/analysis/lib/python3.6/site-packages/datajoint/table.py in alter(self, prompt, context)
102 del frame
103 old_definition = self.describe(context=context, printout=False)
--> 104 sql, external_stores = alter(self.definition, old_definition, context)
105 if not sql:
106 if prompt:
/opt/miniconda3/envs/analysis/lib/python3.6/site-packages/datajoint/user_tables.py in definition(self)
75 """
76 raise NotImplementedError(
---> 77 'Subclasses of Table must implement the property "definition"')
78
79 @ClassProperty
NotImplementedError: Subclasses of Table must implement the property "definition"
What am I doing wrong?
Makes sense. Currently,
alter
can only change secondary attributes. I cannot yet modify foreign keys, primary key, and indexes. Issue #901 explains this in part: https://github.com/datajoint/datajoint-python/issues/901The workaround currently is to use SQL
ALTER
command, which you can issue usingdj.conn().query(....)
. If you show your before and after table definitions, I will be able to generate the fullALTER
command.