Honor supplied field order when adding fields to a table object
[dbsrgits/SQL-Translator.git] / Changes
1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2 *** INCOMPATIBLE CHANGES:
3 * SQLT no longer supports setting separate conflicting values for the now
4   deprecated 'quote_table_names' and 'quote_field_names'. Instead their values
5   are proxied to the new 'quote_identifiers'. If 'quote_identifiers' is
6   supplied, the legacy settings are ignored (with a warning). If nothing is
7   specified the default is TRUE as before. If only one is specified - default
8   to its value for everything, and if both are specified with a conflicting
9   value an exception is thrown.
10 * Partial quoting support has been added in SQLite. It is currently disabled by
11   default, you need to request is explicitly with quote_identifiers => 1. In a
12   future version of SQL::Translator *THIS DEFAULT BEHAVIOR WILL CHANGE*.
13   If you do NOT WANT quoting, set quote_identifiers to a false value to
14   protect yourself from changes in a future release.
15 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
16 * Fixes to SQLite foreign keys production (patch from Johan Viklund)
17   closes RT#16412, RT#44769
18 * ON DELETE/UPDATE actions for SQLite (patch from Lukas Thiemeier)
19   closes RT#70734, RT#71283, RT#70378
20 * Fix data preservation on SQLite diffs involving adding/dropping columns
21 * Support for triggers in PostgreSQL producer and parser
22 * Correct Data Type in SQLT::Parser::DBI::PostgreSQL (patch from Andrew Pam)
23 * Fix index issue in SQLT::Parser::DBI::PostgreSQL
24 * Add column and table comments in SQLT::Parser::DBI::PostgreSQL(patch from Andrew Pam)
25 * Fixed alter_drop_constraint for foreign keys and applying multiple changes
26   via alter_field to a column in Postgres Producer
27 * Added a working mechanism for naming foreign keys in the PostgreSQL producer
28 * Fix PostgreSQL ignoring default values with specified data type
29 * Fix possible name duplication in SQLlite producer
30 * Oracle does not accept ON DELETE/UPDATE RESTRICT (though it is the actual default)
31   fix by not adding the ON DELETE/UPDATE clause at all
32 * Changed dependency on Digest::SHA1 to the core-bundled Digest::SHA (RT#67989)
33 * Support for double quoted and bit strings as default values in MySQL parser
34 * Proper handling of CURRENT_TIMESTAMP default values in MySQL parser (RT#65844)
35 * Check in MySQL parser to avoid trying to parse a table defined twice in the same
36   file as indices (and probably other things) get messed up
37 * Workaround for some MySQL quirks on primary key definitions
38 * Fix dropping primary keys in MySQL diffs (RT#62250, patch from Nick Bertrand)
39 * MySQL producer does not attempt to write out non-existent unique constraint names
40 * MySQL parser correctly differentiates between signed and unsigned integer column
41   display sizes
42 * Replace Class::Accessor::Fast dependency with already-included Moo
43 * Entire codebase is now free of tabs and trailing whitespace
44 * Spellfixes (RT#68912)
45 * Fix Diagram Producer POD (RT#71397, RT#71398)
46 * Fix Diagram Producer to use correct binmode on output (RT#71399)
47 * Fix ignored option to script/sqlt-diagram (RT#5992)
48 * Fix t/17sqlfxml-producer.t failures due to whitespace differences introduced by
49   environment config snippets (RT#70786)
50 * Fix assembly of Table objects with numbered columns being added out of order
51   (RT#74771) (based on patch from Jonathan Otsuka)
52 * Deprecate SQL::Translator::Schema::Graph and the as_graph() schema method
53 * Bump minimum supported perl version to 5.8.1 (mostly due to Moo)
54
55 # ----------------------------------------------------------
56 # 0.11010 2011-10-05
57 # ----------------------------------------------------------
58
59 * Add "if exists" to drop view statements in Pg.
60
61 # ----------------------------------------------------------
62 # 0.11009 2011-09-02
63 # ----------------------------------------------------------
64
65 * Fix MySQL producer to properly quote all table names on output (patch from geistteufel)
66
67 # ----------------------------------------------------------
68 # 0.11008 2011-05-04
69 # ----------------------------------------------------------
70
71 * Correctly create and parse FK constraints in SQLite
72 * Correct postgis geography type insertion and linebreak fix for multiple geometry/geography columns
73 * made PostgreSQL producer consistent with other producers in terms of
74   quoting and allowing functions in constraints and indices
75 * Add distinction of autoinc and regular primary keys to the GraphViz producer
76 * Fix odd invocation of Test::More::pass() in t/36-filters.t (RT#64728)
77 * Quote everything in SQL Server
78 * Turn off constraints before dropping tables in SQL Server
79 * Make true unique constraints if needed in SQL Server
80 * Fixed Producer::PostgresSQL to output array type after type size,
81   i.e. varchar(64)[] rather than varchar[](64)
82
83 # ----------------------------------------------------------
84 # 0.11007 2010-11-30
85 # ----------------------------------------------------------
86
87 * Fix POD typo in SQL/Translator/Schema/Trigger.pm
88 * Add explicit Scalar::Util to the deplist for really old perls
89 * Add support for PostGIS Geometry and Geography data types in the Pg producer
90 * Some minor fixes to squash warnings on new perls
91 * Support a custom_type_name hint when creating enum types in PostgreSQL
92 * Fix sqlt options/pod mismatch (RT#58318)
93 * Oracle Producer multicolumn constraint support
94 * Add support for triggers in the MySQL producer
95 * Fix unstable order of View's in MySQL parser
96
97 # ----------------------------------------------------------
98 # 0.11006 2010-06-03
99 # ----------------------------------------------------------
100 * Fix Producer::Oracle varchar2 without size def (ORA-00906: missing right
101   parenthesis)
102 * Fix Producer::Oracle translate float and double to float instead of number
103 * Fix Producer::Oracle generation of too long unique constraint names
104 * Fix Producer::SQLite when generating VIEWs with add_drop_table => 1
105 * Fix Producer::MySQL not quoting index names when requested (RT#56173)
106 * Fix Producer::MySQL wrapping extra ()s around VIEW SELECT-ors (RT#56419)
107 * Fix Field::default_value to behave like a real accessor (allow undef as
108   an unsetting argument)
109 * Fix Mysql/Pg/SQLite/MSSQL producers to properly *not* quote numeric default
110   values (RT#57059)
111 * Producer::Oracle tests now use Test::Differences
112 * Prettify output of SQLite producer (less bogus newlines)
113 * Augment SQLite and Pg producers to accept a perl-formatted (%d.%03d%03d)
114   and regular no-leading-zero (X.X.X) *_version producer args
115
116 # ----------------------------------------------------------
117 # 0.11005 2010-02-24
118 # ----------------------------------------------------------
119 * Fix Parser::DBI::Oracle reading too many tables (RT#49413)
120 * Fix Parser::MySQL tripping up on PRIMARY KEY ... USING (currently value is ignored) (RT#50468)
121 * Fix runaway debug trace (RT#52276)
122 * Fix Parser::PostgreSQL choking on commit; statements in DDL (#RT52277)
123 * Producer::Oracle now respects quote_field|table_names, and
124   no longer does name munging of reserved table names
125 * Producer::Oracle now correctly outputs databse-unique index names
126
127 # ----------------------------------------------------------
128 # 0.11004 2010-02-14
129 # ----------------------------------------------------------
130 * Fix PG producer numeric precision regression (RT#49301)
131 * Add DB2 producer numeric/decimal precision output
132 * Fix Oracle producer creating numeric precision statements that the test case expects (no whitespace)
133 * Add Oracle producer creating drop view statements like PG producer does
134 * Fix SQL::Translator::Diff to use producer_args instead of producer_options
135
136 # ----------------------------------------------------------
137 # 0.11003 2009-09-28
138 # ----------------------------------------------------------
139 * Pg parser fixes to deal properly with MATCH <type>
140 * Pg parser fixes to parse timestamp attributes correctly
141 * Fix broken default detection in script/sqlt (RT#27438)
142 * Fix dependency issues with LibXML and TT
143
144 # ----------------------------------------------------------
145 # 0.11002 2009-08-30
146 # ----------------------------------------------------------
147 * Depend on fixed Parse::RecDescent
148 * Added skip-tables and skip-tables-like options to Diagram
149
150 # ----------------------------------------------------------
151 # 0.11001 2009-08-18
152 # ----------------------------------------------------------
153 * Removed last use of Readonly
154 * Adjusted YAML dependency
155
156 # ----------------------------------------------------------
157 # 0.11000 2009-08-18
158 # ----------------------------------------------------------
159 * Re-add version numbers to files, else cpan's "upgrade" gets very confused
160 * Replaced code using Readonly, since most of the rest uses constant, and thats already a dep
161 * Moved YAML and XML::LibXML back to recommends, the tests for both now skip if not installed
162 * Bumped to 0.11000 to supercede 0.10 which has incorrect numbering scheme
163
164 # ----------------------------------------------------------
165 # 0.10 2009-08-13
166 # ----------------------------------------------------------
167 * Resolved the following RT bugs (thanks to everyone for reporting!):
168 25791   does not recognize PostgreSQL ON_ERROR_STOP
169 29265   sqlt-diagram: --natural-join needs Graph::Directed
170 37814   SQLite translator failing to parse schema
171 42548   Producer::PostgreSQL incorrectly inserts the size in
172         'time(stamp)? with(out) time zone' fields
173 43173   SQL::Translator::Parser without versionnumber - will install
174         old 0.09002
175 46805   (No subject)
176 47026   META.yml is not packaged due to MANIFEST.SKIP (easyfix)
177 32130   Move from XML::XPath to XML::LibXML::XPathContext
178 22261   MySQL parse
179 13915   missing optional prerequisite cause make test to fail
180 8847    Diagram.pm: BINMODE missing in printing of graphic file.
181 21065   GraphViz producer fails on tables named 'node'
182 35448   Producer::PostgreSQL types without size
183 22026   sqlt-diagram uses -f arg twice
184 47897   [PATCH] Fix uninitialized value within @_ in (uc|lc)
185 47668   Mysql Parser doesn't recognize key types
186 46448   sqlt-graph errors out on MySQL DDL with btree keys
187 47176   Add Foreign Key support to Parser::DBI::PostgreSQL.pm
188 48025   MySQL Producer: Case inconsistency between elements in
189         @no_length_attr and $data_type
190 48569   sqlt-diagram fails to load SQLite schema
191 48596   SQL::Translator::Diff::schema_diff should produce a list in
192         list context
193 44907   SQL::Translator::Producer::PostgreSQL produce() in list context
194         should return a list of statements
195
196 # ----------------------------------------------------------
197 # 0.09007 2009-06-25
198 # ----------------------------------------------------------
199 * Fixed Pg parser - caching the compiled P::RD schema is a *very*
200   bad idea
201 * Fix MSSQL handling of ON UPDATE/DELETE RESTRICT
202 * Delay MSSQL FK constraint deployment until after all CREATE TABLE
203   statements
204 * Coerce other engine's bytea/blob/clob datatypes to VarBinary
205
206 # ----------------------------------------------------------
207 # 0.09006 2009-06-10
208 # ----------------------------------------------------------
209 * Multiple test and dependency adhustments to make smokers happy
210 * Fix YAML producer wrt extra attribute
211 * Added support for "time(stamp) (p) with time zone" for Pg producer (mo)
212
213 # ----------------------------------------------------------
214 # 0.09005 2009-06-08
215 # ----------------------------------------------------------
216 * Add parser support for MySQL default values with a single quote
217 * Properly quote absolute table names in the MySQL producer
218 * Added CREATE VIEW subrules for mysql parser (wreis)
219 * Many fixes to code and tests for trigger's "database_events"
220 * Added semi-colon for (DROP|CREATE) TYPE statements in the Pg producer (wreis)
221 * ALTER TABLE/ALTER COLUMN/DROP DEFAULT support in Pg producer (mo)
222 * XML parser support for multi-event triggers
223 * SQLite producer support for multi-event triggers
224 * XML parser switched from XML::XPath to XML::LibXML
225 * Pg producer ALTER TABLE/COLUMN and DROP DEFAULT support
226 * MySQL producer skips length attribute for columns which do not support that
227   attribute. Currently following column types are added to that list:
228   date time timestamp datetime year
229 * Switch to Module::Install (mandates minimum perl 5.005)
230 * Major cleanup of GraphViz proucer
231 * Massive amount of fixes to SQLite/Pg/Mysql/MSSQL parsers/producers
232   Fix most of the problems uncovered by the roundtrip test framework
233   Some highlights:
234     - Rewind exhausted globs before attempting a read
235     - Do not add xml comment header if no_comments is set
236     - table/field counts are held per schema object, not globally
237     - no more variable table and column names in SQLite and MSSQL
238     - VIEW support for Pg parser, also some cleanups
239     - The way we generate Pg create view statements was not standards compliant
240       (per RhodiumToad in #postgresql)
241     - Disable MSSQL view/procedure production - they never worked in the first place
242     - SQLite/MSSQL improvements:
243       - Support parsing of all DROP clauses
244       - Support parsing of field-level comments
245       - When producing do not append table names to constraint/index names
246
247 # ----------------------------------------------------------
248 # 0.09004 2009-02-13
249 # ----------------------------------------------------------
250 * Add support for temporary tables in Pg (nachos)
251 * Create Trigger support for SQLite
252 * GraphViz producer improvements
253
254 # ----------------------------------------------------------
255 # 0.09003 2009-02-07
256 # ----------------------------------------------------------
257   <BORKED RELEASE DELETED OFF CPAN>
258
259 # ----------------------------------------------------------
260 # 0.09002 2008-12-05
261 # ----------------------------------------------------------
262 * parsing MySQL CURRENT_TIMESTAMP as scalar ref so it can be produced without
263   quotes (jgoulah)
264 * Add ignore_opts parser arg (to ignore table options) in Parser::MySQL (jgoulah)
265 * Skip tests for buggy Spreadsheet::ParseExcel versions (rbo)
266 * Add support for skip tables parser arg in Parser::DBI::MySQL (jgoulah)
267 * Changed behaviour of ::Producer::Oracle when returning an array of statements
268   to make it compatible to DBI->do()
269 * Fixed a few bugs in ::Producer::Oracle
270 * Applied patch from jgoulah to support mysql's MERGE option
271 * Applied patch from rbo to add support of multiple database events on a trigger
272 * Applied patch from lukes to allow drop if exists in sqlite producer, with
273   version >= 3.3
274 * Applied patch from rjbs with minor changes, now we support scalar refs in
275   default values!
276 * Fixed SQLite producer to end index statements in newlines, in scalar context
277 * Decreed that all list context statements shall not end in ; or ;\n
278 * Fixed SQLite, Diff and MySQL producers to agree with Decree.
279 * Added support for CREATE VIEW + tests in the Pg producer (wreis)
280 * Added support for CREATE VIEW + tests in the sqlite producer (groditi)
281 * Added proper argument parsing and documentation to MySQL Parser and
282   Producer (ribasushi)
283 * Using DROP VIEW instead of OR REPLACE clause in the Pg producer, as replace
284   only allows replacement with identical set of columns (wreis)
285 * Added support for DROP VIEW and fixed CREATE VIEW statement in the sqlite
286   producer (wreis)
287 * Removed source_db and target_db accessors from Diff (throwback to old version,
288   only output_db is used)
289
290
291 * Support for longer varchar fields in MySQL
292
293 # ----------------------------------------------------------
294 # 0.09001 2008-08-19
295 # ----------------------------------------------------------
296 * Added support for CREATE VIEW + tests in the mysql producer (groditi)
297 * Added support for SET fields in the mysql producer + test (groditi)
298 * Added support for proper booleans in the mysql producer, when a mysql version
299   of at least 4.x is supplied
300 * Added support for proper enums under pg (as of 8.3), with pg version check,
301   and deferrable constraints
302 * Added support to truncate long constraint and index names in the mysql
303   producer, because of a change to DBIx::Class to produce such long names in
304   some cases.
305
306 # ----------------------------------------------------------
307 # 0.09000 2008-02-25
308 # ----------------------------------------------------------
309
310 * Fix Pg produces idea of which field types need a size param (wreis)
311 * Add support for COLLATE table option to MySQL parser
312 * Allow DEFAULT CHARACTER SET without '=' (as produced by mysqldump)
313
314 # -----------------------------------------------------------
315 # 0.0899_02 2008-01-29
316 # ----------------------------------------------------------
317
318 * Major refactoring of SQL::Translator::Diff again:
319 * Diff is no longer one huge monolithic function.
320 * Added more tests for diff
321 * When producing diffs for MySQL you will (by default) get single alter
322   statements per table
323 * SQLite can also do remove columns (by creating a temp table as shown in
324   http://sqlite.org/faq.html#q11
325 * Columns can be renamed if the new schema is from a form that can have metadata
326   (which is pretty much anything but an SQL file.) It does this by looking at
327   renamed_from in the $field->extra
328 * Updated Oracle and Postgres producers
329 * More tests!
330
331 # -----------------------------------------------------------
332 # 0.0899_01 2007-10-21
333 # ----------------------------------------------------------
334
335 * SQL::Translator::Diff now uses the ::Producer modules to create diffs
336   This *will* break back-compatibility
337   Use sqlt-diff-old for the previous one, and fix producers!
338
339 # -----------------------------------------------------------
340 # 0.08001 2007-09-26
341 # ----------------------------------------------------------
342
343 * Patched to ignore all TT versions >= 2.15 until TT is fixed :(
344
345 # -----------------------------------------------------------
346 # 0.08 2006-12-07
347 # -----------------------------------------------------------
348
349 * Patched 18ttschema-producer.t and 33tt-table-producter.t to skip on TT 2.15,
350   thanks Ash!
351
352 # -----------------------------------------------------------
353 # 0.08_04 2006-11-10
354 # -----------------------------------------------------------
355
356 * Patched MySQL producer to name constraints sanely, thanks Ash
357 * Added patch to Producer::DB2 to avoid dependency issues with foreign keys
358 * Added patch to remove single quotes for numeric default values in Producer::DB2
359 * Fixed Parser::SQLite to require a semicolon after a create trigger statement
360 * Added patch from avinash to add CASCADE to pg table drops
361
362 # -----------------------------------------------------------
363 # 0.08_03
364 # -----------------------------------------------------------
365
366 * Added patch to use default values for Pg timestamp fields
367
368 # -----------------------------------------------------------
369 # 0.08_02    2006-11-03
370 # -----------------------------------------------------------
371
372 * Added patch from Ash to separate DROP statements in mysql producer in
373   list-context
374 * Fixed up SQLites usage of no-comments
375
376 # -----------------------------------------------------------
377 # 0.08_01    2006-07-23
378 # -----------------------------------------------------------
379
380 * Made Trigger check that a give table exists in on_table - castaway
381 * Split some producers (DB2, MySQL, SQLite, PostgreSQL) into sub methods (others
382   to follow) - castaway
383 * Add alter_* methods to some Producers and docs to Producer.pm (for use by Diff
384   later) - castaway
385 * Made changes to allow producers to return a list of statements - castaway
386 * Split sqlt-diff into script and module - castaway
387 * Added quote_table_names and quote_field_names patch (omega, zamolxes) - castaway
388 * Added DB2 Producer - castaway
389 * Added mysql_character_set for 4.1+ -mda
390 * New filters, Names and Globals. -mda
391 * Added the initial work on a template based Dia UML producer. -mda
392
393 # -----------------------------------------------------------
394 # 0.07    2005-06-10
395 # -----------------------------------------------------------
396 *   YAML parser supports extra attributes on tables.
397
398 *   All schema objects now support the extra attribute, so can
399     have arbitary name/value data attached to them.
400
401 *   Refactoring: Added SQL::Translator::Schema::Object - base
402     class for all Schema objects.
403
404 *   Changes to MySQL Parser (Dave Howorth)
405     - ignore INSERT statements
406     - permit ALTER TABLE ADD FOREIGN KEY
407     - allow trailing comma on last field in CREATE statements
408     - collect the database name
409
410 *   TTSchema Producer
411     - Can pass extra variables using tt_vars producer arg.
412     - Can pass extra config using tt_conf producer arg.
413     - Variables and config can be passed on the command line
414       with --tt-var and --tt-conf options to sqlt.
415
416 *   Added schema filters.
417
418 *   MySQL Producer
419     - Added 'mysql_table_type' extra attribute on tables.
420     - Works out InnoDB tables from constraints.
421     - mysql_charset and mysql_collate extra attributes for tables and fiels.
422
423
424 # -----------------------------------------------------------
425 # 0.06    2004-05-13
426 # -----------------------------------------------------------
427 *   Added SQL::Translator::Manual
428
429 *   Installation process now uses Module::Build
430
431 *   Added new "Dumper" producer
432
433 *   Changed the native SQL Fairy XML format to a fixed mapping.
434     *NB:* You should convert your existing XML schema. See the
435     SQL::Translator::Parser::XML::SQLFairy docs.
436
437 *   Added producers: TT::Base and TT::Table.
438
439 # -----------------------------------------------------------
440 # 0.05    2004-02-27
441 # -----------------------------------------------------------
442 *   Added "COMMENT ON *" syntax to PostgreSQL parser
443
444 *   Some fixes to Oracle parser as reported by Gail Binkley
445
446 *   Added support in PostgreSQL parser for all "ALTER TABLE" statements
447
448 *   Now distributing sqlt-diff script as it's pretty usable
449
450 *   Added new options to sqlt-graph and GraphViz producer (Dave Cash)
451
452 # -----------------------------------------------------------
453 # 0.04    2003-11-07
454 # -----------------------------------------------------------
455
456 *   Increased version of Constants module to 1.41 to avoid a problem
457     where 0.02 has 1.4 of that file and 0.03 had 1.06 which confused
458     CPAN
459
460 *   Hard-coded all the PREREQ_PM modules in Makefile.PL (rather than
461     setting them dynamically) so that automated tests would pass
462
463 # -----------------------------------------------------------
464 # 0.03    2003-11-06
465 # -----------------------------------------------------------
466
467 *   Added parsers: XML::SQLFairy, Sybase, SQLite, DBI-MySQL,
468     DBI-PostgreSQL, DBI-SQLite, DBI-Sybase, Storable, YAML
469
470 *   Added producers: XML::SQLFairy, TTSchema, Storable, YAML
471
472 *   HTML producer now uses stylesheets to allow easy customization of colors
473
474 *   Many bug fixes to most every module
475
476 *   Added "sqlt-dumper" script to help create a script for dumping
477     a database a la "mysqldump"
478
479 *   Reversed the arrowheads on the graphical producers to show the
480     relationships in a more standard way
481
482 *   Changes all included script names to start with "sqlt"
483
484 *   Added capturing and printing most embedded table and field comments
485
486 # -----------------------------------------------------------
487 # 0.02    2003-06-17
488 # -----------------------------------------------------------
489
490 *   Added parsers for Excel and Oracle
491
492 *   Removed Sybase parser because it didn't actually work
493
494 *   Added ClassDBI, Diagram, GraphViz, HTML, POD, SQLite, Sybase producers
495
496 *   Added Schema classes to represent schema as objects
497
498 *   Removed "Raw" producer in favor of the Schema classes
499
500 *   Removed "Validator" class as the Schema classes validate themselves
501
502 *   Improved all existing parsers and producers, expanding them to
503     handle foreign keys much better, produce better output, etc.
504
505 *   Added sqlt-diagram.pl and sqlt-graphviz.pl as CLI frontends to the
506     graphical producers
507
508 *   Added sql_translator.cgi as a web-form frontend to graphical producers
509
510 *   Expanded test suite
511
512 # -----------------------------------------------------------
513 # 0.01    2003-02-27
514 # -----------------------------------------------------------
515
516 *   Added parsers: XML::SQLFairy, Sybase, SQLite, DBI-MySQL,
517     DBI-PostgreSQL, DBI-SQLite, DBI-Sybase, Storable, YAML
518
519 *   Added producers: XML::SQLFairy, TTSchema, Storable, YAML
520
521 *   HTML producer now uses stylesheets to allow easy customization of colors
522
523 *   Many bug fixes to most every module
524
525 *   Added "sqlt-dumper" script to help create a script for dumping
526     a database a la "mysqldump"
527
528 *   Reversed the arrowheads on the graphical producers to show the
529     relationships in a more standard way
530
531 *   Changes all included script names to start with "sqlt"
532
533 *   Added capturing and printing most embedded table and field comments