/[papo]/papo/xot/Exporters/Pg.py
ViewVC logotype

Diff of /papo/xot/Exporters/Pg.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by jlenton, Wed Sep 3 21:41:38 2003 UTC revision 1.3 by jlenton, Mon Sep 29 21:02:19 2003 UTC
# Line 19  class exporter(DB.exporter): Line 19  class exporter(DB.exporter):
19              assert is_int.search(type)              assert is_int.search(type)
20              type = re.sub(is_int, 'serial', type)              type = re.sub(is_int, 'serial', type)
21          out += type          out += type
22          if default:          if default is not None:
23              out += ' DEFAULT ' + default              out += ' DEFAULT ' + default
24          if not field.null:          if not field.null:
25              out += ' NOT NULL'              out += ' NOT NULL'
# Line 63  class exporter(DB.exporter): Line 63  class exporter(DB.exporter):
63              sql += ('ALTER TABLE %s\n' +              sql += ('ALTER TABLE %s\n' +
64                      '    ADD FOREIGN KEY (%s) REFERENCES %s\n' +                      '    ADD FOREIGN KEY (%s) REFERENCES %s\n' +
65                      '    ON DELETE RESTRICT ON UPDATE RESTRICT;\n') % (                      '    ON DELETE RESTRICT ON UPDATE RESTRICT;\n') % (
66                  ref.table.name, ref.name, ref.symbolic)                  ref.table.name, ref.name, ref.reference.name)
67          return sql          return sql
68            

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26