-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
67 lines (50 loc) · 1.77 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
require File.join( File.dirname(__FILE__), 'lib', 'postgres', 'dml')
#include Postgres::DML
namespace :postgres do
namespace :dml do
desc "Generate DML for dml_export_tracking table."
task :gen_export_table, :schema, :table do |t,args|
schema = args[:schema]
table = args[:table]
if table.nil? || schema.nil?
raise "You must specify both a table and a schema"
end
PostgresDML.create_dml_export_tracking_table schema, table
end
desc "Generate Reset Button."
task :gen_reset, :schema, :table do |t,args|
schema = args[:schema]
table = args[:table]
if table.nil? || schema.nil?
raise "You must specify both a table and a schema"
end
dml_generater = PostgresDML.new( schema, table )
dml_generater.create_reset_button
end
desc "Generate Exporter Tracking Files for table."
task :gen_exporter, :schema, :table do |t,args|
schema = args[:schema]
table = args[:table]
if table.nil? || schema.nil?
raise "You must specify both a table and a schema"
end
dml_generater = PostgresDML.new( schema, table )
dml_generater.create_dml_table
dml_generater.create_dml_trigger_fn
dml_generater.create_dml_triggers
dml_generater.create_export_fns
dml_generater.create_compute_export_column_order_fn
end
desc "Generate Importer Tracking Files for table."
task :gen_importer, :schema, :table do |t,args|
schema = args[:schema]
table = args[:table]
if table.nil? || schema.nil?
raise "You must specify both a table and a schema"
end
dml_generater = PostgresDML.new( schema, table )
dml_generater.create_dml_table
dml_generater.create_import_fn
end
end
end