simonw / datasette-edit-schema

Datasette plugin for modifying table schemas
Apache License 2.0
16 stars 0 forks source link

Track create-table and drop-table events with Datasette 1.0a8 #53

Closed simonw closed 7 months ago

simonw commented 7 months ago

Refs:

TODO:

simonw commented 7 months ago

I'm going to fire the alter-table event only if the table schema has changed. I won't fire it for create index / drop index.

simonw commented 7 months ago

Should I fire that event for rename table?

Probably yes. The catch is that I need to decide which table I'm going to use as the table attribute - should that be the previous name or the new name?

The before_schema and after_schema things will capture those details.

I'm going to track the new table name as the table in the rename, since that makes it easier to start with that table and figure out its history.

simonw commented 7 months ago

Problem! AlterTableEvent isn't in a release yet - I implemented that after I shipped 1.0a8.

simonw commented 7 months ago

I'll do alter event in a separate issue.