File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed
Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ exec = function(cmd)
1313 return _with_0
1414 end
1515end
16+ local DEFAULT_SCHEMA = " public"
1617local extract_header
1718extract_header = function (config , model )
1819 local table_name = model :table_name ()
@@ -73,6 +74,7 @@ extract_header = function(config, model)
7374 _continue_0 = true
7475 break
7576 end
77+ line = line :gsub (tostring (DEFAULT_SCHEMA ) .. " %." .. tostring (table_name ), table_name )
7678 if line :match (" ^ALTER TABLE" ) and not line :match (" ^ALTER TABLE ONLY" ) or line :match (" nextval" ) then
7779 _continue_0 = true
7880 break
Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ exec = (cmd) ->
88 with f\r ead(" * all" )\g sub " % s* $" , " "
99 f\c lose!
1010
11+ DEFAULT_SCHEMA = " public"
12+
1113extract_header = (config, model) ->
1214 table_name = model\t able_name!
1315 database = assert config.postgres.database, " missing db"
@@ -42,6 +44,8 @@ extract_header = (config, model) ->
4244 continue if line\ match " ^ALTER SEQUENCE"
4345 continue if line\ match " ^SELECT"
4446
47+ line = line\ gsub " #{DEFAULT_SCHEMA}%.#{table_name}" , table_name
48+
4549 if line\ match( " ^ALTER TABLE" ) and not line\ match( " ^ALTER TABLE ONLY" ) or line\ match " nextval"
4650 continue
4751
You can’t perform that action at this time.
0 commit comments