File tree 2 files changed +6
-0
lines changed
2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ exec = function(cmd)
13
13
return _with_0
14
14
end
15
15
end
16
+ local DEFAULT_SCHEMA = " public"
16
17
local extract_header
17
18
extract_header = function (config , model )
18
19
local table_name = model :table_name ()
@@ -73,6 +74,7 @@ extract_header = function(config, model)
73
74
_continue_0 = true
74
75
break
75
76
end
77
+ line = line :gsub (tostring (DEFAULT_SCHEMA ) .. " %." .. tostring (table_name ), table_name )
76
78
if line :match (" ^ALTER TABLE" ) and not line :match (" ^ALTER TABLE ONLY" ) or line :match (" nextval" ) then
77
79
_continue_0 = true
78
80
break
Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ exec = (cmd) ->
8
8
with f\r ead(" * all" )\g sub " % s* $" , " "
9
9
f\c lose!
10
10
11
+ DEFAULT_SCHEMA = " public"
12
+
11
13
extract_header = (config, model) ->
12
14
table_name = model\t able_name!
13
15
database = assert config.postgres.database, " missing db"
@@ -42,6 +44,8 @@ extract_header = (config, model) ->
42
44
continue if line\ match " ^ALTER SEQUENCE"
43
45
continue if line\ match " ^SELECT"
44
46
47
+ line = line\ gsub " #{DEFAULT_SCHEMA}%.#{table_name}" , table_name
48
+
45
49
if line\ match( " ^ALTER TABLE" ) and not line\ match( " ^ALTER TABLE ONLY" ) or line\ match " nextval"
46
50
continue
47
51
You can’t perform that action at this time.
0 commit comments