[DBIx-Class-Devel] [sql-translator] ::Diff tries to modify old table after table rename for PK col name change (#40)

Peter Mottram notifications at github.com
Wed Jul 9 14:14:41 GMT 2014


I tend to use PK cols which are named after the table e.g. table 'foos' has PK 'foos_id'. When renaming tables via ::Diff `->extra( renamed_from => 'foos'` then I get one of two possible breakages:

* if renamed_from is used on the column as well then I get:
```
Can't alter field in another table at .../SQL/Translator/Producer/PostgreSQL.pm line 769.
```
* if I skip the renamed_from on the PK (not a good idea in reality but an interesting test) then ::Diff gives a table rename followed by a DROP COLUMN on the table that no longer exists.

The following test is currently setup for the 2nd scenario but can also be used to test the first one by removing comments from the 2 obvious lines:
[pgsql-table-renamed-from.t](https://github.com/SysPete/sql-translator/blob/fixes/postgresql_table_renamed_from/t/pgsql-table-renamed-from.t)

---
Reply to this email directly or view it on GitHub:
https://github.com/dbsrgits/sql-translator/issues/40
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scsys.co.uk/pipermail/dbix-class-devel/attachments/20140709/bad3cb38/attachment.htm>


More information about the DBIx-Class-Devel mailing list