moved everything into /trunk/ to create the standard svn layout, for use with tools that require this (eg. git-svn). IMPORTANT: do NOT do an `svn up`. instead, re-use your working copy's existing files with `svn switch` (http://svnbook.red-bean.com/en/1.6/svn.ref.svn.c.switch.html).
bin/my2pg: use s!...!...! when either the regexp or the replacement contains / , to avoid unnecessary \-s
bin/my2pg: commenting out table options: added explanatory comment, because it is not obvious from the regexp what this does
bin/my2pg: comment out table options (http://dev.mysql.com/doc/refman/5.5/en/server-sql-mode.html#sqlmode_no_table_options) instead of removing them, because they include table COMMENTs, which contain important metadata such as table definitions. (note that table COMMENTs use a slightly different syntax than column COMMENTs, so the table COMMENTs will not be commented out twice.)
bin/my2pg: comment out COMMENTs instead of removing them so that they will be included in the PostgreSQL translation. COMMENTs contain important metadata about columns, such as definitions and the meanings of integer flag values.
bin/my2pg: added instructions for regenerating *.schema.sql whenever this script is changed
bin/my2pg: COMMENT: also match COMMENTs with embedded ', because there will only be one COMMENT per line, so the contents of the COMMENT can just extend to the last ' on the line
bin/my2pg: replace MySQL ` quotes with " quotes to support exports that were generated without ANSI_QUOTES mode. (this replacement only applies to schema exports, not data.) ANSI_QUOTES is only available with mysqldump --compatible modes that also include NO_TABLE_OPTIONS, which omits important table options such as comments. in particular, these comments are part of schemas/VegCore/VegCore.ERD.mwb but were not being included in VegCore.my.sql.
bin/my2pg*: keep MySQL indefinite dates as text strings instead of translating them (to the first of the month or year) to fit into a PostgreSQL timestamp. this allows the application to decide how to handle these values, which otherwise have no corresponding value in PostgreSQL. this requires changing the date/time related types to text instead of leaving them as-is, so that they can store the custom MySQL strings.
bin/my2pg: use util.sh $top_dir instead of setting $selfDir
bin/my2pg*: use the util.sh sed wrapper, which fixes the LANG=*.UTF-8 "illegal byte sequence" errors on invalid UTF-8
bin/my2pg: support $sql_ascii mode, where varbinary is translated to text instead of bytea
bin/my2pg: remove any () after text
bin/my2pg: unpack custom types set('...')
bin/my2pg: translate varbinary to bytea
bin/my2pg: Translate inline enum type to CHECK constraint
my2pg: Removed SETs for standard_conforming_strings, escape_string_warning because these are also prepended by my2pg.data, which this script's output is piped to
my2pg: Replace tinytext, mediumtext with text
my2pg: Remove (0) after char
my2pg: Remove any (#) after bytea
my2pg: Translate binary to bytea
my2pg: Use my2pg.data to perform data-only replacements, instead of duplicating them in both my2pg and my2pg.data
my2pg: named UNIQUE KEYs: Comment out the name because PostgreSQL requires it to be globally unique, but MySQL only requires it to be unique within the table
my2pg: Translate UNIQUE KEYs instead of removing them
my2pg*: Removed KEYs: Comment out the definition rather than removing it
my2pg*: Remove FOREIGN KEYs because MySQL does not dump tables in dependency order, which prevents PostgreSQL from creating tables whose fkeys refer to a later table
my2pg*: Replacing invalid table elements to remove them: Use a dummy CHECK constraint instead of a boolean field to avoid adding fields to the table. The elements can't always simply be removed because sed can't remove the trailing comma of the previous element, and removing the following comma doesn't work for the last element in the table.
my2pg*: Replace '0000-00-00 00:00:00' with '-infinity'
my2pg: Replace datetime with timestamp
my2pg: Remove COLLATE field attribute
my2pg: Translate blob to bytea
my2pg: Also remove UNIQUE and FULLTEXT inline indexes
my2pg: Also remove (#) after bigint
my2pg: *int types: Added mediumint
my2pg: Also remove column comments. Note that these cannot be translated by sed, because PostgreSQL only allows setting column comments in a separate statement, not inline with the column's entry in the CREATE TABLE statement, and sed can only make replacements contiguous with the input line.
my2pg*: Turn off escape_string_warning because \-escaped strings are standard in MySQL
my2pg: Also remove any CHARACTER SET modifier on a column definition
my2pg: Prepend 'SET standard_conforming_strings = off;' because this defaults to on starting with PostgreSQL 9.1
my2pg, my2pg.data: Fixed bug where replacement for '0000-00-00' date needed to be wrapped in single quotes
my2pg: Also perform data-only replacements, since default values can contain data-specific replacements. This also allows my2pg to transform a combined schema+data export.
Added my2pg