summaryrefslogtreecommitdiffstats
path: root/dia2pg.rb
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2016-12-16 15:31:52 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2016-12-16 15:31:52 +0100
commit9174e85d23c795d30e7f6c72c3f90177d0e04bed (patch)
tree9e4daa057424bc0fa027cb7837256d726a821cad /dia2pg.rb
parent19cf82871c56c3174233444eeb02a97f52cd3d1d (diff)
downloadbin-9174e85d23c795d30e7f6c72c3f90177d0e04bed.zip
bin-9174e85d23c795d30e7f6c72c3f90177d0e04bed.tar.gz
dia2pg: fix --oids
Diffstat (limited to 'dia2pg.rb')
-rwxr-xr-xdia2pg.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/dia2pg.rb b/dia2pg.rb
index cf02445..3937da4 100755
--- a/dia2pg.rb
+++ b/dia2pg.rb
@@ -42,7 +42,7 @@ options.verbose = false
options.input = nil
options.drop = false
options.create = false
-options.odids = false
+options.oids = false
options.user = 'postgres'
options.tbl_prefix = nil
#
@@ -152,8 +152,8 @@ class Table
uq.each do |k,v| r << " UNIQUE(#{v.join ','}),\n" unless v.empty? end
r << " CONSTRAINT pk_#{name} PRIMARY KEY (#{pk.join ','})\n" if pk.length>0
r.sub!(/,\n$/,"\n")
- r << ")\nWITH (\n OIDS=#{@opts.oids ? 'TRUE' : 'FALSE'}\n);\n"
- r << "ALTER TABLE #{name} OWNER TO #{@opts.user};\n"
+ r << ") WITH ( OIDS='FALSE' " if @opts.oids
+ r << ");\nALTER TABLE #{name} OWNER TO #{@opts.user};\n"
idx.each do |k,v| r << "CREATE INDEX ON #{name} (#{v.join ','});\n" end
r
end