Closed simonw closed 7 months ago
Relevant code: https://github.com/simonw/datasette-edit-schema/blob/d6a7099bf529c0d29ddceec7d1764a750100e336/datasette_edit_schema/utils.py#L54-L76
Called from here: https://github.com/simonw/datasette-edit-schema/blob/d6a7099bf529c0d29ddceec7d1764a750100e336/datasette_edit_schema/__init__.py#L477-L483
Created a manual test DB like this:
echo '{"one": 1, "two": 2}' | sqlite-utils insert two_pks.db two_pks --pk one --pk two -
And this so I can test foreign key creation:
echo '{"one": 1, "two": 2}' | sqlite-utils insert two_pks.db other --pk one -
Fixed this problem but found you cannot set a primary key as a foreign key reference, which prevents you from using this plugin to create a m2m table with foreign key references. I'll fix that in a separate issue.
I have a m2m table that has a primary key across both columns.
When I tried to edit the schema I got a 500 error. Sentry says: