strip schema name from ADD CONSTRAINT / CREATE INDEX ghpr/closed/inspiring_pr48
authorFitz Elliott <felliott@fiskur.org>
Thu, 26 Jun 2014 19:12:06 +0000 (15:12 -0400)
committerFitz Elliott <felliott@fiskur.org>
Thu, 26 Jun 2014 19:12:54 +0000 (15:12 -0400)
commit2e721985fdc415261ff2b8b5cbf48f590736c197
tree2cebe73d002fc1c09dd93ab388d4ebcb791cdc76
parent1e25c37c2a1b37307c6b151b1672664dfaa10766
strip schema name from ADD CONSTRAINT / CREATE INDEX

 * Pg tablenames may have a schema prefix.  This leads to invalid ADD
   CONSTRAINT / CREATE INDEX statments being generated by ->deploy(),
   since constraint and index names may not have a period in them. This
   patch strips the schema part from the table name when constructing
   unique index and constraint names.  The fix was taken from
   ribasushi's email to the mailing list:

   http://lists.scsys.co.uk/pipermail/dbix-class/2013-February/011141.html
lib/DBIx/Class/ResultSource.pm
lib/SQL/Translator/Parser/DBIx/Class.pm
t/99dbic_sqlt_parser.t