Skip to content

Commit

Permalink
Adapt output for "oracle_export"
Browse files Browse the repository at this point in the history
- Add additional attributes to the <entity> tag.
- Use "text" for all string data types.
  • Loading branch information
laurenz committed Feb 27, 2018
1 parent 07da00c commit e6764c6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions ora_migrator--0.9.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2158,8 +2158,10 @@ BEGIN
AND (only_schemas IS NULL
OR schema =ANY (only_schemas))
LOOP
result := result || E'\n <entity name="' || quote_xml(t) || E'">\n'
' <attributes>\n';
result := result || E'\n <entity name="' || quote_xml(t) || E'" label="'
|| quote_xml(t) || E'" description="A '
|| quote_xml(t) || E' entity" delete="false" translatable="false">\n'
|| E' <attributes>\n';

/* loop all columns in the table */
FOR c, ty, nul IN
Expand All @@ -2170,6 +2172,11 @@ BEGIN
OR schema =ANY (only_schemas))
ORDER BY position
LOOP
/* use "text" for all string types */
IF ty LIKE 'character%' THEN
ty := 'text';
END IF;

result := result || E' <attribute name="' || quote_xml(c)
|| E'" datatype="' || quote_xml(ty)
|| E'" required="' || CASE WHEN nul THEN 'false' ELSE 'true' END
Expand Down

0 comments on commit e6764c6

Please sign in to comment.